Added noassoc to if then and else

main
Øyvind Skaaden 2022-02-13 18:34:52 +01:00
parent 3640b61246
commit 23f2148948
1 changed files with 6 additions and 2 deletions

View File

@ -11,7 +11,11 @@
%nonassoc UMINUS %nonassoc UMINUS
%right '~' %right '~'
%nonassoc IF THEN
%nonassoc ELSE
%% %%
program: program:
global_list { global_list {
node_init(root = malloc(sizeof(node_t)), PROGRAM, NULL, 1, $1); node_init(root = malloc(sizeof(node_t)), PROGRAM, NULL, 1, $1);
@ -94,8 +98,8 @@ declaration_list:
declaration { declaration {
node_init($$ = malloc(sizeof(node_t)), DECLARATION_LIST, NULL, 1, $1); node_init($$ = malloc(sizeof(node_t)), DECLARATION_LIST, NULL, 1, $1);
} }
| declaration_list ',' declaration { | declaration_list declaration {
node_init($$ = malloc(sizeof(node_t)), DECLARATION_LIST, NULL, 2, $1, $3); node_init($$ = malloc(sizeof(node_t)), DECLARATION_LIST, NULL, 2, $1, $2);
} }
; ;