From 5f2a792b63c6f1cde4f09baca014c3c1af645c77 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Tue, 16 Jul 2002 19:44:36 +0000 Subject: [PATCH] * Added compile_jumptoeof() as parsing hook for jumptoeof. * Adjusted compile_rules() to terminate once jumptoeof was run. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@255 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/tools/jam/compile.c | 18 ++++++++++++++++-- src/tools/jam/compile.h | 1 + 2 files changed, 17 insertions(+), 2 deletions(-) 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 );