From eaa98db6fd16b6708a2ba253fba1676cb885e5ca Mon Sep 17 00:00:00 2001 From: Rick Winfrey Date: Thu, 9 Nov 2017 16:39:48 -0800 Subject: [PATCH] Assign identifiers for the receiver of method declarations --- src/Language/Go/Assignment.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Language/Go/Assignment.hs b/src/Language/Go/Assignment.hs index ed7ba490a..67dc79001 100644 --- a/src/Language/Go/Assignment.hs +++ b/src/Language/Go/Assignment.hs @@ -482,11 +482,11 @@ importSpec :: Assignment importSpec = symbol ImportSpec *> children expressions methodDeclaration :: Assignment -methodDeclaration = mkTypedMethodDeclaration <$> symbol MethodDeclaration <*> children ((,,,,) <$> receiver <*> fieldIdentifier <*> parameters <*> (typeIdentifier <|> emptyTerm) <*> block) +methodDeclaration = mkTypedMethodDeclaration <$> symbol MethodDeclaration <*> children ((,,,,) <$> receiver <*> fieldIdentifier <*> parameters <*> (expression <|> emptyTerm) <*> block) where parameterDeclaration = symbol ParameterDeclaration *> (children (many expression) <|> many emptyTerm) parameters = symbol Parameters *> children (parameterDeclaration <|> many expression) - receiver = symbol Parameters *> children (symbol ParameterDeclaration *> children expressions) + receiver = symbol Parameters *> children ((symbol ParameterDeclaration *> children expressions) <|> expressions) mkTypedMethodDeclaration loc (receiver', name', parameters', type'', body') = makeTerm loc (Declaration.Method [type''] receiver' name' parameters' body') methodSpec :: Assignment