Now compiles without warning.

This commit is contained in:
2024-11-16 10:15:30 -05:00
parent 363188d7d6
commit e5bb4dfd96
2 changed files with 12 additions and 8 deletions

View File

@@ -23,10 +23,13 @@
%%
exp:
NUM { $$ = ast_type_num_init($1); }
NUM { $$ = ast_init(AST_TYPE_NUM, ast_type_num_init($1)); }
| NUM PLUS NUM {
AST* argv[2] = {ast_type_num_init($1), ast_type_num_init($1)};
$$ = ast_type_call_init("+", 2, argv);
AST* argv[2] = {
ast_init(AST_TYPE_NUM, ast_type_num_init($1)),
ast_init(AST_TYPE_NUM, ast_type_num_init($1))
};
$$ = ast_init(AST_TYPE_CALL, ast_type_call_init("+", 2, argv));
};
%%