added while parser rule

This commit is contained in:
Felix Müller 2024-05-06 14:13:43 +02:00
parent f8c888216a
commit 5d155416b4
1 changed files with 3 additions and 0 deletions

View File

@ -89,6 +89,7 @@ statementlist: statementlist statement
statement: assign statement: assign
| decl | decl
| definition | definition
| while
| branch; | branch;
branchif: KeyIf expr '{' statementlist '}' { DEBUG("if"); }; branchif: KeyIf expr '{' statementlist '}' { DEBUG("if"); };
@ -101,6 +102,8 @@ branchelseifs: branchelseifs branchelseif
branch: branchif branchelseifs branch: branchif branchelseifs
| branchif branchelseifs branchelse; | branchif branchelseifs branchelse;
while: KeyWhile expr '{' statementlist '}' { DEBUG("while"); };
identlist: Ident ',' identlist identlist: Ident ',' identlist
| Ident | Ident
| ; | ;