Removing in_hook variable in parser.

I believe that's unnecessary and tests indeed pass just fine without it.
This commit is contained in:
Robin Sommer 2012-11-23 18:46:57 -08:00
parent d9bb9e0eb1
commit 6c2ee1ef54

View file

@ -119,7 +119,6 @@ extern const char* g_curr_debug_error;
#define YYLTYPE yyltype #define YYLTYPE yyltype
static bool in_hook = false;
int in_init = 0; int in_init = 0;
int in_record = 0; int in_record = 0;
bool resolving_global_ID = false; bool resolving_global_ID = false;
@ -1373,11 +1372,11 @@ stmt:
brofiler.AddStmt($$); brofiler.AddStmt($$);
} }
| TOK_HOOK { in_hook = true; } hook { in_hook = false; } ';' opt_no_test | TOK_HOOK hook ';' opt_no_test
{ {
set_location(@1, @5); set_location(@1, @4);
$$ = new HookStmt($3); $$ = new HookStmt($2);
if ( ! $6 ) if ( ! $4 )
brofiler.AddStmt($$); brofiler.AddStmt($$);
} }
@ -1538,7 +1537,7 @@ hook:
expr '(' opt_expr_list ')' expr '(' opt_expr_list ')'
{ {
set_location(@1, @4); set_location(@1, @4);
$$ = new CallExpr($1, $3, in_hook); $$ = new CallExpr($1, $3, true);
} }
; ;