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

add modifier to enums

This commit is contained in:
Ayman Nadeem 2018-06-05 11:27:22 -07:00
parent 3bfb45fdb1
commit d6c4791a55
2 changed files with 2 additions and 2 deletions

View File

@ -301,7 +301,7 @@ package :: Assignment
package = makeTerm <$> symbol PackageDeclaration <*> children (Java.Syntax.Package <$> someTerm expression)
enum :: Assignment
enum = makeTerm <$> symbol Grammar.EnumDeclaration <*> children (Java.Syntax.EnumDeclaration <$> term identifier <*> manyTerm enumConstant)
enum = makeTerm <$> symbol Grammar.EnumDeclaration <*> children (Java.Syntax.EnumDeclaration <$> manyTerm modifier <*> term identifier <*> manyTerm enumConstant)
where enumConstant = symbol EnumConstant *> children (term identifier)
return' :: Assignment

View File

@ -38,7 +38,7 @@ instance Show1 Package where liftShowsPrec = genericLiftShowsPrec
-- TODO: Implement Eval instance for ArrayType
instance Evaluatable Package
data EnumDeclaration a = EnumDeclaration { _enumDeclarationIdentifier :: !a, _enumDeclarationBody :: ![a] }
data EnumDeclaration a = EnumDeclaration { enumDeclarationModifier :: ![a], enumDeclarationIdentifier :: !a, enumDeclarationBody :: ![a] }
deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable)
instance Eq1 EnumDeclaration where liftEq = genericLiftEq