-
Notifications
You must be signed in to change notification settings - Fork 132
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
YARP accepts command method call in many places where Ruby rejects. #1575
Labels
Comments
makenowjust
added a commit
to makenowjust/prism-1
that referenced
this issue
Nov 30, 2023
Fix ruby#1468 Fix ruby#1575 To decide command-style method calls are allowed, this introduce a new parameter `accepts_command_call` to `parse_expression` and some functions. Although one think this can be solved by operator precedence, it is hard or impossible, because the precedence of command-style calls is skewed (e.g. `! bar 1 ` is accepted, but `foo = ! bar 1` is rejected.) One of the most complex examples is that: (1) even though `foo = bar = baz 1` and `foo, bar = baz 1` is accepted, (2) `foo, bar = baz = fuzz 1` is rejected. To implement this behavior, this introduces a new binding power `PM_BINDING_POWER_MULTI_ASSIGNMENT` and uses it for distinguish which single assignments or multi assignments at their RHS.
makenowjust
added a commit
to makenowjust/prism-1
that referenced
this issue
Dec 5, 2023
Fix ruby#1468 Fix ruby#1575 To decide command-style method calls are allowed, this introduce a new parameter `accepts_command_call` to `parse_expression` and some functions. Although one think this can be solved by operator precedence, it is hard or impossible, because the precedence of command-style calls is skewed (e.g. `! bar 1 ` is accepted, but `foo = ! bar 1` is rejected.) One of the most complex examples is that: (1) even though `foo = bar = baz 1` and `foo, bar = baz 1` is accepted, (2) `foo, bar = baz = fuzz 1` is rejected. To implement this behavior, this introduces a new binding power `PM_BINDING_POWER_MULTI_ASSIGNMENT` and uses it for distinguish which single assignments or multi assignments at their RHS.
matzbot
pushed a commit
to ruby/ruby
that referenced
this issue
Dec 5, 2023
Fix ruby/prism#1468 Fix ruby/prism#1575 To decide command-style method calls are allowed, this introduce a new parameter `accepts_command_call` to `parse_expression` and some functions. Although one think this can be solved by operator precedence, it is hard or impossible, because the precedence of command-style calls is skewed (e.g. `! bar 1 ` is accepted, but `foo = ! bar 1` is rejected.) One of the most complex examples is that: (1) even though `foo = bar = baz 1` and `foo, bar = baz 1` is accepted, (2) `foo, bar = baz = fuzz 1` is rejected. To implement this behavior, this introduces a new binding power `PM_BINDING_POWER_MULTI_ASSIGNMENT` and uses it for distinguish which single assignments or multi assignments at their RHS. ruby/prism@d4dd49ca81
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The text was updated successfully, but these errors were encountered: