Compare commits

..

2 Commits

Author SHA1 Message Date
Eatswap 57033c3452
fix: remove redundant const 2022-12-12 23:18:39 +08:00
Eatswap 4bb8773d5d
fix: allow return from if, allow empty function arg list 2022-12-12 23:17:49 +08:00
2 changed files with 4 additions and 3 deletions

View File

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

View File

@ -24,7 +24,7 @@ public:
using FlexLexer::yylex; using FlexLexer::yylex;
virtual int yylex( virtual int yylex(
DragonLisp::DLParser::semantic_type* const lval, DragonLisp::DLParser::semantic_type* lval,
DragonLisp::DLParser::location_type* location, DragonLisp::DLParser::location_type* location,
DragonLisp::DLDriver& drv DragonLisp::DLDriver& drv
); );