From d6c4791a55638c2c9a3c1e2af60fe94a9b590a37 Mon Sep 17 00:00:00 2001 From: Ayman Nadeem Date: Tue, 5 Jun 2018 11:27:22 -0700 Subject: [PATCH] add modifier to enums --- src/Language/Java/Assignment.hs | 2 +- src/Language/Java/Syntax.hs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Language/Java/Assignment.hs b/src/Language/Java/Assignment.hs index a1b35aeb2..c8e1271b4 100644 --- a/src/Language/Java/Assignment.hs +++ b/src/Language/Java/Assignment.hs @@ -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 diff --git a/src/Language/Java/Syntax.hs b/src/Language/Java/Syntax.hs index 654dc8e8d..86a6b9208 100644 --- a/src/Language/Java/Syntax.hs +++ b/src/Language/Java/Syntax.hs @@ -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