fix: use R-values but not only S-Expr

This commit is contained in:
Eatswap 2022-12-11 19:49:32 +08:00
parent 0fb6c19e34
commit 9346a85884
Signed by: Eatswap
GPG Key ID: BE661106A1F3FA0B
2 changed files with 4 additions and 4 deletions

View File

@ -229,8 +229,8 @@ S-Expr-if
S-Expr-loop
: LOOP S-Exprs { std::printf("Parsed S-Expr-loop -> LOOP S-Exprs\n"); }
| LOOP FOR IDENTIFIER FROM S-Expr TO S-Expr DO S-Exprs { std::printf("Parsed S-Expr-loop -> LOOP FOR IDENTIFIER FROM S-Expr TO S-Expr DO S-Exprs\n"); }
| DOTIMES LPAREN IDENTIFIER S-Expr RPAREN S-Exprs { std::printf("Parsed S-Expr-loop -> DOTIMES ( IDENTIFIER S-Expr ) S-Exprs\n"); }
| LOOP FOR IDENTIFIER FROM R-Value TO R-Value DO S-Exprs { std::printf("Parsed S-Expr-loop -> LOOP FOR IDENTIFIER FROM R-Value TO R-Value DO S-Exprs\n"); }
| DOTIMES LPAREN IDENTIFIER R-Value RPAREN S-Exprs { std::printf("Parsed S-Expr-loop -> DOTIMES LPAREN IDENTIFIER R-Value RPAREN S-Exprs\n"); }
;
func-def

View File

@ -43,7 +43,7 @@
(print "Hello, world!") ; prints Hello, world!
(loop
for i from 1 to 10
for i from 1 to (+ 1505 -1495)
do (print i)
) ; prints 1 2 3 4 5 6 7 8 9 10