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

This commit is contained in:
Josh Holtrop 2011-02-09 23:51:17 -05:00
parent 9b28b3ccac
commit 6715b06b44

View File

@ -161,7 +161,7 @@ extrude: EXTRUDE LCURLY general_items RCURLY {
} }
; ;
general_items: /* empty */ general_items: /* empty */ { $$ = NULL; }
| general_item general_items { | general_item general_items {
$$ = new ItemsNode(); $$ = new ItemsNode();
$$->addChild($1); $$->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; } | LCURLY general_items RCURLY { $$ = $2; }
; ;
@ -375,7 +375,7 @@ expression: expression TIMES expression { $$ = new BinOpNode('*', $1, $3); }
| LPAREN expression RPAREN { $$ = $2; } | LPAREN expression RPAREN { $$ = $2; }
; ;
maybe_expression: /* empty */ maybe_expression: /* empty */ { $$ = NULL; }
| expression { $$ = $1; } | expression { $$ = $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 { | ELSIF LPAREN bool_expression RPAREN LCURLY general_items RCURLY if_more {
$$ = new IfNode($3, $8); $$ = new IfNode($3, $8);
$$->addChildren($6); $$->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 { | expression function_call_more_parameters {
$$ = new ItemsNode(); $$ = new ItemsNode();
$$->addChild($1); $$->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 { | COMMA expression function_call_more_parameters {
$$ = new ItemsNode(); $$ = new ItemsNode();
$$->addChild($2); $$->addChild($2);