1
1
mirror of https://github.com/github/semantic.git synced 2024-12-21 05:41:54 +03:00

Assign identifiers for the receiver of method declarations

This commit is contained in:
Rick Winfrey 2017-11-09 16:39:48 -08:00
parent 4eb9d19f9c
commit eaa98db6fd

View File

@ -482,11 +482,11 @@ importSpec :: Assignment
importSpec = symbol ImportSpec *> children expressions
methodDeclaration :: Assignment
methodDeclaration = mkTypedMethodDeclaration <$> symbol MethodDeclaration <*> children ((,,,,) <$> receiver <*> fieldIdentifier <*> parameters <*> (typeIdentifier <|> emptyTerm) <*> block)
methodDeclaration = mkTypedMethodDeclaration <$> symbol MethodDeclaration <*> children ((,,,,) <$> receiver <*> fieldIdentifier <*> parameters <*> (expression <|> emptyTerm) <*> block)
where
parameterDeclaration = symbol ParameterDeclaration *> (children (many expression) <|> many emptyTerm)
parameters = symbol Parameters *> children (parameterDeclaration <|> many expression)
receiver = symbol Parameters *> children (symbol ParameterDeclaration *> children expressions)
receiver = symbol Parameters *> children ((symbol ParameterDeclaration *> children expressions) <|> expressions)
mkTypedMethodDeclaration loc (receiver', name', parameters', type'', body') = makeTerm loc (Declaration.Method [type''] receiver' name' parameters' body')
methodSpec :: Assignment