Skip to content

Commit

Permalink
Address Jay's second review
Browse files Browse the repository at this point in the history
Signed-off-by: David Thompson <[email protected]>
  • Loading branch information
datho7561 committed Jan 8, 2024
1 parent 267e29f commit 83d9d1d
Show file tree
Hide file tree
Showing 24 changed files with 27 additions and 7 deletions.
2 changes: 1 addition & 1 deletion org.eclipse.jdt.core.compiler.batch/grammar/java.g
Original file line number Diff line number Diff line change
Expand Up @@ -2546,7 +2546,7 @@ EnhancedForStatementHeaderInit ::= 'for' '(' Type PushModifiers VariableDeclarat
/.$putCase consumeEnhancedForStatementHeaderInit(false); $break ./
/:$readableName EnhancedForStatementHeaderInit:/

EnhancedForStatementHeaderInit ::= 'for' '(' Modifiers Type PushRealModifiers Identifier Dimsopt
EnhancedForStatementHeaderInit ::= 'for' '(' Modifiers Type PushRealModifiers VariableDeclaratorId
/.$putCase consumeEnhancedForStatementHeaderInit(true); $break ./
/:$readableName EnhancedForStatementHeaderInit:/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7468,7 +7468,7 @@ protected void consumeRule(int act) {
break;

case 369 : if (DEBUG) { System.out.println("ComponentPatternList ::= ComponentPatternList COMMA..."); } //$NON-NLS-1$
consumePatternList();
consumePatternList();
break;

case 377 : if (DEBUG) { System.out.println("StringTemplateExpression ::= Name DOT TemplateArgument"); } //$NON-NLS-1$
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,20 @@ public interface ParserBasicInformation {

ERROR_SYMBOL = 141,
MAX_NAME_LENGTH = 53,
NUM_STATES = 1257,
NUM_STATES = 1256,

NT_OFFSET = 141,
SCOPE_UBOUND = 324,
SCOPE_SIZE = 325,
LA_STATE_OFFSET = 18594,
LA_STATE_OFFSET = 18598,
MAX_LA = 1,
NUM_RULES = 958,
NUM_TERMINALS = 141,
NUM_NON_TERMINALS = 440,
NUM_SYMBOLS = 581,
START_STATE = 1057,
START_STATE = 1217,
EOFT_SYMBOL = 64,
EOLT_SYMBOL = 64,
ACCEPT_ACTION = 18593,
ERROR_ACTION = 18594;
ACCEPT_ACTION = 18597,
ERROR_ACTION = 18598;
}
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.
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 @@ -448,6 +448,26 @@ record Point(int x, int y) {}
"""}, "2");
}

public void testEnhancedForLoopVariableWithModifier() {
runConformTest(new String[] { "A.java", """
import java.util.List;
public class A {
public static void main(String... args) {
List<String> myList = List.of("hi", "hello", "salu", "bonjour");
int accumulator = 0;
for (final String _ : myList) {
accumulator++;
}
System.out.println(accumulator);
accumulator = 0;
for (final int _ : new int[0]) {
}
System.out.println(accumulator);
}
}
"""}, "4\n0");
}



public void testInstanceofUnnamedPatternMatching() {
Expand Down

0 comments on commit 83d9d1d

Please sign in to comment.