Skip to content

Commit

Permalink
[WIP] tried adding a bunch of compliance markers but it fixed nothing
Browse files Browse the repository at this point in the history
Signed-off-by: David Thompson <davthomp@redhat.com>
  • Loading branch information
datho7561 committed Oct 30, 2023
1 parent 20c6658 commit b366cad
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 1 deletion.
12 changes: 12 additions & 0 deletions org.eclipse.jdt.core.compiler.batch/grammar/java.g
Original file line number Diff line number Diff line change
Expand Up @@ -808,11 +808,19 @@ VariableDeclarators ::= VariableDeclarators ',' VariableDeclarator
/:$recovery_template Identifier:/

VariableDeclarator ::= VariableDeclaratorId EnterVariable ExitVariableWithoutInitialization
/:$readableName VariableDeclarator:/
/:$recovery_template Identifier:/
VariableDeclarator ::= VariableDeclaratorId EnterVariable '=' ForceNoDiet VariableInitializer RestoreDiet ExitVariableWithInitialization
/:$readableName VariableDeclarator:/
/:$recovery_template Identifier:/
VariableDeclarator ::= UnnamedVariable EnterUnnamedVariable ExitVariableWithoutInitialization
/:$readableName VariableDeclarator:/
/:$recovery_template Identifier:/
/:$compliance 21:/
VariableDeclarator ::= UnnamedVariable EnterUnnamedVariable '=' ForceNoDiet VariableInitializer RestoreDiet ExitVariableWithInitialization
/:$readableName VariableDeclarator:/
/:$recovery_template Identifier:/
/:$compliance 21:/

EnterVariable ::= $empty
/.$putCase consumeEnterVariable(); $break ./
Expand Down Expand Up @@ -843,6 +851,7 @@ VariableDeclaratorId ::= 'Identifier' Dimsopt

UnnamedVariable ::= 'Underscore'
/:$readableName UnnamedVariable:/
/:$compliance 21:/

VariableInitializer -> Expression
VariableInitializer -> ArrayInitializer
Expand Down Expand Up @@ -1349,6 +1358,7 @@ ComponentPatternList ::= ComponentPatternList ',' ComponentPattern
-- 21 preview feature : unnamed record patterns
-----------------------------------------------
ComponentPattern -> Pattern
/:$compliance 20:/
ComponentPattern -> UnnamedPattern
/:$compliance 21:/

Expand Down Expand Up @@ -2584,10 +2594,12 @@ EnhancedForStatementHeaderInit ::= 'for' '(' Modifiers Type PushRealModifiers Id
EnhancedForStatementHeaderInit ::= 'for' '(' Type PushModifiers UnnamedVariable
/.$putCase consumeEnhancedForStatementHeaderInitUnnamed(false); $break ./
/:$readableName EnhancedForStatementHeaderInit:/
/:$compliance 21:/

EnhancedForStatementHeaderInit ::= 'for' '(' Modifiers Type PushRealModifiers UnnamedVariable
/.$putCase consumeEnhancedForStatementHeaderInitUnnamed(true); $break ./
/:$readableName EnhancedForStatementHeaderInit:/
/:$compliance 21:/

EnhancedForStatementHeader ::= EnhancedForStatementHeaderInit ':' Expression ')'
/.$putCase consumeEnhancedForStatementHeader(); $break ./
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,23 @@ public static TestSuite getTestSuite(boolean addComplianceDiagnoseTest) {
TestCase.RUN_ONLY_ID = null;
all.addTest(AbstractCompilerTest.buildComplianceTestSuite(ClassFileConstants.getComplianceLevelForJavaVersion(ClassFileConstants.MAJOR_VERSION_19), tests_19));
}
if ((possibleComplianceLevels & AbstractCompilerTest.F_20) != 0) {
ArrayList tests_20 = (ArrayList)testClasses.clone();
tests_20.addAll(TEST_CLASSES_1_5);
addJava16Tests(tests_20);
// Reset forgotten subsets tests
TestCase.TESTS_PREFIX = null;
TestCase.TESTS_NAMES = null;
TestCase.TESTS_NUMBERS= null;
TestCase.TESTS_RANGE = null;
TestCase.RUN_ONLY_ID = null;
all.addTest(AbstractCompilerTest.buildComplianceTestSuite(ClassFileConstants.getComplianceLevelForJavaVersion(ClassFileConstants.MAJOR_VERSION_20), tests_20));
}
if ((possibleComplianceLevels & AbstractCompilerTest.F_21) != 0) {
ArrayList tests_21 = (ArrayList)testClasses.clone();
tests_21.addAll(TEST_CLASSES_1_5);
tests_21.add(JEP443UnnamedVariableTest.class);
addJava16Tests(tests_21);
tests_21.add(JEP443UnnamedVariableTest.class);
// Reset forgotten subsets tests
TestCase.TESTS_PREFIX = null;
TestCase.TESTS_NAMES = null;
Expand Down

0 comments on commit b366cad

Please sign in to comment.