[java] Fix tests with ExplicitConstructorInvocations

This commit is contained in:
Andreas Dangel
2024-02-15 15:07:50 +01:00
parent bfe9ce66e2
commit 2a1aaa6bce
2 changed files with 8 additions and 3 deletions

View File

@ -1524,8 +1524,12 @@ private void ConstructorBlock() #Block:
{}
{
"{" { tokenContexts.push(TokenContext.BLOCK); }
( LOOKAHEAD(2) BlockStatement() )*
[ LOOKAHEAD(ExplicitConstructorInvocation()) ExplicitConstructorInvocation() ]
(
LOOKAHEAD(ExplicitConstructorInvocation()) ExplicitConstructorInvocation()
|
( LOOKAHEAD(2) BlockStatement() )*
[ LOOKAHEAD(ExplicitConstructorInvocation()) ExplicitConstructorInvocation() ]
)
( BlockStatement() )*
"}" { tokenContexts.pop(); }
}

View File

@ -17,7 +17,8 @@ import org.junit.platform.suite.api.Suite;
Java17TreeDumpTest.class,
Java21TreeDumpTest.class,
Java21PreviewTreeDumpTest.class,
Java22TreeDumpTest.class
Java22TreeDumpTest.class,
Java22PreviewTreeDumpTest.class
})
class AllJavaAstTreeDumpTest {