diff --git a/src/tools/jam/compile.c b/src/tools/jam/compile.c index c0096111e2..0a7683d0d6 100644 --- a/src/tools/jam/compile.c +++ b/src/tools/jam/compile.c @@ -379,6 +379,19 @@ compile_null( return L0; } +/* + * compile_jumptoeof() - terminates parsing of the current file + */ + +LIST * +compile_jumptoeof( + PARSE *parse, + LOL *args ) +{ + parse_jumptoeof(); + return L0; +} + /* * compile_on() - run rule under influence of on-target variables * @@ -541,9 +554,10 @@ compile_rules( /* Optimize recursion on the right by looping. */ do list_free( (*parse->left->func)( parse->left, args ) ); - while( (parse = parse->right)->func == compile_rules ); + while( (parse = parse->right)->func == compile_rules + && !parse_shall_skip() ); - return (*parse->func)( parse, args ); + return (parse_shall_skip() ? L0 :(*parse->func)( parse, args )); } /* diff --git a/src/tools/jam/compile.h b/src/tools/jam/compile.h index ea8301269a..6e66fe11c1 100644 --- a/src/tools/jam/compile.h +++ b/src/tools/jam/compile.h @@ -15,6 +15,7 @@ LIST *compile_foreach( PARSE *parse, LOL *args ); LIST *compile_if( PARSE *parse, LOL *args ); LIST *compile_eval( PARSE *parse, LOL *args ); LIST *compile_include( PARSE *parse, LOL *args ); +LIST *compile_jumptoeof( PARSE *parse, LOL *args ); LIST *compile_list( PARSE *parse, LOL *args ); LIST *compile_local( PARSE *parse, LOL *args ); LIST *compile_null( PARSE *parse, LOL *args );