From b6e281a0aa7b0809365f260939d1a48069a2178a Mon Sep 17 00:00:00 2001 From: Rick Winfrey Date: Wed, 1 Nov 2017 10:48:05 -0700 Subject: [PATCH] Assign function declarations whose return type is a list of parameters --- src/Language/Go/Assignment.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Language/Go/Assignment.hs b/src/Language/Go/Assignment.hs index 6bf9cc4ed..ea6cd31a3 100644 --- a/src/Language/Go/Assignment.hs +++ b/src/Language/Go/Assignment.hs @@ -385,9 +385,10 @@ expressionList :: Assignment expressionList = symbol ExpressionList *> children expressions functionDeclaration :: Assignment -functionDeclaration = mkTypedFunctionDeclaration <$> symbol FunctionDeclaration <*> children ((,,,) <$> expression <*> parameters <*> (expression <|> emptyTerm) <*> block) +functionDeclaration = mkTypedFunctionDeclaration <$> symbol FunctionDeclaration <*> children ((,,,) <$> expression <*> parameters <*> (expression <|> parameters' <|> emptyTerm) <*> block) where mkTypedFunctionDeclaration loc (name', params', types', block') = makeTerm loc (Declaration.Function [types'] name' params' block') parameters = symbol Parameters *> children (many expression) + parameters' = makeTerm <$> symbol Parameters <*> children (many expression) variadicParameterDeclaration :: Assignment variadicParameterDeclaration = mkVariadic <$> symbol VariadicParameterDeclaration <*> children ((,) <$> emptyTerm <*> expression)