1
1
mirror of https://github.com/github/semantic.git synced 2024-12-26 08:25:19 +03:00

apparently remove classBody in response to this lint error

This commit is contained in:
Ayman Nadeem 2018-06-01 11:28:39 -07:00
parent 1808d53a3b
commit 86d7ccd461

View File

@ -113,7 +113,7 @@ manyTerm term = many (contextualize comment term <|> makeTerm1 <$> (Syntax.Conte
manyTermsTill :: Assignment.Assignment [] Grammar Term
-> Assignment.Assignment [] Grammar b
-> Assignment.Assignment [] Grammar [Term]
manyTermsTill step end = manyTill (step <|> comment) end
manyTermsTill step = manyTill (step <|> comment)
someTerm :: Assignment -> Assignment.Assignment [] Grammar [Term]
someTerm term = some (contextualize comment term <|> makeTerm1 <$> (Syntax.Context <$> some1 comment <*> emptyTerm))
@ -254,7 +254,7 @@ superInterfaces = symbol SuperInterfaces *> children (symbol InterfaceTypeList *
class' :: Assignment
class' = makeTerm <$> symbol ClassDeclaration <*> children (makeClass <$> many modifier <*> term identifier <*> (typeParameters <|> pure []) <*> optional superClass <*> (superInterfaces <|> pure []) <*> classBody)
where
makeClass modifiers identifier typeParams superClass superInterfaces classBody = Declaration.Class (modifiers ++ typeParams) identifier (maybeToList superClass ++ superInterfaces) classBody -- not doing an assignment, just straight up function
makeClass modifiers identifier typeParams superClass superInterfaces = Declaration.Class (modifiers ++ typeParams) identifier (maybeToList superClass ++ superInterfaces) -- not doing an assignment, just straight up function
classBody = makeTerm <$> symbol ClassBody <*> children (manyTerm expression)
superClass = symbol Superclass *> children type'
-- matching term expression won't work since there is no node for that; it's AnonExtends
@ -273,7 +273,6 @@ class' = makeTerm <$> symbol ClassDeclaration <*> children (makeClass <$> many m
fieldDeclaration :: Assignment
fieldDeclaration = makeTerm <$> symbol FieldDeclaration <*> children ((,) <$> manyTerm modifier <*> type' <**> variableDeclaratorList)
method :: Assignment
method = makeTerm <$> symbol MethodDeclaration <*> children (makeMethod <$> many modifier <*> emptyTerm <*> methodHeader <*> methodBody)
where