Various fixes for parsing type use annotations#206
Various fixes for parsing type use annotations#206theawless wants to merge 3 commits intotree-sitter:masterfrom
Conversation
1418c63 to
14a8c10
Compare
There was a problem hiding this comment.
Looks like the spec agrees with you :) (im not a maintainer or anything but wanted to take a look)
https://docs.oracle.com/javase/specs/jls/se22/html/jls-8.html#jls-8.4.1
VariableArityParameter: {VariableModifier} UnannType {Annotation} ... Identifier
|
I'll note that youre upgrading the ABI here, from my POV thats fine, its likely the next release should include ABI 15 anyways (?), but the maintainers know better or feel differently. It might be worth keeping the ABI at 14 to play it safe ( |
|
Yes, keep commits (and PRs) atomic. Bumping ABI can be a breaking change for consumers stuck on an older version of the library. |
This comment was marked as outdated.
This comment was marked as outdated.
jackschu
left a comment
There was a problem hiding this comment.
Reasoning for the catch type extension seems legit, again though I'm no maintainer (sorry)
Fix type use annotations before spread parameter
Closes #205
The original fix was here 0d79d9f but there's a typo in that. Java doesn't allow annotations after the ellipsis at all. The original issue #184 as well as the minimal sample found by the maintainer #184 (comment) is for annotations before the ellipsis.
Fix type use annotations in catch types
Closes #208
According to the spec https://docs.oracle.com/javase/specs/jls/se24/html/jls-14.html#jls-CatchType, catch types can be annotated. Note that modifiers and _type can both accept annotations, but I have maintained the existing behaviour - by parsing annotations as part of the modifiers for the first type.