Commit 2eab962
[ruby/prism] Allow command calls in endless method bodies within assignments
Previously, endless method definitions in assignment contexts like
`x = def f = p 1` would fail to parse because command calls (method
calls without parentheses) were only accepted when the surrounding
binding power was less than `PM_BINDING_POWER_COMPOSITION`.
This fix specifically checks for assignment context and allows command
calls in those cases while maintaining the existing behavior for other
contexts. This ensures that:
- `x = def f = p 1` parses correctly (previously failed)
- `private def f = puts "Hello"` still produces the expected error
ruby/prism@722af59ba31 parent 0260799 commit 2eab962
File tree
3 files changed
+14
-1
lines changed- prism
- test/prism
- errors
- fixtures
3 files changed
+14
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19524 | 19524 | | |
19525 | 19525 | | |
19526 | 19526 | | |
19527 | | - | |
| 19527 | + | |
| 19528 | + | |
| 19529 | + | |
| 19530 | + | |
| 19531 | + | |
| 19532 | + | |
| 19533 | + | |
| 19534 | + | |
| 19535 | + | |
19528 | 19536 | | |
19529 | 19537 | | |
19530 | 19538 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
0 commit comments