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:
parent
633155a2e4
commit
bafff20f3b
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user