Actions
Bug #22095
openPrism rejects a multiple assignment in a rescue modifier value that parse.y accepts
Bug #22095:
Prism rejects a multiple assignment in a rescue modifier value that parse.y accepts
Description
Problem¶
parse.y and Prism parse the following differently:
a rescue b, c = 1
parse.y accepts it, but Prism rejects it.
Cause¶
In the grammar, the value of a rescue modifier is a statement, so it may itself be a multiple assignment.
In Prism, multiple-assignment detection is only enabled at the statement level (PM_BINDING_POWER_STATEMENT). But Prism parses the rescue value with the rescue modifier's right binding power (PM_BINDING_POWER_COMPOSITION), so it does not recognize the multiple assignment and fails at the comma.
I opened a draft PR with a proposed fix: https://github.com/ruby/prism/pull/4128
Updated by mame (Yusuke Endoh) about 2 hours ago
- Status changed from Open to Assigned
- Assignee set to kddnewton (Kevin Newton)
Updated by mame (Yusuke Endoh) about 2 hours ago
- Assignee changed from kddnewton (Kevin Newton) to prism
Actions