summaryrefslogtreecommitdiff
path: root/src/frontend/parser.y
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-01-29 22:54:34 -0500
committerbd <bdunahu@operationnull.com>2025-01-29 22:54:34 -0500
commit74f8caa95f6a41a619ce54d193879cb240b9992f (patch)
tree67b26ca8093b44f42b94337748004edebe35441d /src/frontend/parser.y
parenta27138cd3fb680b616c04fed02b73d630b681451 (diff)
Add emission procedures for binary ops, fix unary parsing error
Diffstat (limited to 'src/frontend/parser.y')
-rw-r--r--src/frontend/parser.y8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/frontend/parser.y b/src/frontend/parser.y
index bd5d127..f8c574a 100644
--- a/src/frontend/parser.y
+++ b/src/frontend/parser.y
@@ -86,15 +86,15 @@ term: factor {
add_child($$, $1);
add_child($$, $3);
}
-| un_op exp {
- $$ = create_expr($1);
- add_child($$, $2);
- }
;
factor: NUMBER {
$$ = create_const($1);
}
+| un_op factor {
+ $$ = create_expr($1);
+ add_child($$, $2);
+ }
| L_PAREN exp R_PAREN {
$$ = $2;
}