From bafff20f3bf1f495bc872685424255c6a9088377 Mon Sep 17 00:00:00 2001 From: Rick Winfrey Date: Thu, 30 Nov 2017 16:02:16 -0800 Subject: [PATCH] Tokenize the `fun` keyword in function declarations --- src/Language/Go/Assignment.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Language/Go/Assignment.hs b/src/Language/Go/Assignment.hs index ac9012ec8..12bc617a0 100644 --- a/src/Language/Go/Assignment.hs +++ b/src/Language/Go/Assignment.hs @@ -373,7 +373,7 @@ fallThroughStatement :: Assignment fallThroughStatement = makeTerm <$> symbol FallthroughStatement <*> (Statement.Pattern <$> (makeTerm <$> location <*> (Syntax.Identifier <$> source)) <*> emptyTerm) functionDeclaration :: Assignment -functionDeclaration = makeTerm <$> (symbol FunctionDeclaration <|> symbol FuncLiteral) <*> children (mkFunctionDeclaration <$> name <*> manyTerm parameters <*> (types <|> identifier <|> returnParameters <|> emptyTerm) <*> (block <|> emptyTerm)) +functionDeclaration = makeTerm <$> (symbol FunctionDeclaration <|> symbol FuncLiteral) <*> children (mkFunctionDeclaration <$ token AnonFunc <*> name <*> manyTerm parameters <*> (types <|> identifier <|> returnParameters <|> emptyTerm) <*> (block <|> emptyTerm)) where mkFunctionDeclaration name' params' types' block' = Declaration.Function [types'] name' params' block' returnParameters = makeTerm <$> symbol Parameters <*> children (manyTerm expression)