Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Commit e106819

Browse files
committed
Use block in while.
1 parent 5c2329c commit e106819

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Language/Python/Assignment.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ forStatement = symbol ForStatement >>= \ loc -> children (make loc <$> (symbol V
252252
Just a -> makeTerm loc (Statement.Else (makeTerm loc $ Statement.ForEach binding subject body) a)
253253

254254
whileStatement :: Assignment Term
255-
whileStatement = symbol WhileStatement >>= \ loc -> children (make loc <$> term expression <*> (makeTerm <$> location <*> manyTermsTill expression (void (symbol ElseClause) <|> eof)) <*> optional (symbol ElseClause *> children expressions))
255+
whileStatement = symbol WhileStatement >>= \ loc -> children (make loc <$> term expression <*> block <*> optional (symbol ElseClause *> children expressions))
256256
where
257257
make loc whileCondition whileBody whileElseClause = case whileElseClause of
258258
Nothing -> makeTerm loc (Statement.While whileCondition whileBody)

0 commit comments

Comments
 (0)