Commit e39fd45
[ruby/prism] Use pm_arguments_end for function call
Previously, the location of CallNode was incorrect when it accepts a
block parameter:
```
$ ruby -rprism -e 'pp Prism.parse("foo(&blk)").value.statements.body[0]']
@ CallNode (location: (1,0)-(1,8)) # <=== It should be (1,0)-(1,9)
├── flags: ∅
├── receiver: ∅
├── call_operator_loc: ∅
├── name: :foo
├── message_loc: (1,0)-(1,3) = "foo"
├── opening_loc: (1,3)-(1,4) = "("
├── arguments: ∅
├── closing_loc: (1,8)-(1,9) = ")"
*snip*
$ ruby -rprism -e 'pp Prism.parse("foo(&blk)").value.statements.body[0].slice'
"foo(&blk"
```
Note that the slice lacks the closing parenthesis.
ruby/prism@3c22e6fc391 parent 17039c5 commit e39fd45
1 file changed
Lines changed: 4 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18570 | 18570 | | |
18571 | 18571 | | |
18572 | 18572 | | |
18573 | | - | |
18574 | | - | |
18575 | | - | |
18576 | | - | |
18577 | | - | |
18578 | | - | |
18579 | | - | |
18580 | | - | |
18581 | | - | |
18582 | | - | |
| 18573 | + | |
| 18574 | + | |
| 18575 | + | |
18583 | 18576 | | |
| 18577 | + | |
18584 | 18578 | | |
18585 | 18579 | | |
18586 | 18580 | | |
| |||
0 commit comments