Actions
Bug #22177
openPrism rejects a nested destructuring target in a for loop index, while parse.y accepts it
Bug #22177:
Prism rejects a nested destructuring target in a for loop index, while parse.y accepts it
Description
Summary¶
When the index of a for loop is a multiple-assignment target whose first element is itself a parenthesized target (for example (a, b), c), Prism reports a syntax error, but parse.y accepts it.
The same target works in a normal multiple assignment in both parsers, so the difference is specific to the for loop index.
Reproduction¶
parse.y (--parser=parse.y)¶
Accepted. Prints:
Prism (default, --parser=prism)¶
Rejected:
Updated by shugo (Shugo Maeda) about 10 hours ago
- Assignee set to prism
I've created a pull request: https://github.com/ruby/prism/pull/4156
Actions