Added noassoc to if then and else
parent
3640b61246
commit
23f2148948
|
@ -11,7 +11,11 @@
|
|||
%nonassoc UMINUS
|
||||
%right '~'
|
||||
|
||||
%nonassoc IF THEN
|
||||
%nonassoc ELSE
|
||||
|
||||
%%
|
||||
|
||||
program:
|
||||
global_list {
|
||||
node_init(root = malloc(sizeof(node_t)), PROGRAM, NULL, 1, $1);
|
||||
|
@ -94,8 +98,8 @@ declaration_list:
|
|||
declaration {
|
||||
node_init($$ = malloc(sizeof(node_t)), DECLARATION_LIST, NULL, 1, $1);
|
||||
}
|
||||
| declaration_list ',' declaration {
|
||||
node_init($$ = malloc(sizeof(node_t)), DECLARATION_LIST, NULL, 2, $1, $3);
|
||||
| declaration_list declaration {
|
||||
node_init($$ = malloc(sizeof(node_t)), DECLARATION_LIST, NULL, 2, $1, $2);
|
||||
}
|
||||
;
|
||||
|
||||
|
|
Loading…
Reference in New Issue