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

Commit d7fedfd

Browse files
committed
Leave functionDefinition the way it was.
1 parent c550b6b commit d7fedfd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Language/Python/Assignment.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,9 +279,10 @@ 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)) <*> expressions)
283-
<|> makeFunctionDeclaration <$> (symbol Lambda' <|> symbol Lambda) <*> children ((,,,) <$ token AnonLambda <*> emptyTerm <*> (symbol LambdaParameters *> children (manyTerm expression) <|> pure []) <*> optional (symbol Type *> children (term expression)) <*> expressions)
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
285+
expressions' = makeTerm <$> location <*> manyTerm expression
285286
makeFunctionDeclaration loc (functionName', functionParameters, ty, functionBody)
286287
= let fn = makeTerm loc (Declaration.Function [] functionName' functionParameters functionBody)
287288
in maybe fn (makeTerm loc . Type.Annotation fn) ty

0 commit comments

Comments
 (0)