From ada8185c769784d11381a78c925531efb9980777 Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Sun, 5 May 2013 01:17:18 +0200 Subject: Backported to bison 2.4 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 ')' { - $if = new IfElseModuleInstantiation(); - $if->arguments.push_back(Assignment("", $3)); - $if->setPath(parser_source_path); - scope_stack.push(&$if->scope); -}[if] child_statement { + $$ = new IfElseModuleInstantiation(); + $$->arguments.push_back(Assignment("", $3)); + $$->setPath(parser_source_path); + scope_stack.push(&$$->scope); +} child_statement { scope_stack.pop(); - $$ = $if; + $$ = $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 = $1; - scope_stack.push(&$inst->scope); -}[inst] child_statement { + $$ = $1; + scope_stack.push(&$1->scope); +} child_statement { scope_stack.pop(); - $$ = $inst; + $$ = $2; } | ifelse_statement { $$ = $1; -- cgit v0.10.1