diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-04-07 01:28:45 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-04-07 01:28:45 +0300 |
| commit | 170f3ddc3d8967c0b5d4755c0221c396db215b2f (patch) | |
| tree | 00314209cd7878b9d5b3fe6fc2e0c7297f76dec8 /src/parser.y | |
| parent | 2bdf1f8b1856bca8091d66a7a447e6c90993c297 (diff) | |
| download | ek-170f3ddc3d8967c0b5d4755c0221c396db215b2f.tar.gz ek-170f3ddc3d8967c0b5d4755c0221c396db215b2f.zip | |
implement some initial qbt backend stuff
Diffstat (limited to 'src/parser.y')
| -rw-r--r-- | src/parser.y | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/parser.y b/src/parser.y index 14fbb50..d6aefc8 100644 --- a/src/parser.y +++ b/src/parser.y @@ -375,11 +375,11 @@ expr * "do" looks a bit cleaner. There is the slight annoyance that a very * long do {} ... might have a 'while'; at the end, not sure if do ... * while should be removed from the language altogether or what */ - | "do" body { $$ = $2; } - | "do" expr_if { $$ = $2; } - | "do" "const" expr_if { $$ = $3; } - | "do" switch { $$ = $2; } - | "do" "const" switch { $$ = $3; } + | "do" body { $$ = $2; ast_set_flags($$, AST_FLAG_DOEXPR); } + | "do" expr_if { $$ = $2; ast_set_flags($$, AST_FLAG_DOEXPR); } + | "do" "const" expr_if { $$ = $3; ast_set_flags($$, AST_FLAG_DOEXPR); } + | "do" switch { $$ = $2; ast_set_flags($$, AST_FLAG_DOEXPR); } + | "do" "const" switch { $$ = $3; ast_set_flags($$, AST_FLAG_DOEXPR); } | expr "(" opt_exprs ")" { $$ = gen_call($1, $3, src_loc(@$)); } | expr "[" expr "]" { $$ = gen_arr_access($1, $3, src_loc(@$)); } | "sizeof" expr { $$ = gen_sizeof($2, src_loc(@$)); } |
