1
1
mirror of https://github.com/github/semantic.git synced 2024-12-28 09:21:35 +03:00

Tokenize the fun keyword in function declarations

This commit is contained in:
Rick Winfrey 2017-11-30 16:02:16 -08:00
parent 633155a2e4
commit bafff20f3b

View File

@ -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)