* 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
This commit is contained in:
Ingo Weinhold 2002-07-16 19:44:36 +00:00
parent e73bb7c88e
commit 5f2a792b63
2 changed files with 17 additions and 2 deletions

View File

@ -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 ));
}
/*

View File

@ -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 );