Added some more data to expression

main
Øyvind Skaaden 2022-02-13 18:51:33 +01:00
parent c8e292bd0a
commit 35fb48f8b8
1 changed files with 3 additions and 3 deletions

View File

@ -237,13 +237,13 @@ expression:
$$ = $2;
}
| number {
node_init($$ = malloc(sizeof(node_t)), EXPRESSION, NULL, 1, $1);
node_init($$ = malloc(sizeof(node_t)), EXPRESSION, /*NULL*/ strdup("number"), 1, $1);
}
| identifier {
node_init($$ = malloc(sizeof(node_t)), EXPRESSION, NULL, 1, $1);
node_init($$ = malloc(sizeof(node_t)), EXPRESSION, /*NULL*/ strdup("identifier"), 1, $1);
}
| identifier '(' argument_list ')' {
node_init($$ = malloc(sizeof(node_t)), EXPRESSION, NULL, 2, $1, $3);
node_init($$ = malloc(sizeof(node_t)), EXPRESSION, /*NULL*/ strdup("function_call"), 2, $1, $3);
}
;