mirror of
https://github.com/github/semantic.git
synced 2024-12-29 18:06:14 +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)
|
fallThroughStatement = makeTerm <$> symbol FallthroughStatement <*> (Statement.Pattern <$> (makeTerm <$> location <*> (Syntax.Identifier <$> source)) <*> emptyTerm)
|
||||||
|
|
||||||
functionDeclaration :: Assignment
|
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
|
where
|
||||||
mkFunctionDeclaration name' params' types' block' = Declaration.Function [types'] name' params' block'
|
mkFunctionDeclaration name' params' types' block' = Declaration.Function [types'] name' params' block'
|
||||||
returnParameters = makeTerm <$> symbol Parameters <*> children (manyTerm expression)
|
returnParameters = makeTerm <$> symbol Parameters <*> children (manyTerm expression)
|
||||||
|
Loading…
Reference in New Issue
Block a user