Skip to content

fix: update Java grammar to fix parsing of lambda switch rule results and keyword statement labels#953

Merged
jtkiesel merged 1 commit into
jhipster:mainfrom
jtkiesel:fix/update-tree-sitter-java-orchard
Jun 25, 2026
Merged

fix: update Java grammar to fix parsing of lambda switch rule results and keyword statement labels#953
jtkiesel merged 1 commit into
jhipster:mainfrom
jtkiesel:fix/update-tree-sitter-java-orchard

Conversation

@jtkiesel

Copy link
Copy Markdown
Contributor

What changed with this PR:

The tree-sitter-java-orchard package is updated to inherit fixes to its grammar related to parsing switch rules with lambda results and statement labels that are contextual keywords.

Example

Input

void switchRulesWithLambdaResults() {
  Function<Integer, Integer> f = switch (o) {
    case false -> a -> a + 1;
    case B -> a -> a + 2;
    case Boolean b when b -> a -> a + 3;
    default -> c -> c + 4;
  };
}

void labeledStatement() {
  record: if (true) {}
}

Output

void switchRulesWithLambdaResults() {
  Function<Integer, Integer> f = switch (o) {
    case false -> (a) -> a + 1;
    case B -> (a) -> a + 2;
    case Boolean b when b -> (a) -> a + 3;
    default -> (c) -> c + 4;
  };
}

void labeledStatement() {
  record: if (true) {
  }
}

Relative issues or prs:

Closes #946
Closes #950

@jtkiesel jtkiesel merged commit 2b778c8 into jhipster:main Jun 25, 2026
6 checks passed
@jtkiesel jtkiesel deleted the fix/update-tree-sitter-java-orchard branch June 25, 2026 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant