summaryrefslogtreecommitdiff
path: root/include/ruby
diff options
context:
space:
mode:
authorTSUYUSATO Kitsune <make.just.on@gmail.com>2023-11-30 17:42:35 +0900
committergit <svn-admin@ruby-lang.org>2023-12-05 15:16:40 +0000
commitdcd75fd49dd879f4931b1c5b1bd65990a92badb5 (patch)
tree9b51df22a507f4270bf668b8ae2af957d37cb92b /include/ruby
parent6b9622ebdfc5ef12ee379cd1f0818b0188e1e068 (diff)
[ruby/prism] Fix to parse command-style method calls more correctly
Fix https://github.com/ruby/prism/pull/1468 Fix https://github.com/ruby/prism/pull/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. https://github.com/ruby/prism/commit/d4dd49ca81
Diffstat (limited to 'include/ruby')
0 files changed, 0 insertions, 0 deletions