From fe9731da666d2ee3fd7dd07c5aea8ce0b89de4a9 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Tue, 16 Jul 2002 19:49:03 +0000 Subject: [PATCH] * 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 --- src/tools/jam/parse.c | 17 ++++++++++++++++- src/tools/jam/parse.h | 2 ++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/tools/jam/parse.c b/src/tools/jam/parse.c index 1e8681227e..50e7f5cfdb 100644 --- a/src/tools/jam/parse.c +++ b/src/tools/jam/parse.c @@ -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 ), diff --git a/src/tools/jam/parse.h b/src/tools/jam/parse.h index e1c0575a38..8b8d07a051 100644 --- a/src/tools/jam/parse.h +++ b/src/tools/jam/parse.h @@ -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 ),