diff --git a/src/Language/Java/Assignment.hs b/src/Language/Java/Assignment.hs index 1ee21554e..fc93c2f62 100644 --- a/src/Language/Java/Assignment.hs +++ b/src/Language/Java/Assignment.hs @@ -357,7 +357,7 @@ interface = makeTerm <$> symbol InterfaceDeclaration <*> children (normal <|> an interfaceBody = makeTerm <$> symbol InterfaceBody <*> children (manyTerm interfaceMemberDeclaration) normal = symbol NormalInterfaceDeclaration *> children (makeInterface <$> manyTerm modifier <*> identifier <*> (typeParameters <|> pure []) <*> (extends <|> pure []) <*> interfaceBody) makeInterface modifiers identifier typeParams = Declaration.InterfaceDeclaration (modifiers ++ typeParams) identifier - annotationType = symbol AnnotationTypeDeclaration *> children (Declaration.InterfaceDeclaration [] <$> identifier <*> pure [] <*> annotationTypeBody) + annotationType = symbol AnnotationTypeDeclaration *> children (Declaration.InterfaceDeclaration [] <$> AnonAt *> identifier <*> pure [] <*> annotationTypeBody) annotationTypeBody = makeTerm <$> symbol AnnotationTypeBody <*> children (many expression) interfaceMemberDeclaration = symbol InterfaceMemberDeclaration *> children (term expression) extends = symbol ExtendsInterfaces *> children (symbol InterfaceTypeList *> children (manyTerm type')) @@ -476,7 +476,7 @@ enhancedFor = makeTerm <$> symbol EnhancedForStatement <*> children (Statement.F where variable modifiers type' variableDeclaratorId = makeTerm1 (Java.Syntax.Variable modifiers type' variableDeclaratorId) assert :: Assignment Term -assert = makeTerm <$> symbol Grammar.AssertStatement <*> children (Java.Syntax.AssertStatement <$> term expression <*> term expression) +assert = makeTerm <$> symbol Grammar.AssertStatement <*> children (Java.Syntax.AssertStatement <$> term expression <*> optional (term expression)) -- TODO: instanceOf binary :: Assignment Term diff --git a/src/Language/Java/Syntax.hs b/src/Language/Java/Syntax.hs index 87031a608..1d17d0edf 100644 --- a/src/Language/Java/Syntax.hs +++ b/src/Language/Java/Syntax.hs @@ -273,7 +273,7 @@ instance Show1 TryWithResources where liftShowsPrec = genericLiftShowsPrec -- TODO: Implement Eval instance for TryWithResources instance Evaluatable TryWithResources -data AssertStatement a = AssertStatement { assertLHS :: !a, assertRHS :: !a } +data AssertStatement a = AssertStatement { assertLHS :: !a, assertRHS :: !(Maybe a) } deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) instance Eq1 AssertStatement where liftEq = genericLiftEq