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: add support to parse of type parameters #57

Merged
merged 9 commits into from
Jan 5, 2022

Conversation

kawaemon
Copy link
Contributor

@kawaemon kawaemon commented Jan 2, 2022

This PR adds support to parse of type parameters syntax, which will be added on Go 1.18.

TODO:

  • Reduce conflicts section.
  • Regenerate and commit new parser.

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.
    5 → 11. It's grown very much. I tried but I couldn't reduce it. Would you give me an advice?
  • The parser size hasn't grown too much (check the value of STATE_COUNT in src/parser.c).
    1182 → 1220. I think it's reasonable.

@kawaemon kawaemon marked this pull request as ready for review January 2, 2022 23:03
@aryx aryx requested a review from maxbrunsfeld January 4, 2022 15:56
@aryx
Copy link
Contributor

aryx commented Jan 4, 2022

Lgtm!
There are indeed a few more conflicts, but from what I remember adding generics to Java introduced
similar conflicts too.

@kawaemon
Copy link
Contributor Author

kawaemon commented Jan 5, 2022

I made tiny code quality change (72ffe0e) and updated highlight query (c07bb5d). I think it's ready to merge now.

@aryx
Copy link
Contributor

aryx commented Jan 5, 2022

Can you rebase to fix the conflicts (now that I've merged your other PR)?

@aryx
Copy link
Contributor

aryx commented Jan 5, 2022

Those generated files in the repository are a bit annoying @maxbrunsfeld for reviewing and merging purposes. They generate extract conflicts. If people really need the parser.c, why we don't have separate repository with all those generated code. This would avoid having those huge PRs with thousands lines of code in parser.c that are not even inspected by humans. This also make the statistics on contributors useless.

@kawaemon
Copy link
Contributor Author

kawaemon commented Jan 5, 2022

Rebased and regenerated parser (to fix conflict). It should be fine.

Copy link
Contributor

@aryx aryx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx! This is great.

@aryx aryx merged commit 7363172 into tree-sitter:master Jan 5, 2022
@kawaemon
Copy link
Contributor Author

kawaemon commented Jan 5, 2022

Thank you for reviews!

@kawaemon kawaemon deleted the generics branch January 5, 2022 16:55
@maxbrunsfeld
Copy link
Contributor

Yeah we have an item in Tree-sitter’s 1.0 roadmap issue about changing how we store the generated files, but nobody is working on it right now. It’s going to take a bit of effort to design and set up the automation, and get the community migrated away from using the git repositories directly.

@aryx
Copy link
Contributor

aryx commented Jan 5, 2022

ok, got it

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