-
-
Notifications
You must be signed in to change notification settings - Fork 104
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
Support receiver parameter in method declaration #608
Support receiver parameter in method declaration #608
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for the contribution ! I am very sorry for this late reply. I have one comment about the optionality of the comma when using receiver parameters, but otherwise, looks good to me !
It would need to update the printer as well, do you want to have a look @TamasSzigeti ?
DEF: () => { | ||
$.SUBRULE($.receiverParameter); | ||
$.OPTION2({ | ||
GATE: () => $.LA(1).tokenType !== t.RBrace, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it really optional ? It does not seems to be possible according to the spec: https://docs.oracle.com/javase/specs/jls/se21/html/jls-8.html#jls-8.4.1-220
@@ -508,10 +520,13 @@ function defineRules($, t) { | |||
GATE: $.BACKTRACK($.receiverParameter), | |||
DEF: () => { | |||
$.SUBRULE($.receiverParameter); | |||
$.CONSUME(t.Comma); | |||
$.OPTION3({ | |||
GATE: () => $.LA(1).tokenType !== t.RBrace, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
This ended up being resolved by #642, so this PR can be closed. |
'pologies for the abandoned PR, thanks for fixing it elsewhere |
What changed with this PR:
As it says on the tin
Example
Relative issues or prs:
Fixes #607