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

Commit c550b6b

Browse files
committed
Just use expressions.
1 parent df59eac commit c550b6b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Language/Python/Assignment.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ forStatement = symbol ForStatement >>= \ loc -> children (make loc <$> (symbol V
253253
Just a -> makeTerm loc (Statement.Else (makeTerm loc $ Statement.ForEach binding subject body) a)
254254

255255
whileStatement :: Assignment Term
256-
whileStatement = symbol WhileStatement >>= \ loc -> children (make loc <$> term expression <*> block <*> optional (symbol ElseClause *> children expressions))
256+
whileStatement = symbol WhileStatement >>= \ loc -> children (make loc <$> term expression <*> expressions <*> optional (symbol ElseClause *> children expressions))
257257
where
258258
make loc whileCondition whileBody whileElseClause = case whileElseClause of
259259
Nothing -> makeTerm loc (Statement.While whileCondition whileBody)
@@ -279,8 +279,8 @@ functionParam = (makeParameter <$> location <*> identifier)
279279

280280
functionDefinition :: Assignment Term
281281
functionDefinition =
282-
makeFunctionDeclaration <$> symbol FunctionDefinition <*> children ((,,,) <$> term expression <* symbol Parameters <*> children (manyTerm functionParam) <*> optional (symbol Type *> children (term expression)) <*> block)
283-
<|> makeFunctionDeclaration <$> (symbol Lambda' <|> symbol Lambda) <*> children ((,,,) <$ token AnonLambda <*> emptyTerm <*> (symbol LambdaParameters *> children (manyTerm expression) <|> pure []) <*> optional (symbol Type *> children (term expression)) <*> block)
282+
makeFunctionDeclaration <$> symbol FunctionDefinition <*> children ((,,,) <$> term expression <* symbol Parameters <*> children (manyTerm functionParam) <*> optional (symbol Type *> children (term expression)) <*> expressions)
283+
<|> makeFunctionDeclaration <$> (symbol Lambda' <|> symbol Lambda) <*> children ((,,,) <$ token AnonLambda <*> emptyTerm <*> (symbol LambdaParameters *> children (manyTerm expression) <|> pure []) <*> optional (symbol Type *> children (term expression)) <*> expressions)
284284
where
285285
makeFunctionDeclaration loc (functionName', functionParameters, ty, functionBody)
286286
= let fn = makeTerm loc (Declaration.Function [] functionName' functionParameters functionBody)

0 commit comments

Comments
 (0)