diff options
author | Marius Kintel <marius@kintel.net> | 2013-05-04 23:17:18 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2013-05-04 23:17:18 (GMT) |
commit | ada8185c769784d11381a78c925531efb9980777 (patch) | |
tree | 163c4241d457e7636b555611e1e1dc1d98fbe6ed /src/parser.y | |
parent | 15c3a1bf6f06684cd3b13a39a8cde6c11cea66ae (diff) |
Backported to bison 2.4
Diffstat (limited to 'src/parser.y')
-rw-r--r-- | src/parser.y | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/parser.y b/src/parser.y index 272f801..464f992 100644 --- a/src/parser.y +++ b/src/parser.y @@ -175,13 +175,13 @@ TOK_MODULE TOK_ID '(' arguments_decl optional_commas ')' { if_statement: TOK_IF '(' expr ')' { - $<ifelse>if = new IfElseModuleInstantiation(); - $<ifelse>if->arguments.push_back(Assignment("", $3)); - $<ifelse>if->setPath(parser_source_path); - scope_stack.push(&$<ifelse>if->scope); -}[if] child_statement { + $<ifelse>$ = new IfElseModuleInstantiation(); + $<ifelse>$->arguments.push_back(Assignment("", $3)); + $<ifelse>$->setPath(parser_source_path); + scope_stack.push(&$<ifelse>$->scope); +} child_statement { scope_stack.pop(); - $$ = $<ifelse>if; + $$ = $<ifelse>5; } ; ifelse_statement: @@ -190,7 +190,7 @@ if_statement { } | if_statement TOK_ELSE { scope_stack.push(&$1->else_scope); -}[else] child_statement { +} child_statement { scope_stack.pop(); $$ = $1; } ; @@ -213,11 +213,11 @@ module_instantiation: $$ = NULL; } | single_module_instantiation { - $<inst>inst = $1; - scope_stack.push(&$<inst>inst->scope); -}[inst] child_statement { + $<inst>$ = $1; + scope_stack.push(&$1->scope); +} child_statement { scope_stack.pop(); - $$ = $<inst>inst; + $$ = $<inst>2; } | ifelse_statement { $$ = $1; |