diff options
| author | Kevin Newton <kddnewton@gmail.com> | 2026-06-12 13:49:56 -0400 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2026-06-15 15:57:16 +0000 |
| commit | 6a9ee89182939c592410d27d6de2d474657f4975 (patch) | |
| tree | 001f2d3cba3e468adf3dbf1031e41ccf0c89497f /tool/lib | |
| parent | e1d3fc5d5d8f86f2b342ba6c0d775c61ef001fe5 (diff) | |
The value of a `rescue` modifier is a full `stmt` in the grammar in
three of its six productions, but we parsed it as a plain expression
in every case. This rejected valid syntax such as `a rescue b, c = 1`
and accepted invalid syntax such as `a = 1 rescue not b`.
These are the relevant grammar rules:
stmt : stmt modifier_rescue stmt
| mlhs '=' mrhs_arg modifier_rescue stmt
command_rhs : command_call_value modifier_rescue stmt
arg_rhs : arg modifier_rescue arg
endless_arg : endless_arg modifier_rescue arg
endless_command : endless_command modifier_rescue arg
parse_rescue_modifier_value will now parse either a stmt or an arg
depending on the caller.
https://github.com/ruby/prism/commit/07e63f707f
Diffstat (limited to 'tool/lib')
0 files changed, 0 insertions, 0 deletions
