added unroll loop construct

This commit is contained in:
Irmen de Jong
2023-03-14 23:37:49 +01:00
parent c07cd72e85
commit fd25e85d59
11 changed files with 139 additions and 0 deletions
+3
View File
@@ -92,6 +92,7 @@ statement :
| whileloop
| untilloop
| repeatloop
| unrollloop
| whenstmt
| breakstmt
| labeldef
@@ -289,6 +290,8 @@ untilloop: 'do' (statement | statement_block) EOL? 'until' expression ;
repeatloop: 'repeat' expression? EOL? (statement | statement_block) ;
unrollloop: 'unroll' integerliteral? EOL? (statement | statement_block) ;
whenstmt: 'when' expression '{' EOL (when_choice | EOL) * '}' EOL? ;
when_choice: (expression_list | 'else' ) '->' (statement | statement_block ) ;