* Added parse_jumptoeof() to set the jumptoeof flag and parse_shall_skip() to
get it. * Adjusted parse_file() to terminate when jumptoeof was invoked and reset the jumptoeof flag. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@256 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
5f2a792b63
commit
fe9731da66
@ -21,6 +21,8 @@
|
||||
|
||||
static PARSE *yypsave;
|
||||
|
||||
static int jumptoeof = 0;
|
||||
|
||||
void
|
||||
parse_file( char *f )
|
||||
{
|
||||
@ -33,7 +35,7 @@ parse_file( char *f )
|
||||
/* Execute it outside of the parser so that recursive */
|
||||
/* calls to yyrun() work (no recursive yyparse's). */
|
||||
|
||||
for(;;)
|
||||
while (!parse_shall_skip())
|
||||
{
|
||||
LOL l;
|
||||
PARSE *p;
|
||||
@ -57,6 +59,7 @@ parse_file( char *f )
|
||||
|
||||
parse_free( p );
|
||||
}
|
||||
jumptoeof = 0;
|
||||
}
|
||||
|
||||
void
|
||||
@ -65,6 +68,18 @@ parse_save( PARSE *p )
|
||||
yypsave = p;
|
||||
}
|
||||
|
||||
void
|
||||
parse_jumptoeof()
|
||||
{
|
||||
jumptoeof = 1;
|
||||
}
|
||||
|
||||
int
|
||||
parse_shall_skip()
|
||||
{
|
||||
return jumptoeof;
|
||||
}
|
||||
|
||||
PARSE *
|
||||
parse_make(
|
||||
LIST *(*func)( PARSE *p, LOL *args ),
|
||||
|
@ -27,6 +27,8 @@ struct _PARSE {
|
||||
|
||||
void parse_file( char *f );
|
||||
void parse_save( PARSE *p );
|
||||
void parse_jumptoeof();
|
||||
int parse_shall_skip();
|
||||
|
||||
PARSE * parse_make(
|
||||
LIST *(*func)( PARSE *p, LOL *args ),
|
||||
|
Loading…
Reference in New Issue
Block a user