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

Allow single identifiers in method declaration parameter list

This commit is contained in:
Rick Winfrey 2017-11-09 15:58:30 -08:00
parent 86c7892fe2
commit b4bdbc7cfb

View File

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