Implement the while loop

This commit is contained in:
2024-11-24 13:05:11 +01:00
parent 0c9799b887
commit f7b36cb81d
15 changed files with 89 additions and 53 deletions

View File

@@ -188,7 +188,7 @@ statementP
<|> ifElseP
<|> CompoundStatement <$> blockP (many statementP)
<|> try assignmentP
-- <|> try whileP
<|> try whileP
<|> callP
<?> "statement"
where
@@ -200,9 +200,9 @@ statementP
<$> (symbol "if" *> parensP conditionP)
<*> statementP
<*> optional (symbol "else" *> statementP)
{-whileP = WhileStatement
whileP = WhileStatement
<$> (symbol "while" *> parensP conditionP)
<*> statementP -}
<*> statementP
assignmentP = AssignmentStatement
<$> variableAccessP
<* symbol ":="