1
1
mirror of https://github.com/github/semantic.git synced 2025-01-09 00:56:32 +03:00

Make use clause and return type optional in anon function

This commit is contained in:
joshvera 2018-01-18 12:13:17 -05:00
parent 9bde03ad06
commit 88e7219a0e

View File

@ -344,7 +344,7 @@ printIntrinsic :: Assignment
printIntrinsic = makeTerm <$> symbol PrintIntrinsic <*> children (Syntax.PrintIntrinsic <$> expression)
anonymousFunctionCreationExpression :: Assignment
anonymousFunctionCreationExpression = makeTerm <$> symbol AnonymousFunctionCreationExpression <*> children (makeFunction <$> emptyTerm <*> parameters <*> functionUseClause <*> returnType <*> compoundStatement)
anonymousFunctionCreationExpression = makeTerm <$> symbol AnonymousFunctionCreationExpression <*> children (makeFunction <$> emptyTerm <*> parameters <*> (functionUseClause <|> emptyTerm) <*> (returnType <|> emptyTerm) <*> compoundStatement)
where
makeFunction identifier parameters functionUseClause returnType statement = Declaration.Function [functionUseClause, returnType] identifier parameters statement