fixed nasty parser bug: assign to $$ in empty case

This commit is contained in:
Josh Holtrop committed 2011-02-09 23:51:17 -05:00
1 parent 9b28b3ccac
commit 6715b06b44
1 file changed
+7 -7
+7 -7
View File
@@ -161,7 +161,7 @@ extrude: EXTRUDE LCURLY general_items RCURLY {
}
;
general_items: /* empty */
general_items: /* empty */ { $$ = NULL; }
| general_item general_items {
$$ = new ItemsNode();
$$->addChild($1);
@@ -309,7 +309,7 @@ shape_ref: SHAPE IDENTIFIER shape_ref_more {
}
;
shape_ref_more: /* empty */
shape_ref_more: /* empty */ { $$ = NULL; }
| LCURLY general_items RCURLY { $$ = $2; }
;
@@ -375,8 +375,8 @@ expression: expression TIMES expression { $$ = new BinOpNode('*', $1, $3); }
| LPAREN expression RPAREN { $$ = $2; }
;
maybe_expression: /* empty */
| expression { $$ = $1; }
maybe_expression: /* empty */ { $$ = NULL; }
| expression { $$ = $1; }
;
stmt_expression: assignment { $$ = $1; }
@@ -449,7 +449,7 @@ if: IF LPAREN bool_expression RPAREN LCURLY general_items RCURLY if_more {
}
;
if_more: /* empty */
if_more: /* empty */ { $$ = NULL; }
| ELSIF LPAREN bool_expression RPAREN LCURLY general_items RCURLY if_more {
$$ = new IfNode($3, $8);
$$->addChildren($6);
@@ -465,7 +465,7 @@ function_call: IDENTIFIER LPAREN function_call_parameters RPAREN {
}
;
function_call_parameters: /* empty */
function_call_parameters: /* empty */ { $$ = NULL; }
| expression function_call_more_parameters {
$$ = new ItemsNode();
$$->addChild($1);
@@ -473,7 +473,7 @@ function_call_parameters: /* empty */
}
;
function_call_more_parameters: /* empty */
function_call_more_parameters: /* empty */ { $$ = NULL; }
| COMMA expression function_call_more_parameters {
$$ = new ItemsNode();
$$->addChild($2);