mirror of
https://github.com/github/semantic.git
synced 2025-01-03 13:02:37 +03:00
Assign function declarations whose return type is a list of parameters
This commit is contained in:
parent
f1cc872285
commit
b6e281a0aa
@ -385,9 +385,10 @@ expressionList :: Assignment
|
||||
expressionList = symbol ExpressionList *> children expressions
|
||||
|
||||
functionDeclaration :: Assignment
|
||||
functionDeclaration = mkTypedFunctionDeclaration <$> symbol FunctionDeclaration <*> children ((,,,) <$> expression <*> parameters <*> (expression <|> emptyTerm) <*> block)
|
||||
functionDeclaration = mkTypedFunctionDeclaration <$> symbol FunctionDeclaration <*> children ((,,,) <$> expression <*> parameters <*> (expression <|> parameters' <|> emptyTerm) <*> block)
|
||||
where mkTypedFunctionDeclaration loc (name', params', types', block') = makeTerm loc (Declaration.Function [types'] name' params' block')
|
||||
parameters = symbol Parameters *> children (many expression)
|
||||
parameters' = makeTerm <$> symbol Parameters <*> children (many expression)
|
||||
|
||||
variadicParameterDeclaration :: Assignment
|
||||
variadicParameterDeclaration = mkVariadic <$> symbol VariadicParameterDeclaration <*> children ((,) <$> emptyTerm <*> expression)
|
||||
|
Loading…
Reference in New Issue
Block a user