Skip to content

Commit

Permalink
Experiment to run a subset
Browse files Browse the repository at this point in the history
  • Loading branch information
srikanth-sankaran committed Nov 11, 2024
1 parent e265e58 commit fde05b8
Show file tree
Hide file tree
Showing 25 changed files with 417 additions and 387 deletions.
2 changes: 2 additions & 0 deletions org.eclipse.jdt.core.compiler.batch/grammar/java.g
Original file line number Diff line number Diff line change
Expand Up @@ -1514,6 +1514,8 @@ SwitchLabels ::= SwitchLabel ':'
/.$putCase consumeSwitchLabels(false, false) ; $break ./
SwitchLabels ::= SwitchLabels SwitchLabel ':'
/.$putCase consumeSwitchLabels(true, false) ; $break ./
SwitchLabels ::= SwitchLabels SwitchLabel CaseArrow -- to ease yield disambiguation, will be rejected.
/.$putCase consumeSwitchLabels(true, true) ; $break ./
/:$readableName SwitchLabel:/

PostCaseArrow ::= $empty
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ public interface ParserBasicInformation {
NUM_STATES = 1239,

NT_OFFSET = 138,
SCOPE_UBOUND = 320,
SCOPE_SIZE = 321,
LA_STATE_OFFSET = 18346,
SCOPE_UBOUND = 321,
SCOPE_SIZE = 322,
LA_STATE_OFFSET = 18347,
MAX_LA = 1,
NUM_RULES = 940,
NUM_RULES = 941,
NUM_TERMINALS = 138,
NUM_NON_TERMINALS = 432,
NUM_SYMBOLS = 570,
START_STATE = 1137,
START_STATE = 1138,
EOFT_SYMBOL = 39,
EOLT_SYMBOL = 39,
ACCEPT_ACTION = 18345,
ERROR_ACTION = 18346;
ACCEPT_ACTION = 18346,
ERROR_ACTION = 18347;
}
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ static int getRestrictedKeyword(String text) {
TokenNameimport = 111,
TokenNameinstanceof = 17,
TokenNameint = 112,
TokenNameinterface = 72,
TokenNameinterface = 73,
TokenNamelong = 113,
TokenNamenative = 46,
TokenNamenew = 40,
Expand Down Expand Up @@ -197,10 +197,10 @@ static int getRestrictedKeyword(String text) {
TokenNameBeginLambda = 64,
TokenNameBeginIntersectionCast = 69,
TokenNameBeginTypeArguments = 89,
TokenNameElidedSemicolonAndRightBrace = 73,
TokenNameElidedSemicolonAndRightBrace = 74,
TokenNameAT308 = 27,
TokenNameAT308DOTDOTDOT = 129,
TokenNameCaseArrow = 74,
TokenNameCaseArrow = 72,
TokenNameRestrictedIdentifierYield = 90,
TokenNameRestrictedIdentifierrecord = 76,
TokenNameRestrictedIdentifiersealed = 43,
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,27 @@ public class RunCompletionParserTests extends junit.framework.TestCase {
public final static List TEST_CLASSES_1_5 = new ArrayList();
public final static List TEST_CLASSES_23 = new ArrayList();
static {
TEST_CLASSES.add(AllocationExpressionCompletionTest.class);
TEST_CLASSES.add(ClassLiteralAccessCompletionTest.class);
// TEST_CLASSES.add(AllocationExpressionCompletionTest.class);
// TEST_CLASSES.add(ClassLiteralAccessCompletionTest.class);
TEST_CLASSES.add(CompletionParserTest.class);
TEST_CLASSES.add(CompletionParserTest2.class);
TEST_CLASSES.add(CompletionParserTestKeyword.class);
TEST_CLASSES.add(CompletionRecoveryTest.class);
TEST_CLASSES.add(DietCompletionTest.class);
TEST_CLASSES.add(ExplicitConstructorInvocationCompletionTest.class);
TEST_CLASSES.add(FieldAccessCompletionTest.class);
TEST_CLASSES.add(InnerTypeCompletionTest.class);
TEST_CLASSES.add(JavadocCompletionParserTest.class);
TEST_CLASSES.add(LabelStatementCompletionTest.class);
TEST_CLASSES.add(MethodInvocationCompletionTest.class);
TEST_CLASSES.add(NameReferenceCompletionTest.class);
TEST_CLASSES.add(ReferenceTypeCompletionTest.class);

TEST_CLASSES_1_5.add(GenericsCompletionParserTest.class);
TEST_CLASSES_1_5.add(EnumCompletionParserTest.class);
TEST_CLASSES_1_5.add(AnnotationCompletionParserTest.class);

TEST_CLASSES_23.add(MarkdownCompletionParserTest.class);
// TEST_CLASSES.add(CompletionParserTest2.class);
// TEST_CLASSES.add(CompletionParserTestKeyword.class);
// TEST_CLASSES.add(CompletionRecoveryTest.class);
// TEST_CLASSES.add(DietCompletionTest.class);
// TEST_CLASSES.add(ExplicitConstructorInvocationCompletionTest.class);
// TEST_CLASSES.add(FieldAccessCompletionTest.class);
// TEST_CLASSES.add(InnerTypeCompletionTest.class);
// TEST_CLASSES.add(JavadocCompletionParserTest.class);
// TEST_CLASSES.add(LabelStatementCompletionTest.class);
// TEST_CLASSES.add(MethodInvocationCompletionTest.class);
// TEST_CLASSES.add(NameReferenceCompletionTest.class);
// TEST_CLASSES.add(ReferenceTypeCompletionTest.class);
//
// TEST_CLASSES_1_5.add(GenericsCompletionParserTest.class);
// TEST_CLASSES_1_5.add(EnumCompletionParserTest.class);
// TEST_CLASSES_1_5.add(AnnotationCompletionParserTest.class);
//
// TEST_CLASSES_23.add(MarkdownCompletionParserTest.class);
}

public RunCompletionParserTests(String name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ public class TestAll extends junit.framework.TestCase {
/* completion tests */
TEST_CLASSES_1_5.addAll(RunCompletionParserTests.TEST_CLASSES_1_5);
/* selection tests */
TEST_CLASSES_1_5.add(GenericsSelectionTest.class);
TEST_CLASSES_1_5.add(AnnotationSelectionTest.class);
TEST_CLASSES_1_5.add(EnumSelectionTest.class);
/* recovery tests */
TEST_CLASSES_1_5.add(GenericDietRecoveryTest.class);
TEST_CLASSES_1_5.add(EnumDietRecoveryTest.class);
TEST_CLASSES_1_5.add(AnnotationDietRecoveryTest.class);
TEST_CLASSES_1_5.add(StatementRecoveryTest_1_5.class);
// TEST_CLASSES_1_5.add(GenericsSelectionTest.class);
// TEST_CLASSES_1_5.add(AnnotationSelectionTest.class);
// TEST_CLASSES_1_5.add(EnumSelectionTest.class);
// /* recovery tests */
// TEST_CLASSES_1_5.add(GenericDietRecoveryTest.class);
// TEST_CLASSES_1_5.add(EnumDietRecoveryTest.class);
// TEST_CLASSES_1_5.add(AnnotationDietRecoveryTest.class);
// TEST_CLASSES_1_5.add(StatementRecoveryTest_1_5.class);
}

public TestAll(String testName) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8321,4 +8321,29 @@ public static void main(String[] args) {
},
"special");
}

// https://github.com/eclipse-jdt/eclipse.jdt.core/issues/3283
// [Switch Expressions] ECJ fails to recognize "yield" as a contextual keyword when there is a case fall-through
public void testIssue3283() {
this.runConformTest(
new String[] {
"X.java",
"""
public class X {
public static int var = 0;
public static void main(String argv[]) {
int j = switch(var){
case 0: yield (0 + 42); // If this is removed, there's a different error
case 1: // If I remove this line, the error goes away
case 2: yield 1; // multiple errors
default:
throw new IllegalArgumentException("Unexpected value: " + var);
};
System.out.println("Yield = " + j);
}
}
"""
},
"Yield = 42");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ public RunCompilerTests(String name) {
}
public static Class[] getAllTestClasses() {
return new Class[] {
org.eclipse.jdt.core.tests.compiler.regression.TestAll.class,
// org.eclipse.jdt.core.tests.compiler.regression.TestAll.class,
org.eclipse.jdt.core.tests.compiler.parser.TestAll.class,
org.eclipse.jdt.core.tests.eval.TestAll.class,
// org.eclipse.jdt.core.tests.eval.TestAll.class,
};
}
public static Test suite() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ public RunJDTCoreTests(String name) {
}
public static Test suite() {
TestSuite suite = new TestSuite(RunJDTCoreTests.class.getName());
suite.addTest(RunBuilderTests.suite());
// suite.addTest(RunBuilderTests.suite());
suite.addTest(RunCompilerTests.suite());
suite.addTest(RunDOMTests.suite());
suite.addTest(RunFormatterTests.suite());
suite.addTest(RunModelTests.suite());
// suite.addTest(RunDOMTests.suite());
// suite.addTest(RunFormatterTests.suite());
// suite.addTest(RunModelTests.suite());
return suite;
}
}
Expand Down

0 comments on commit fde05b8

Please sign in to comment.