From fb56ac59d026b302e0f7aa3fefbe466be4902bcd Mon Sep 17 00:00:00 2001 From: joshvera Date: Fri, 20 Jul 2018 15:56:13 -0400 Subject: [PATCH] Add types to AnnotationTypeElement Co-Authored-By: Ayman Nadeem --- 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 d07742553..65fd13095 100644 --- a/src/Language/Java/Assignment.hs +++ b/src/Language/Java/Assignment.hs @@ -367,7 +367,7 @@ interface = makeTerm <$> symbol InterfaceDeclaration <*> children (normal <|> an annotationType = symbol AnnotationTypeDeclaration *> children (Declaration.InterfaceDeclaration [] <$> identifier <*> pure [] <*> annotationTypeBody) annotationTypeBody = symbol AnnotationTypeBody *> children (annotationTypeMember) annotationTypeMember = symbol AnnotationTypeMemberDeclaration *> children (class' <|> interface <|> constant) - annotationTypeElement = makeTerm <$> symbol AnnotationTypeElementDeclaration <*> children (Java.Syntax.AnnotationTypeElement <$> many modifier <*> identifier <*> (dims <|> pure []) <*> (defaultValue <|> emptyTerm)) + annotationTypeElement = makeTerm <$> symbol AnnotationTypeElementDeclaration <*> children (Java.Syntax.AnnotationTypeElement <$> many modifier <*> type' <*> identifier <*> (dims <|> pure []) <*> (defaultValue <|> emptyTerm)) defaultValue = makeTerm <$> symbol DefaultValue <*> children (Java.Syntax.DefaultValue <$> elementValue) elementValue = symbol ElementValue *> children (term expression) -- pull this to top level l8r interfaceMemberDeclaration = symbol InterfaceMemberDeclaration *> children (term expression) diff --git a/src/Language/Java/Syntax.hs b/src/Language/Java/Syntax.hs index 7383c6421..6a7f98c75 100644 --- a/src/Language/Java/Syntax.hs +++ b/src/Language/Java/Syntax.hs @@ -313,7 +313,7 @@ instance Show1 DefaultValue where liftShowsPrec = genericLiftShowsPrec instance Evaluatable DefaultValue -data AnnotationTypeElement a = AnnotationTypeElement { modifiers :: ![a], identifier :: !a, dims :: ![a], defaultValue :: !a } +data AnnotationTypeElement a = AnnotationTypeElement { modifiers :: ![a], annotationType :: a, identifier :: !a, dims :: ![a], defaultValue :: !a } deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) instance Eq1 AnnotationTypeElement where liftEq = genericLiftEq