A jumptoeof must fall through rule invocations as well.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6529 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2004-02-08 23:01:34 +00:00
parent 1f6a1c0197
commit 7b0cd0ecb0
3 changed files with 17 additions and 6 deletions
+12 -4
View File
@@ -515,7 +515,15 @@ compile_rule(
/* Run rules, appending results from each */ /* Run rules, appending results from each */
for( l = ll; l; l = list_next( l ) ) for( l = ll; l; l = list_next( l ) )
result = evaluate_rule( l->string, nargs, result ); {
int localJmp = JMP_NONE;
result = evaluate_rule( l->string, nargs, result, &localJmp );
if (localJmp == JMP_EOF)
{
*jmp = JMP_EOF;
break;
}
}
list_free( ll ); list_free( ll );
lol_free( nargs ); lol_free( nargs );
@@ -531,7 +539,8 @@ LIST *
evaluate_rule( evaluate_rule(
const char *rulename, const char *rulename,
LOL *args, LOL *args,
LIST *result ) LIST *result,
int *jmp )
{ {
RULE *rule = bindrule( rulename ); RULE *rule = bindrule( rulename );
@@ -576,7 +585,6 @@ evaluate_rule(
{ {
PARSE *parse = rule->procedure; PARSE *parse = rule->procedure;
SETTINGS *s = 0; SETTINGS *s = 0;
int jmp = JMP_NONE;
LIST *l; LIST *l;
int i; int i;
@@ -593,7 +601,7 @@ evaluate_rule(
parse_refer( parse ); parse_refer( parse );
pushsettings( s ); pushsettings( s );
result = list_append( result, (*parse->func)( parse, args, &jmp ) ); result = list_append( result, (*parse->func)( parse, args, jmp ) );
popsettings( s ); popsettings( s );
freesettings( s ); freesettings( s );
+1 -1
View File
@@ -36,7 +36,7 @@ LIST *compile_settings( PARSE *parse, LOL *args, int *jmp );
LIST *compile_switch( PARSE *parse, LOL *args, int *jmp ); LIST *compile_switch( PARSE *parse, LOL *args, int *jmp );
LIST *compile_while( PARSE *parse, LOL *args, int *jmp ); LIST *compile_while( PARSE *parse, LOL *args, int *jmp );
LIST *evaluate_rule( const char *rulename, LOL *args, LIST *result ); LIST *evaluate_rule( const char *rulename, LOL *args, LIST *result, int *jmp );
/* Conditions for compile_if() */ /* Conditions for compile_if() */
+4 -1
View File
@@ -81,7 +81,10 @@ headers( TARGET *t )
#endif #endif
if( lol_get( &lol, 1 ) ) if( lol_get( &lol, 1 ) )
list_free( evaluate_rule( hdrrule->string, &lol, L0 ) ); {
int jmp = JMP_NONE;
list_free( evaluate_rule( hdrrule->string, &lol, L0, &jmp ) );
}
/* Clean up */ /* Clean up */