Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(java 21): complete pattern matching for switch statements #158

Merged
merged 2 commits into from
Aug 22, 2023

Conversation

brandonspark
Copy link
Contributor

What:

This PR adds in the last thing for supporting pattern matching for switch statements, as in Java 21, namely guards.

Why:

We should support the features of Java 21.

How:

Just added a guard nonterminal and put it in the right place, and added more tests for other Java 21 switch features.

Test plan:

tree-sitter test

Checklist:

  • All tests pass in CI.
  • There are sufficient tests for the new fix/feature.
  • Grammar rules have not been renamed unless absolutely necessary.
  • The conflicts section hasn't grown too much.
  • The parser size hasn't grown too much (check the value of STATE_COUNT in src/parser.c).

@aryx aryx requested a review from amaanq August 17, 2023 08:03
@aryx
Copy link
Contributor

aryx commented Aug 17, 2023

need to rebase

@brandonspark
Copy link
Contributor Author

@aryx rebased now

@amaanq
Copy link
Member

amaanq commented Aug 17, 2023

Can you remove the regenerated files? Then it'd be nice to merge your 3 PRs and then generate after that

@brandonspark
Copy link
Contributor Author

brandonspark commented Aug 17, 2023

@amaanq done!

@brandonspark
Copy link
Contributor Author

@amaanq well, this will also fail CI in the interim, unfortunately...

@brandonspark
Copy link
Contributor Author

@amaanq it seems it's not possible to do "partial commits" with the regeneration step at a later time, because CI must pass before i merge. i think i'm just going to merge individually.

@amaanq
Copy link
Member

amaanq commented Aug 18, 2023

okay, that's fine. you can add back the generated files.

@brandonspark
Copy link
Contributor Author

@aryx could you merge this?

@aryx aryx merged commit 2a15634 into tree-sitter:master Aug 22, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants