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

Commit 5c2329c

Browse files
committed
Use block in functionDefinition.
1 parent e2438a4 commit 5c2329c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/Language/Python/Assignment.hs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,10 +278,9 @@ functionParam = (makeParameter <$> location <*> identifier)
278278

279279
functionDefinition :: Assignment Term
280280
functionDefinition =
281-
makeFunctionDeclaration <$> symbol FunctionDefinition <*> children ((,,,) <$> term expression <* symbol Parameters <*> children (manyTerm functionParam) <*> optional (symbol Type *> children (term expression)) <*> expressions')
282-
<|> makeFunctionDeclaration <$> (symbol Lambda' <|> symbol Lambda) <*> children ((,,,) <$ token AnonLambda <*> emptyTerm <*> (symbol LambdaParameters *> children (manyTerm expression) <|> pure []) <*> optional (symbol Type *> children (term expression)) <*> expressions')
281+
makeFunctionDeclaration <$> symbol FunctionDefinition <*> children ((,,,) <$> term expression <* symbol Parameters <*> children (manyTerm functionParam) <*> optional (symbol Type *> children (term expression)) <*> block)
282+
<|> makeFunctionDeclaration <$> (symbol Lambda' <|> symbol Lambda) <*> children ((,,,) <$ token AnonLambda <*> emptyTerm <*> (symbol LambdaParameters *> children (manyTerm expression) <|> pure []) <*> optional (symbol Type *> children (term expression)) <*> block)
283283
where
284-
expressions' = makeTerm <$> location <*> manyTerm expression
285284
makeFunctionDeclaration loc (functionName', functionParameters, ty, functionBody)
286285
= let fn = makeTerm loc (Declaration.Function [] functionName' functionParameters functionBody)
287286
in maybe fn (makeTerm loc . Type.Annotation fn) ty

0 commit comments

Comments
 (0)