fix: allow return from if, allow empty function arg list

This commit is contained in:
Eatswap 2022-12-12 23:17:49 +08:00
parent bc054afe82
commit 4bb8773d5d
Signed by: Eatswap
GPG Key ID: BE661106A1F3FA0B
1 changed files with 3 additions and 2 deletions

View File

@ -248,8 +248,8 @@ list-tokens
;
S-Expr-if
: IF R-Value R-Value R-Value { std::printf("Parsed S-Expr-if -> IF R-Value R-Value R-Value\n"); }
| IF R-Value R-Value { std::printf("Parsed S-Expr-if -> IF R-Value R-Value\n"); }
: IF R-Value func-body-expr func-body-expr { std::printf("Parsed S-Expr-if -> IF R-Value func-body-expr func-body-expr\n"); }
| IF R-Value func-body-expr { std::printf("Parsed S-Expr-if -> IF R-Value func-body-expr\n"); }
;
S-Expr-loop
@ -273,6 +273,7 @@ identifier-list
S-Expr-func-call
: IDENTIFIER R-Value-list { std::printf("Parsed S-Expr-func-call -> IDENTIFIER R-Value-list\n"); }
| IDENTIFIER { std::printf("Parsed S-Expr-func-call -> IDENTIFIER\n"); }
;
%%