[ruby/yarp] Consistently place block arguments on block slot for call

https://github.com/ruby/yarp/commit/fe208302e5
This commit is contained in:
Kevin Newton 2023-09-14 13:08:10 -04:00 committed by git
parent c7875340be
commit 2531ba4ba0
17 changed files with 676 additions and 672 deletions

View File

@ -364,12 +364,9 @@ module YARP
nil, nil,
Location(), Location(),
Location(), Location(),
ArgumentsNode([ ArgumentsNode([expression("foo")]),
BlockArgumentNode(expression("block"), Location()),
expression("foo")
]),
Location(), Location(),
nil, BlockArgumentNode(expression("block"), Location()),
0, 0,
"a" "a"
) )

View File

@ -68,7 +68,7 @@ module YARP
end end
def test_BlockArgumentNode def test_BlockArgumentNode
assert_location(BlockArgumentNode, "foo(&bar)", 4...8) { |node| node.arguments.arguments.last } assert_location(BlockArgumentNode, "foo(&bar)", 4...8, &:block)
end end
def test_BlockLocalVariableNode def test_BlockLocalVariableNode

View File

@ -135,24 +135,22 @@
│ ├── call_operator_loc: ∅ │ ├── call_operator_loc: ∅
│ ├── message_loc: (71...74) = "Foo" │ ├── message_loc: (71...74) = "Foo"
│ ├── opening_loc: ∅ │ ├── opening_loc: ∅
│ ├── arguments: │ ├── arguments: ∅
│ │ @ ArgumentsNode (location: (75...79))
│ │ └── arguments: (length: 1)
│ │ └── @ BlockArgumentNode (location: (75...79))
│ │ ├── expression:
│ │ │ @ CallNode (location: (76...79))
│ │ │ ├── receiver: ∅
│ │ │ ├── call_operator_loc: ∅
│ │ │ ├── message_loc: (76...79) = "bar"
│ │ │ ├── opening_loc: ∅
│ │ │ ├── arguments: ∅
│ │ │ ├── closing_loc: ∅
│ │ │ ├── block: ∅
│ │ │ ├── flags: variable_call
│ │ │ └── name: "bar"
│ │ └── operator_loc: (75...76) = "&"
│ ├── closing_loc: ∅ │ ├── closing_loc: ∅
│ ├── block: ∅ │ ├── block:
│ │ @ BlockArgumentNode (location: (75...79))
│ │ ├── expression:
│ │ │ @ CallNode (location: (76...79))
│ │ │ ├── receiver: ∅
│ │ │ ├── call_operator_loc: ∅
│ │ │ ├── message_loc: (76...79) = "bar"
│ │ │ ├── opening_loc: ∅
│ │ │ ├── arguments: ∅
│ │ │ ├── closing_loc: ∅
│ │ │ ├── block: ∅
│ │ │ ├── flags: variable_call
│ │ │ └── name: "bar"
│ │ └── operator_loc: (75...76) = "&"
│ ├── flags: ∅ │ ├── flags: ∅
│ └── name: "Foo" │ └── name: "Foo"
├── @ CallNode (location: (81...94)) ├── @ CallNode (location: (81...94))
@ -218,24 +216,22 @@
│ ├── call_operator_loc: (115...117) = "::" │ ├── call_operator_loc: (115...117) = "::"
│ ├── message_loc: (117...120) = "Bar" │ ├── message_loc: (117...120) = "Bar"
│ ├── opening_loc: ∅ │ ├── opening_loc: ∅
│ ├── arguments: │ ├── arguments: ∅
│ │ @ ArgumentsNode (location: (121...125))
│ │ └── arguments: (length: 1)
│ │ └── @ BlockArgumentNode (location: (121...125))
│ │ ├── expression:
│ │ │ @ CallNode (location: (122...125))
│ │ │ ├── receiver: ∅
│ │ │ ├── call_operator_loc: ∅
│ │ │ ├── message_loc: (122...125) = "baz"
│ │ │ ├── opening_loc: ∅
│ │ │ ├── arguments: ∅
│ │ │ ├── closing_loc: ∅
│ │ │ ├── block: ∅
│ │ │ ├── flags: variable_call
│ │ │ └── name: "baz"
│ │ └── operator_loc: (121...122) = "&"
│ ├── closing_loc: ∅ │ ├── closing_loc: ∅
│ ├── block: ∅ │ ├── block:
│ │ @ BlockArgumentNode (location: (121...125))
│ │ ├── expression:
│ │ │ @ CallNode (location: (122...125))
│ │ │ ├── receiver: ∅
│ │ │ ├── call_operator_loc: ∅
│ │ │ ├── message_loc: (122...125) = "baz"
│ │ │ ├── opening_loc: ∅
│ │ │ ├── arguments: ∅
│ │ │ ├── closing_loc: ∅
│ │ │ ├── block: ∅
│ │ │ ├── flags: variable_call
│ │ │ └── name: "baz"
│ │ └── operator_loc: (121...122) = "&"
│ ├── flags: ∅ │ ├── flags: ∅
│ └── name: "Bar" │ └── name: "Bar"
├── @ CallNode (location: (127...135)) ├── @ CallNode (location: (127...135))

View File

@ -267,29 +267,27 @@
│ ├── block: ∅ │ ├── block: ∅
│ ├── flags: ∅ │ ├── flags: ∅
│ └── name: "a?" │ └── name: "a?"
├── @ CallNode (location: (108...117)) ├── @ CallNode (location: (108...116))
│ ├── receiver: ∅ │ ├── receiver: ∅
│ ├── call_operator_loc: ∅ │ ├── call_operator_loc: ∅
│ ├── message_loc: (108...109) = "a" │ ├── message_loc: (108...109) = "a"
│ ├── opening_loc: (109...110) = "(" │ ├── opening_loc: (109...110) = "("
│ ├── arguments: │ ├── arguments: ∅
│ │ @ ArgumentsNode (location: (110...116))
│ │ └── arguments: (length: 1)
│ │ └── @ BlockArgumentNode (location: (110...116))
│ │ ├── expression:
│ │ │ @ CallNode (location: (111...116))
│ │ │ ├── receiver: ∅
│ │ │ ├── call_operator_loc: ∅
│ │ │ ├── message_loc: (111...116) = "block"
│ │ │ ├── opening_loc: ∅
│ │ │ ├── arguments: ∅
│ │ │ ├── closing_loc: ∅
│ │ │ ├── block: ∅
│ │ │ ├── flags: variable_call
│ │ │ └── name: "block"
│ │ └── operator_loc: (110...111) = "&"
│ ├── closing_loc: (116...117) = ")" │ ├── closing_loc: (116...117) = ")"
│ ├── block: ∅ │ ├── block:
│ │ @ BlockArgumentNode (location: (110...116))
│ │ ├── expression:
│ │ │ @ CallNode (location: (111...116))
│ │ │ ├── receiver: ∅
│ │ │ ├── call_operator_loc: ∅
│ │ │ ├── message_loc: (111...116) = "block"
│ │ │ ├── opening_loc: ∅
│ │ │ ├── arguments: ∅
│ │ │ ├── closing_loc: ∅
│ │ │ ├── block: ∅
│ │ │ ├── flags: variable_call
│ │ │ └── name: "block"
│ │ └── operator_loc: (110...111) = "&"
│ ├── flags: ∅ │ ├── flags: ∅
│ └── name: "a" │ └── name: "a"
├── @ CallNode (location: (119...130)) ├── @ CallNode (location: (119...130))
@ -751,68 +749,68 @@
│ ├── block: ∅ │ ├── block: ∅
│ ├── flags: ∅ │ ├── flags: ∅
│ └── name: "foo" │ └── name: "foo"
├── @ CallNode (location: (300...340)) ├── @ CallNode (location: (300...339))
│ ├── receiver: ∅ │ ├── receiver: ∅
│ ├── call_operator_loc: ∅ │ ├── call_operator_loc: ∅
│ ├── message_loc: (300...303) = "foo" │ ├── message_loc: (300...303) = "foo"
│ ├── opening_loc: (303...304) = "(" │ ├── opening_loc: (303...304) = "("
│ ├── arguments: │ ├── arguments:
│ │ @ ArgumentsNode (location: (304...339)) │ │ @ ArgumentsNode (location: (304...332))
│ │ └── arguments: (length: 3) │ │ └── arguments: (length: 2)
│ │ ├── @ SymbolNode (location: (304...306)) │ │ ├── @ SymbolNode (location: (304...306))
│ │ │ ├── opening_loc: (304...305) = ":" │ │ │ ├── opening_loc: (304...305) = ":"
│ │ │ ├── value_loc: (305...306) = "a" │ │ │ ├── value_loc: (305...306) = "a"
│ │ │ ├── closing_loc: ∅ │ │ │ ├── closing_loc: ∅
│ │ │ └── unescaped: "a" │ │ │ └── unescaped: "a"
│ │ ├── @ KeywordHashNode (location: (308...332)) │ │ └── @ KeywordHashNode (location: (308...332))
│ │ │ └── elements: (length: 2) │ │ └── elements: (length: 2)
│ │ │ ├── @ AssocNode (location: (308...322)) │ │ ├── @ AssocNode (location: (308...322))
│ │ │ │ ├── key: │ │ │ ├── key:
│ │ │ │ │ @ SymbolNode (location: (308...310)) │ │ │ │ @ SymbolNode (location: (308...310))
│ │ │ │ │ ├── opening_loc: (308...309) = ":" │ │ │ │ ├── opening_loc: (308...309) = ":"
│ │ │ │ │ ├── value_loc: (309...310) = "h" │ │ │ │ ├── value_loc: (309...310) = "h"
│ │ │ │ │ ├── closing_loc: ∅ │ │ │ │ ├── closing_loc: ∅
│ │ │ │ │ └── unescaped: "h" │ │ │ │ └── unescaped: "h"
│ │ │ │ ├── value: │ │ │ ├── value:
│ │ │ │ │ @ ArrayNode (location: (314...322)) │ │ │ │ @ ArrayNode (location: (314...322))
│ │ │ │ │ ├── elements: (length: 2) │ │ │ │ ├── elements: (length: 2)
│ │ │ │ │ │ ├── @ SymbolNode (location: (315...317)) │ │ │ │ │ ├── @ SymbolNode (location: (315...317))
│ │ │ │ │ │ │ ├── opening_loc: (315...316) = ":" │ │ │ │ │ │ ├── opening_loc: (315...316) = ":"
│ │ │ │ │ │ │ ├── value_loc: (316...317) = "x" │ │ │ │ │ │ ├── value_loc: (316...317) = "x"
│ │ │ │ │ │ │ ├── closing_loc: ∅ │ │ │ │ │ │ ├── closing_loc: ∅
│ │ │ │ │ │ │ └── unescaped: "x" │ │ │ │ │ │ └── unescaped: "x"
│ │ │ │ │ │ └── @ SymbolNode (location: (319...321)) │ │ │ │ │ └── @ SymbolNode (location: (319...321))
│ │ │ │ │ │ ├── opening_loc: (319...320) = ":" │ │ │ │ │ ├── opening_loc: (319...320) = ":"
│ │ │ │ │ │ ├── value_loc: (320...321) = "y" │ │ │ │ │ ├── value_loc: (320...321) = "y"
│ │ │ │ │ │ ├── closing_loc: ∅ │ │ │ │ │ ├── closing_loc: ∅
│ │ │ │ │ │ └── unescaped: "y" │ │ │ │ │ └── unescaped: "y"
│ │ │ │ │ ├── opening_loc: (314...315) = "[" │ │ │ │ ├── opening_loc: (314...315) = "["
│ │ │ │ │ └── closing_loc: (321...322) = "]" │ │ │ │ └── closing_loc: (321...322) = "]"
│ │ │ │ └── operator_loc: (311...313) = "=>" │ │ │ └── operator_loc: (311...313) = "=>"
│ │ │ └── @ AssocNode (location: (324...332)) │ │ └── @ AssocNode (location: (324...332))
│ │ │ ├── key: │ │ ├── key:
│ │ │ │ @ SymbolNode (location: (324...326)) │ │ │ @ SymbolNode (location: (324...326))
│ │ │ │ ├── opening_loc: (324...325) = ":" │ │ │ ├── opening_loc: (324...325) = ":"
│ │ │ │ ├── value_loc: (325...326) = "a" │ │ │ ├── value_loc: (325...326) = "a"
│ │ │ │ ├── closing_loc: ∅ │ │ │ ├── closing_loc: ∅
│ │ │ │ └── unescaped: "a" │ │ │ └── unescaped: "a"
│ │ │ ├── value: │ │ ├── value:
│ │ │ │ @ SymbolNode (location: (330...332)) │ │ │ @ SymbolNode (location: (330...332))
│ │ │ │ ├── opening_loc: (330...331) = ":" │ │ │ ├── opening_loc: (330...331) = ":"
│ │ │ │ ├── value_loc: (331...332) = "b" │ │ │ ├── value_loc: (331...332) = "b"
│ │ │ │ ├── closing_loc: ∅ │ │ │ ├── closing_loc: ∅
│ │ │ │ └── unescaped: "b" │ │ │ └── unescaped: "b"
│ │ │ └── operator_loc: (327...329) = "=>" │ │ └── operator_loc: (327...329) = "=>"
│ │ └── @ BlockArgumentNode (location: (334...339))
│ │ ├── expression:
│ │ │ @ SymbolNode (location: (335...339))
│ │ │ ├── opening_loc: (335...336) = ":"
│ │ │ ├── value_loc: (336...339) = "bar"
│ │ │ ├── closing_loc: ∅
│ │ │ └── unescaped: "bar"
│ │ └── operator_loc: (334...335) = "&"
│ ├── closing_loc: (339...340) = ")" │ ├── closing_loc: (339...340) = ")"
│ ├── block: ∅ │ ├── block:
│ │ @ BlockArgumentNode (location: (334...339))
│ │ ├── expression:
│ │ │ @ SymbolNode (location: (335...339))
│ │ │ ├── opening_loc: (335...336) = ":"
│ │ │ ├── value_loc: (336...339) = "bar"
│ │ │ ├── closing_loc: ∅
│ │ │ └── unescaped: "bar"
│ │ └── operator_loc: (334...335) = "&"
│ ├── flags: ∅ │ ├── flags: ∅
│ └── name: "foo" │ └── name: "foo"
├── @ CallNode (location: (342...391)) ├── @ CallNode (location: (342...391))
@ -1063,48 +1061,48 @@
│ ├── block: ∅ │ ├── block: ∅
│ ├── flags: ∅ │ ├── flags: ∅
│ └── name: "hi" │ └── name: "hi"
├── @ CallNode (location: (535...571)) ├── @ CallNode (location: (535...570))
│ ├── receiver: ∅ │ ├── receiver: ∅
│ ├── call_operator_loc: ∅ │ ├── call_operator_loc: ∅
│ ├── message_loc: (535...538) = "foo" │ ├── message_loc: (535...538) = "foo"
│ ├── opening_loc: (538...539) = "(" │ ├── opening_loc: (538...539) = "("
│ ├── arguments: │ ├── arguments:
│ │ @ ArgumentsNode (location: (539...570)) │ │ @ ArgumentsNode (location: (539...561))
│ │ └── arguments: (length: 2) │ │ └── arguments: (length: 1)
│ │ ├── @ HashNode (location: (539...561)) │ │ └── @ HashNode (location: (539...561))
│ │ │ ├── opening_loc: (539...540) = "{" │ │ ├── opening_loc: (539...540) = "{"
│ │ │ ├── elements: (length: 2) │ │ ├── elements: (length: 2)
│ │ │ │ ├── @ AssocNode (location: (541...548)) │ │ │ ├── @ AssocNode (location: (541...548))
│ │ │ │ │ ├── key: │ │ │ │ ├── key:
│ │ │ │ │ │ @ SymbolNode (location: (541...543)) │ │ │ │ │ @ SymbolNode (location: (541...543))
│ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── opening_loc: ∅
│ │ │ │ │ │ ├── value_loc: (541...542) = "a" │ │ │ │ │ ├── value_loc: (541...542) = "a"
│ │ │ │ │ │ ├── closing_loc: (542...543) = ":" │ │ │ │ │ ├── closing_loc: (542...543) = ":"
│ │ │ │ │ │ └── unescaped: "a" │ │ │ │ │ └── unescaped: "a"
│ │ │ │ │ ├── value: │ │ │ │ ├── value:
│ │ │ │ │ │ @ TrueNode (location: (544...548)) │ │ │ │ │ @ TrueNode (location: (544...548))
│ │ │ │ │ └── operator_loc: ∅ │ │ │ │ └── operator_loc: ∅
│ │ │ │ └── @ AssocNode (location: (550...558)) │ │ │ └── @ AssocNode (location: (550...558))
│ │ │ │ ├── key: │ │ │ ├── key:
│ │ │ │ │ @ SymbolNode (location: (550...552)) │ │ │ │ @ SymbolNode (location: (550...552))
│ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── opening_loc: ∅
│ │ │ │ │ ├── value_loc: (550...551) = "b" │ │ │ │ ├── value_loc: (550...551) = "b"
│ │ │ │ │ ├── closing_loc: (551...552) = ":" │ │ │ │ ├── closing_loc: (551...552) = ":"
│ │ │ │ │ └── unescaped: "b" │ │ │ │ └── unescaped: "b"
│ │ │ │ ├── value: │ │ │ ├── value:
│ │ │ │ │ @ FalseNode (location: (553...558)) │ │ │ │ @ FalseNode (location: (553...558))
│ │ │ │ └── operator_loc: ∅ │ │ │ └── operator_loc: ∅
│ │ │ └── closing_loc: (560...561) = "}" │ │ └── closing_loc: (560...561) = "}"
│ │ └── @ BlockArgumentNode (location: (563...570))
│ │ ├── expression:
│ │ │ @ SymbolNode (location: (564...570))
│ │ │ ├── opening_loc: (564...565) = ":"
│ │ │ ├── value_loc: (565...570) = "block"
│ │ │ ├── closing_loc: ∅
│ │ │ └── unescaped: "block"
│ │ └── operator_loc: (563...564) = "&"
│ ├── closing_loc: (570...571) = ")" │ ├── closing_loc: (570...571) = ")"
│ ├── block: ∅ │ ├── block:
│ │ @ BlockArgumentNode (location: (563...570))
│ │ ├── expression:
│ │ │ @ SymbolNode (location: (564...570))
│ │ │ ├── opening_loc: (564...565) = ":"
│ │ │ ├── value_loc: (565...570) = "block"
│ │ │ ├── closing_loc: ∅
│ │ │ └── unescaped: "block"
│ │ └── operator_loc: (563...564) = "&"
│ ├── flags: ∅ │ ├── flags: ∅
│ └── name: "foo" │ └── name: "foo"
├── @ CallNode (location: (573...593)) ├── @ CallNode (location: (573...593))
@ -1195,19 +1193,17 @@
│ ├── call_operator_loc: ∅ │ ├── call_operator_loc: ∅
│ ├── message_loc: (629...632) = "foo" │ ├── message_loc: (629...632) = "foo"
│ ├── opening_loc: ∅ │ ├── opening_loc: ∅
│ ├── arguments: │ ├── arguments: ∅
│ │ @ ArgumentsNode (location: (633...640))
│ │ └── arguments: (length: 1)
│ │ └── @ BlockArgumentNode (location: (633...640))
│ │ ├── expression:
│ │ │ @ SymbolNode (location: (634...640))
│ │ │ ├── opening_loc: (634...635) = ":"
│ │ │ ├── value_loc: (635...640) = "block"
│ │ │ ├── closing_loc: ∅
│ │ │ └── unescaped: "block"
│ │ └── operator_loc: (633...634) = "&"
│ ├── closing_loc: ∅ │ ├── closing_loc: ∅
│ ├── block: ∅ │ ├── block:
│ │ @ BlockArgumentNode (location: (633...640))
│ │ ├── expression:
│ │ │ @ SymbolNode (location: (634...640))
│ │ │ ├── opening_loc: (634...635) = ":"
│ │ │ ├── value_loc: (635...640) = "block"
│ │ │ ├── closing_loc: ∅
│ │ │ └── unescaped: "block"
│ │ └── operator_loc: (633...634) = "&"
│ ├── flags: ∅ │ ├── flags: ∅
│ └── name: "foo" │ └── name: "foo"
├── @ CallNode (location: (642...672)) ├── @ CallNode (location: (642...672))
@ -1216,40 +1212,40 @@
│ ├── message_loc: (642...645) = "foo" │ ├── message_loc: (642...645) = "foo"
│ ├── opening_loc: ∅ │ ├── opening_loc: ∅
│ ├── arguments: │ ├── arguments:
│ │ @ ArgumentsNode (location: (646...672)) │ │ @ ArgumentsNode (location: (646...663))
│ │ └── arguments: (length: 2) │ │ └── arguments: (length: 1)
│ │ ├── @ KeywordHashNode (location: (646...663)) │ │ └── @ KeywordHashNode (location: (646...663))
│ │ │ └── elements: (length: 2) │ │ └── elements: (length: 2)
│ │ │ ├── @ AssocNode (location: (646...653)) │ │ ├── @ AssocNode (location: (646...653))
│ │ │ │ ├── key: │ │ │ ├── key:
│ │ │ │ │ @ SymbolNode (location: (646...648)) │ │ │ │ @ SymbolNode (location: (646...648))
│ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── opening_loc: ∅
│ │ │ │ │ ├── value_loc: (646...647) = "a" │ │ │ │ ├── value_loc: (646...647) = "a"
│ │ │ │ │ ├── closing_loc: (647...648) = ":" │ │ │ │ ├── closing_loc: (647...648) = ":"
│ │ │ │ │ └── unescaped: "a" │ │ │ │ └── unescaped: "a"
│ │ │ │ ├── value: │ │ │ ├── value:
│ │ │ │ │ @ TrueNode (location: (649...653)) │ │ │ │ @ TrueNode (location: (649...653))
│ │ │ │ └── operator_loc: ∅ │ │ │ └── operator_loc: ∅
│ │ │ └── @ AssocNode (location: (655...663)) │ │ └── @ AssocNode (location: (655...663))
│ │ │ ├── key: │ │ ├── key:
│ │ │ │ @ SymbolNode (location: (655...657)) │ │ │ @ SymbolNode (location: (655...657))
│ │ │ │ ├── opening_loc: ∅ │ │ │ ├── opening_loc: ∅
│ │ │ │ ├── value_loc: (655...656) = "b" │ │ │ ├── value_loc: (655...656) = "b"
│ │ │ │ ├── closing_loc: (656...657) = ":" │ │ │ ├── closing_loc: (656...657) = ":"
│ │ │ │ └── unescaped: "b" │ │ │ └── unescaped: "b"
│ │ │ ├── value: │ │ ├── value:
│ │ │ │ @ FalseNode (location: (658...663)) │ │ │ @ FalseNode (location: (658...663))
│ │ │ └── operator_loc: ∅ │ │ └── operator_loc: ∅
│ │ └── @ BlockArgumentNode (location: (665...672))
│ │ ├── expression:
│ │ │ @ SymbolNode (location: (666...672))
│ │ │ ├── opening_loc: (666...667) = ":"
│ │ │ ├── value_loc: (667...672) = "block"
│ │ │ ├── closing_loc: ∅
│ │ │ └── unescaped: "block"
│ │ └── operator_loc: (665...666) = "&"
│ ├── closing_loc: ∅ │ ├── closing_loc: ∅
│ ├── block: ∅ │ ├── block:
│ │ @ BlockArgumentNode (location: (665...672))
│ │ ├── expression:
│ │ │ @ SymbolNode (location: (666...672))
│ │ │ ├── opening_loc: (666...667) = ":"
│ │ │ ├── value_loc: (667...672) = "block"
│ │ │ ├── closing_loc: ∅
│ │ │ └── unescaped: "block"
│ │ └── operator_loc: (665...666) = "&"
│ ├── flags: ∅ │ ├── flags: ∅
│ └── name: "foo" │ └── name: "foo"
├── @ CallNode (location: (674...695)) ├── @ CallNode (location: (674...695))

View File

@ -1,30 +1,28 @@
@ ProgramNode (location: (0...7)) @ ProgramNode (location: (0...6))
├── locals: [] ├── locals: []
└── statements: └── statements:
@ StatementsNode (location: (0...7)) @ StatementsNode (location: (0...6))
└── body: (length: 1) └── body: (length: 1)
└── @ CallNode (location: (0...7)) └── @ CallNode (location: (0...6))
├── receiver: ∅ ├── receiver: ∅
├── call_operator_loc: ∅ ├── call_operator_loc: ∅
├── message_loc: (0...1) = "x" ├── message_loc: (0...1) = "x"
├── opening_loc: (1...2) = "(" ├── opening_loc: (1...2) = "("
├── arguments: ├── arguments: ∅
│ @ ArgumentsNode (location: (2...6))
│ └── arguments: (length: 1)
│ └── @ BlockArgumentNode (location: (2...6))
│ ├── expression:
│ │ @ CallNode (location: (3...6))
│ │ ├── receiver: ∅
│ │ ├── call_operator_loc: ∅
│ │ ├── message_loc: (3...6) = "blk"
│ │ ├── opening_loc: ∅
│ │ ├── arguments: ∅
│ │ ├── closing_loc: ∅
│ │ ├── block: ∅
│ │ ├── flags: variable_call
│ │ └── name: "blk"
│ └── operator_loc: (2...3) = "&"
├── closing_loc: (6...7) = ")" ├── closing_loc: (6...7) = ")"
├── block: ∅ ├── block:
│ @ BlockArgumentNode (location: (2...6))
│ ├── expression:
│ │ @ CallNode (location: (3...6))
│ │ ├── receiver: ∅
│ │ ├── call_operator_loc: ∅
│ │ ├── message_loc: (3...6) = "blk"
│ │ ├── opening_loc: ∅
│ │ ├── arguments: ∅
│ │ ├── closing_loc: ∅
│ │ ├── block: ∅
│ │ ├── flags: variable_call
│ │ └── name: "blk"
│ └── operator_loc: (2...3) = "&"
├── flags: ∅ ├── flags: ∅
└── name: "x" └── name: "x"

View File

@ -745,112 +745,108 @@
│ ├── block: ∅ │ ├── block: ∅
│ ├── flags: ∅ │ ├── flags: ∅
│ └── name: "=~" │ └── name: "=~"
├── @ CallNode (location: (464...482)) ├── @ CallNode (location: (464...481))
│ ├── receiver: ∅ │ ├── receiver: ∅
│ ├── call_operator_loc: ∅ │ ├── call_operator_loc: ∅
│ ├── message_loc: (464...467) = "foo" │ ├── message_loc: (464...467) = "foo"
│ ├── opening_loc: (467...468) = "(" │ ├── opening_loc: (467...468) = "("
│ ├── arguments: │ ├── arguments: ∅
│ │ @ ArgumentsNode (location: (468...481))
│ │ └── arguments: (length: 1)
│ │ └── @ BlockArgumentNode (location: (468...481))
│ │ ├── expression:
│ │ │ @ ParenthesesNode (location: (469...481))
│ │ │ ├── body:
│ │ │ │ @ StatementsNode (location: (470...480))
│ │ │ │ └── body: (length: 1)
│ │ │ │ └── @ OrNode (location: (470...480))
│ │ │ │ ├── left:
│ │ │ │ │ @ CallNode (location: (470...473))
│ │ │ │ │ ├── receiver: ∅
│ │ │ │ │ ├── call_operator_loc: ∅
│ │ │ │ │ ├── message_loc: (470...473) = "foo"
│ │ │ │ │ ├── opening_loc: ∅
│ │ │ │ │ ├── arguments: ∅
│ │ │ │ │ ├── closing_loc: ∅
│ │ │ │ │ ├── block: ∅
│ │ │ │ │ ├── flags: variable_call
│ │ │ │ │ └── name: "foo"
│ │ │ │ ├── right:
│ │ │ │ │ @ CallNode (location: (477...480))
│ │ │ │ │ ├── receiver: ∅
│ │ │ │ │ ├── call_operator_loc: ∅
│ │ │ │ │ ├── message_loc: (477...480) = "bar"
│ │ │ │ │ ├── opening_loc: ∅
│ │ │ │ │ ├── arguments: ∅
│ │ │ │ │ ├── closing_loc: ∅
│ │ │ │ │ ├── block: ∅
│ │ │ │ │ ├── flags: variable_call
│ │ │ │ │ └── name: "bar"
│ │ │ │ └── operator_loc: (474...476) = "||"
│ │ │ ├── opening_loc: (469...470) = "("
│ │ │ └── closing_loc: (480...481) = ")"
│ │ └── operator_loc: (468...469) = "&"
│ ├── closing_loc: (481...482) = ")" │ ├── closing_loc: (481...482) = ")"
│ ├── block: ∅ │ ├── block:
│ │ @ BlockArgumentNode (location: (468...481))
│ │ ├── expression:
│ │ │ @ ParenthesesNode (location: (469...481))
│ │ │ ├── body:
│ │ │ │ @ StatementsNode (location: (470...480))
│ │ │ │ └── body: (length: 1)
│ │ │ │ └── @ OrNode (location: (470...480))
│ │ │ │ ├── left:
│ │ │ │ │ @ CallNode (location: (470...473))
│ │ │ │ │ ├── receiver: ∅
│ │ │ │ │ ├── call_operator_loc: ∅
│ │ │ │ │ ├── message_loc: (470...473) = "foo"
│ │ │ │ │ ├── opening_loc: ∅
│ │ │ │ │ ├── arguments: ∅
│ │ │ │ │ ├── closing_loc: ∅
│ │ │ │ │ ├── block: ∅
│ │ │ │ │ ├── flags: variable_call
│ │ │ │ │ └── name: "foo"
│ │ │ │ ├── right:
│ │ │ │ │ @ CallNode (location: (477...480))
│ │ │ │ │ ├── receiver: ∅
│ │ │ │ │ ├── call_operator_loc: ∅
│ │ │ │ │ ├── message_loc: (477...480) = "bar"
│ │ │ │ │ ├── opening_loc: ∅
│ │ │ │ │ ├── arguments: ∅
│ │ │ │ │ ├── closing_loc: ∅
│ │ │ │ │ ├── block: ∅
│ │ │ │ │ ├── flags: variable_call
│ │ │ │ │ └── name: "bar"
│ │ │ │ └── operator_loc: (474...476) = "||"
│ │ │ ├── opening_loc: (469...470) = "("
│ │ │ └── closing_loc: (480...481) = ")"
│ │ └── operator_loc: (468...469) = "&"
│ ├── flags: ∅ │ ├── flags: ∅
│ └── name: "foo" │ └── name: "foo"
├── @ CallNode (location: (483...494)) ├── @ CallNode (location: (483...493))
│ ├── receiver: ∅ │ ├── receiver: ∅
│ ├── call_operator_loc: ∅ │ ├── call_operator_loc: ∅
│ ├── message_loc: (483...486) = "foo" │ ├── message_loc: (483...486) = "foo"
│ ├── opening_loc: (486...487) = "(" │ ├── opening_loc: (486...487) = "("
│ ├── arguments: │ ├── arguments: ∅
│ │ @ ArgumentsNode (location: (487...493))
│ │ └── arguments: (length: 1)
│ │ └── @ BlockArgumentNode (location: (487...493))
│ │ ├── expression:
│ │ │ @ CallNode (location: (488...493))
│ │ │ ├── receiver: ∅
│ │ │ ├── call_operator_loc: ∅
│ │ │ ├── message_loc: (488...493) = "block"
│ │ │ ├── opening_loc: ∅
│ │ │ ├── arguments: ∅
│ │ │ ├── closing_loc: ∅
│ │ │ ├── block: ∅
│ │ │ ├── flags: variable_call
│ │ │ └── name: "block"
│ │ └── operator_loc: (487...488) = "&"
│ ├── closing_loc: (493...494) = ")" │ ├── closing_loc: (493...494) = ")"
│ ├── block: ∅ │ ├── block:
│ │ @ BlockArgumentNode (location: (487...493))
│ │ ├── expression:
│ │ │ @ CallNode (location: (488...493))
│ │ │ ├── receiver: ∅
│ │ │ ├── call_operator_loc: ∅
│ │ │ ├── message_loc: (488...493) = "block"
│ │ │ ├── opening_loc: ∅
│ │ │ ├── arguments: ∅
│ │ │ ├── closing_loc: ∅
│ │ │ ├── block: ∅
│ │ │ ├── flags: variable_call
│ │ │ └── name: "block"
│ │ └── operator_loc: (487...488) = "&"
│ ├── flags: ∅ │ ├── flags: ∅
│ └── name: "foo" │ └── name: "foo"
├── @ CallNode (location: (495...513)) ├── @ CallNode (location: (495...512))
│ ├── receiver: ∅ │ ├── receiver: ∅
│ ├── call_operator_loc: ∅ │ ├── call_operator_loc: ∅
│ ├── message_loc: (495...498) = "foo" │ ├── message_loc: (495...498) = "foo"
│ ├── opening_loc: (498...499) = "(" │ ├── opening_loc: (498...499) = "("
│ ├── arguments: │ ├── arguments:
│ │ @ ArgumentsNode (location: (499...512)) │ │ @ ArgumentsNode (location: (499...504))
│ │ └── arguments: (length: 2) │ │ └── arguments: (length: 1)
│ │ ├── @ SplatNode (location: (499...504)) │ │ └── @ SplatNode (location: (499...504))
│ │ │ ├── operator_loc: (499...500) = "*" │ │ ├── operator_loc: (499...500) = "*"
│ │ │ └── expression: │ │ └── expression:
│ │ │ @ CallNode (location: (500...504)) │ │ @ CallNode (location: (500...504))
│ │ │ ├── receiver: ∅ │ │ ├── receiver: ∅
│ │ │ ├── call_operator_loc: ∅ │ │ ├── call_operator_loc: ∅
│ │ │ ├── message_loc: (500...504) = "args" │ │ ├── message_loc: (500...504) = "args"
│ │ │ ├── opening_loc: ∅ │ │ ├── opening_loc: ∅
│ │ │ ├── arguments: ∅ │ │ ├── arguments: ∅
│ │ │ ├── closing_loc: ∅ │ │ ├── closing_loc: ∅
│ │ │ ├── block: ∅ │ │ ├── block: ∅
│ │ │ ├── flags: variable_call │ │ ├── flags: variable_call
│ │ │ └── name: "args" │ │ └── name: "args"
│ │ └── @ BlockArgumentNode (location: (506...512))
│ │ ├── expression:
│ │ │ @ CallNode (location: (507...512))
│ │ │ ├── receiver: ∅
│ │ │ ├── call_operator_loc: ∅
│ │ │ ├── message_loc: (507...512) = "block"
│ │ │ ├── opening_loc: ∅
│ │ │ ├── arguments: ∅
│ │ │ ├── closing_loc: ∅
│ │ │ ├── block: ∅
│ │ │ ├── flags: variable_call
│ │ │ └── name: "block"
│ │ └── operator_loc: (506...507) = "&"
│ ├── closing_loc: (512...513) = ")" │ ├── closing_loc: (512...513) = ")"
│ ├── block: ∅ │ ├── block:
│ │ @ BlockArgumentNode (location: (506...512))
│ │ ├── expression:
│ │ │ @ CallNode (location: (507...512))
│ │ │ ├── receiver: ∅
│ │ │ ├── call_operator_loc: ∅
│ │ │ ├── message_loc: (507...512) = "block"
│ │ │ ├── opening_loc: ∅
│ │ │ ├── arguments: ∅
│ │ │ ├── closing_loc: ∅
│ │ │ ├── block: ∅
│ │ │ ├── flags: variable_call
│ │ │ └── name: "block"
│ │ └── operator_loc: (506...507) = "&"
│ ├── flags: ∅ │ ├── flags: ∅
│ └── name: "foo" │ └── name: "foo"
├── @ CallNode (location: (514...529)) ├── @ CallNode (location: (514...529))
@ -991,7 +987,7 @@
│ ├── block: ∅ │ ├── block: ∅
│ ├── flags: ∅ │ ├── flags: ∅
│ └── name: "foo" │ └── name: "foo"
├── @ CallNode (location: (583...596)) ├── @ CallNode (location: (583...595))
│ ├── receiver: │ ├── receiver:
│ │ @ CallNode (location: (583...586)) │ │ @ CallNode (location: (583...586))
│ │ ├── receiver: ∅ │ │ ├── receiver: ∅
@ -1006,24 +1002,22 @@
│ ├── call_operator_loc: (586...587) = "." │ ├── call_operator_loc: (586...587) = "."
│ ├── message_loc: (587...590) = "bar" │ ├── message_loc: (587...590) = "bar"
│ ├── opening_loc: (590...591) = "(" │ ├── opening_loc: (590...591) = "("
│ ├── arguments: │ ├── arguments: ∅
│ │ @ ArgumentsNode (location: (591...595))
│ │ └── arguments: (length: 1)
│ │ └── @ BlockArgumentNode (location: (591...595))
│ │ ├── expression:
│ │ │ @ CallNode (location: (592...595))
│ │ │ ├── receiver: ∅
│ │ │ ├── call_operator_loc: ∅
│ │ │ ├── message_loc: (592...595) = "baz"
│ │ │ ├── opening_loc: ∅
│ │ │ ├── arguments: ∅
│ │ │ ├── closing_loc: ∅
│ │ │ ├── block: ∅
│ │ │ ├── flags: variable_call
│ │ │ └── name: "baz"
│ │ └── operator_loc: (591...592) = "&"
│ ├── closing_loc: (595...596) = ")" │ ├── closing_loc: (595...596) = ")"
│ ├── block: ∅ │ ├── block:
│ │ @ BlockArgumentNode (location: (591...595))
│ │ ├── expression:
│ │ │ @ CallNode (location: (592...595))
│ │ │ ├── receiver: ∅
│ │ │ ├── call_operator_loc: ∅
│ │ │ ├── message_loc: (592...595) = "baz"
│ │ │ ├── opening_loc: ∅
│ │ │ ├── arguments: ∅
│ │ │ ├── closing_loc: ∅
│ │ │ ├── block: ∅
│ │ │ ├── flags: variable_call
│ │ │ └── name: "baz"
│ │ └── operator_loc: (591...592) = "&"
│ ├── flags: ∅ │ ├── flags: ∅
│ └── name: "bar" │ └── name: "bar"
├── @ CallNode (location: (597...623)) ├── @ CallNode (location: (597...623))
@ -1164,7 +1158,7 @@
│ ├── block: ∅ │ ├── block: ∅
│ ├── flags: ∅ │ ├── flags: ∅
│ └── name: "bar" │ └── name: "bar"
├── @ CallNode (location: (659...678)) ├── @ CallNode (location: (659...677))
│ ├── receiver: │ ├── receiver:
│ │ @ CallNode (location: (659...662)) │ │ @ CallNode (location: (659...662))
│ │ ├── receiver: ∅ │ │ ├── receiver: ∅
@ -1180,28 +1174,28 @@
│ ├── message_loc: (663...666) = "bar" │ ├── message_loc: (663...666) = "bar"
│ ├── opening_loc: (666...667) = "(" │ ├── opening_loc: (666...667) = "("
│ ├── arguments: │ ├── arguments:
│ │ @ ArgumentsNode (location: (667...677)) │ │ @ ArgumentsNode (location: (667...671))
│ │ └── arguments: (length: 2) │ │ └── arguments: (length: 1)
│ │ ├── @ SymbolNode (location: (667...671)) │ │ └── @ SymbolNode (location: (667...671))
│ │ │ ├── opening_loc: (667...668) = ":" │ │ ├── opening_loc: (667...668) = ":"
│ │ │ ├── value_loc: (668...671) = "baz" │ │ ├── value_loc: (668...671) = "baz"
│ │ │ ├── closing_loc: ∅ │ │ ├── closing_loc: ∅
│ │ │ └── unescaped: "baz" │ │ └── unescaped: "baz"
│ │ └── @ BlockArgumentNode (location: (673...677))
│ │ ├── expression:
│ │ │ @ CallNode (location: (674...677))
│ │ │ ├── receiver: ∅
│ │ │ ├── call_operator_loc: ∅
│ │ │ ├── message_loc: (674...677) = "baz"
│ │ │ ├── opening_loc: ∅
│ │ │ ├── arguments: ∅
│ │ │ ├── closing_loc: ∅
│ │ │ ├── block: ∅
│ │ │ ├── flags: variable_call
│ │ │ └── name: "baz"
│ │ └── operator_loc: (673...674) = "&"
│ ├── closing_loc: (677...678) = ")" │ ├── closing_loc: (677...678) = ")"
│ ├── block: ∅ │ ├── block:
│ │ @ BlockArgumentNode (location: (673...677))
│ │ ├── expression:
│ │ │ @ CallNode (location: (674...677))
│ │ │ ├── receiver: ∅
│ │ │ ├── call_operator_loc: ∅
│ │ │ ├── message_loc: (674...677) = "baz"
│ │ │ ├── opening_loc: ∅
│ │ │ ├── arguments: ∅
│ │ │ ├── closing_loc: ∅
│ │ │ ├── block: ∅
│ │ │ ├── flags: variable_call
│ │ │ └── name: "baz"
│ │ └── operator_loc: (673...674) = "&"
│ ├── flags: ∅ │ ├── flags: ∅
│ └── name: "bar" │ └── name: "bar"
├── @ CallNode (location: (679...696)) ├── @ CallNode (location: (679...696))
@ -1346,7 +1340,7 @@
│ ├── block: ∅ │ ├── block: ∅
│ ├── flags: ∅ │ ├── flags: ∅
│ └── name: "bar" │ └── name: "bar"
├── @ CallNode (location: (744...771)) ├── @ CallNode (location: (744...770))
│ ├── receiver: │ ├── receiver:
│ │ @ CallNode (location: (744...747)) │ │ @ CallNode (location: (744...747))
│ │ ├── receiver: ∅ │ │ ├── receiver: ∅
@ -1362,8 +1356,8 @@
│ ├── message_loc: (748...751) = "bar" │ ├── message_loc: (748...751) = "bar"
│ ├── opening_loc: (751...752) = "(" │ ├── opening_loc: (751...752) = "("
│ ├── arguments: │ ├── arguments:
│ │ @ ArgumentsNode (location: (752...770)) │ │ @ ArgumentsNode (location: (752...762))
│ │ └── arguments: (length: 3) │ │ └── arguments: (length: 2)
│ │ ├── @ CallNode (location: (752...755)) │ │ ├── @ CallNode (location: (752...755))
│ │ │ ├── receiver: ∅ │ │ │ ├── receiver: ∅
│ │ │ ├── call_operator_loc: ∅ │ │ │ ├── call_operator_loc: ∅
@ -1374,34 +1368,34 @@
│ │ │ ├── block: ∅ │ │ │ ├── block: ∅
│ │ │ ├── flags: variable_call │ │ │ ├── flags: variable_call
│ │ │ └── name: "foo" │ │ │ └── name: "foo"
│ │ ├── @ SplatNode (location: (757...762)) │ │ └── @ SplatNode (location: (757...762))
│ │ │ ├── operator_loc: (757...758) = "*" │ │ ├── operator_loc: (757...758) = "*"
│ │ │ └── expression: │ │ └── expression:
│ │ │ @ CallNode (location: (758...762)) │ │ @ CallNode (location: (758...762))
│ │ │ ├── receiver: ∅ │ │ ├── receiver: ∅
│ │ │ ├── call_operator_loc: ∅ │ │ ├── call_operator_loc: ∅
│ │ │ ├── message_loc: (758...762) = "args" │ │ ├── message_loc: (758...762) = "args"
│ │ │ ├── opening_loc: ∅ │ │ ├── opening_loc: ∅
│ │ │ ├── arguments: ∅ │ │ ├── arguments: ∅
│ │ │ ├── closing_loc: ∅ │ │ ├── closing_loc: ∅
│ │ │ ├── block: ∅ │ │ ├── block: ∅
│ │ │ ├── flags: variable_call │ │ ├── flags: variable_call
│ │ │ └── name: "args" │ │ └── name: "args"
│ │ └── @ BlockArgumentNode (location: (764...770))
│ │ ├── expression:
│ │ │ @ CallNode (location: (765...770))
│ │ │ ├── receiver: ∅
│ │ │ ├── call_operator_loc: ∅
│ │ │ ├── message_loc: (765...770) = "block"
│ │ │ ├── opening_loc: ∅
│ │ │ ├── arguments: ∅
│ │ │ ├── closing_loc: ∅
│ │ │ ├── block: ∅
│ │ │ ├── flags: variable_call
│ │ │ └── name: "block"
│ │ └── operator_loc: (764...765) = "&"
│ ├── closing_loc: (770...771) = ")" │ ├── closing_loc: (770...771) = ")"
│ ├── block: ∅ │ ├── block:
│ │ @ BlockArgumentNode (location: (764...770))
│ │ ├── expression:
│ │ │ @ CallNode (location: (765...770))
│ │ │ ├── receiver: ∅
│ │ │ ├── call_operator_loc: ∅
│ │ │ ├── message_loc: (765...770) = "block"
│ │ │ ├── opening_loc: ∅
│ │ │ ├── arguments: ∅
│ │ │ ├── closing_loc: ∅
│ │ │ ├── block: ∅
│ │ │ ├── flags: variable_call
│ │ │ └── name: "block"
│ │ └── operator_loc: (764...765) = "&"
│ ├── flags: ∅ │ ├── flags: ∅
│ └── name: "bar" │ └── name: "bar"
├── @ CallNode (location: (772...788)) ├── @ CallNode (location: (772...788))

View File

@ -21,21 +21,19 @@
│ │ ├── name_loc: ∅ │ │ ├── name_loc: ∅
│ │ └── operator_loc: (8...9) = "&" │ │ └── operator_loc: (8...9) = "&"
│ ├── body: │ ├── body:
│ │ @ StatementsNode (location: (13...19)) │ │ @ StatementsNode (location: (13...18))
│ │ └── body: (length: 1) │ │ └── body: (length: 1)
│ │ └── @ CallNode (location: (13...19)) │ │ └── @ CallNode (location: (13...18))
│ │ ├── receiver: ∅ │ │ ├── receiver: ∅
│ │ ├── call_operator_loc: ∅ │ │ ├── call_operator_loc: ∅
│ │ ├── message_loc: (13...16) = "bar" │ │ ├── message_loc: (13...16) = "bar"
│ │ ├── opening_loc: (16...17) = "(" │ │ ├── opening_loc: (16...17) = "("
│ │ ├── arguments: │ │ ├── arguments: ∅
│ │ │ @ ArgumentsNode (location: (17...18))
│ │ │ └── arguments: (length: 1)
│ │ │ └── @ BlockArgumentNode (location: (17...18))
│ │ │ ├── expression: ∅
│ │ │ └── operator_loc: (17...18) = "&"
│ │ ├── closing_loc: (18...19) = ")" │ │ ├── closing_loc: (18...19) = ")"
│ │ ├── block: ∅ │ │ ├── block:
│ │ │ @ BlockArgumentNode (location: (17...18))
│ │ │ ├── expression: ∅
│ │ │ └── operator_loc: (17...18) = "&"
│ │ ├── flags: ∅ │ │ ├── flags: ∅
│ │ └── name: "bar" │ │ └── name: "bar"
│ ├── locals: [:&] │ ├── locals: [:&]
@ -65,21 +63,19 @@
│ ├── name_loc: ∅ │ ├── name_loc: ∅
│ └── operator_loc: (36...37) = "&" │ └── operator_loc: (36...37) = "&"
├── body: ├── body:
│ @ StatementsNode (location: (41...47)) │ @ StatementsNode (location: (41...46))
│ └── body: (length: 1) │ └── body: (length: 1)
│ └── @ CallNode (location: (41...47)) │ └── @ CallNode (location: (41...46))
│ ├── receiver: ∅ │ ├── receiver: ∅
│ ├── call_operator_loc: ∅ │ ├── call_operator_loc: ∅
│ ├── message_loc: (41...44) = "bar" │ ├── message_loc: (41...44) = "bar"
│ ├── opening_loc: (44...45) = "(" │ ├── opening_loc: (44...45) = "("
│ ├── arguments: │ ├── arguments: ∅
│ │ @ ArgumentsNode (location: (45...46))
│ │ └── arguments: (length: 1)
│ │ └── @ BlockArgumentNode (location: (45...46))
│ │ ├── expression: ∅
│ │ └── operator_loc: (45...46) = "&"
│ ├── closing_loc: (46...47) = ")" │ ├── closing_loc: (46...47) = ")"
│ ├── block: ∅ │ ├── block:
│ │ @ BlockArgumentNode (location: (45...46))
│ │ ├── expression: ∅
│ │ └── operator_loc: (45...46) = "&"
│ ├── flags: ∅ │ ├── flags: ∅
│ └── name: "bar" │ └── name: "bar"
├── locals: [:a, :&] ├── locals: [:a, :&]

View File

@ -57,58 +57,56 @@
│ │ └── name: "b" │ │ └── name: "b"
│ ├── rparen_loc: (33...34) = ")" │ ├── rparen_loc: (33...34) = ")"
│ └── block: ∅ │ └── block: ∅
├── @ SuperNode (location: (35...48)) ├── @ SuperNode (location: (35...47))
│ ├── keyword_loc: (35...40) = "super" │ ├── keyword_loc: (35...40) = "super"
│ ├── lparen_loc: (40...41) = "(" │ ├── lparen_loc: (40...41) = "("
│ ├── arguments: │ ├── arguments: ∅
│ │ @ ArgumentsNode (location: (41...47))
│ │ └── arguments: (length: 1)
│ │ └── @ BlockArgumentNode (location: (41...47))
│ │ ├── expression:
│ │ │ @ CallNode (location: (42...47))
│ │ │ ├── receiver: ∅
│ │ │ ├── call_operator_loc: ∅
│ │ │ ├── message_loc: (42...47) = "block"
│ │ │ ├── opening_loc: ∅
│ │ │ ├── arguments: ∅
│ │ │ ├── closing_loc: ∅
│ │ │ ├── block: ∅
│ │ │ ├── flags: variable_call
│ │ │ └── name: "block"
│ │ └── operator_loc: (41...42) = "&"
│ ├── rparen_loc: (47...48) = ")" │ ├── rparen_loc: (47...48) = ")"
│ └── block: ∅ │ └── block:
├── @ SuperNode (location: (49...65)) │ @ BlockArgumentNode (location: (41...47))
│ ├── expression:
│ │ @ CallNode (location: (42...47))
│ │ ├── receiver: ∅
│ │ ├── call_operator_loc: ∅
│ │ ├── message_loc: (42...47) = "block"
│ │ ├── opening_loc: ∅
│ │ ├── arguments: ∅
│ │ ├── closing_loc: ∅
│ │ ├── block: ∅
│ │ ├── flags: variable_call
│ │ └── name: "block"
│ └── operator_loc: (41...42) = "&"
├── @ SuperNode (location: (49...64))
│ ├── keyword_loc: (49...54) = "super" │ ├── keyword_loc: (49...54) = "super"
│ ├── lparen_loc: (54...55) = "(" │ ├── lparen_loc: (54...55) = "("
│ ├── arguments: │ ├── arguments:
│ │ @ ArgumentsNode (location: (55...64)) │ │ @ ArgumentsNode (location: (55...56))
│ │ └── arguments: (length: 2) │ │ └── arguments: (length: 1)
│ │ ├── @ CallNode (location: (55...56)) │ │ └── @ CallNode (location: (55...56))
│ │ │ ├── receiver: ∅ │ │ ├── receiver: ∅
│ │ │ ├── call_operator_loc: ∅ │ │ ├── call_operator_loc: ∅
│ │ │ ├── message_loc: (55...56) = "a" │ │ ├── message_loc: (55...56) = "a"
│ │ │ ├── opening_loc: ∅ │ │ ├── opening_loc: ∅
│ │ │ ├── arguments: ∅ │ │ ├── arguments: ∅
│ │ │ ├── closing_loc: ∅ │ │ ├── closing_loc: ∅
│ │ │ ├── block: ∅ │ │ ├── block: ∅
│ │ │ ├── flags: variable_call │ │ ├── flags: variable_call
│ │ │ └── name: "a" │ │ └── name: "a"
│ │ └── @ BlockArgumentNode (location: (58...64))
│ │ ├── expression:
│ │ │ @ CallNode (location: (59...64))
│ │ │ ├── receiver: ∅
│ │ │ ├── call_operator_loc: ∅
│ │ │ ├── message_loc: (59...64) = "block"
│ │ │ ├── opening_loc: ∅
│ │ │ ├── arguments: ∅
│ │ │ ├── closing_loc: ∅
│ │ │ ├── block: ∅
│ │ │ ├── flags: variable_call
│ │ │ └── name: "block"
│ │ └── operator_loc: (58...59) = "&"
│ ├── rparen_loc: (64...65) = ")" │ ├── rparen_loc: (64...65) = ")"
│ └── block: ∅ │ └── block:
│ @ BlockArgumentNode (location: (58...64))
│ ├── expression:
│ │ @ CallNode (location: (59...64))
│ │ ├── receiver: ∅
│ │ ├── call_operator_loc: ∅
│ │ ├── message_loc: (59...64) = "block"
│ │ ├── opening_loc: ∅
│ │ ├── arguments: ∅
│ │ ├── closing_loc: ∅
│ │ ├── block: ∅
│ │ ├── flags: variable_call
│ │ └── name: "block"
│ └── operator_loc: (58...59) = "&"
├── @ SuperNode (location: (66...84)) ├── @ SuperNode (location: (66...84))
│ ├── keyword_loc: (66...71) = "super" │ ├── keyword_loc: (66...71) = "super"
│ ├── lparen_loc: (71...72) = "(" │ ├── lparen_loc: (71...72) = "("

View File

@ -21,21 +21,19 @@
│ ├── name_loc: ∅ │ ├── name_loc: ∅
│ └── operator_loc: (8...9) = "&" │ └── operator_loc: (8...9) = "&"
├── body: ├── body:
│ @ StatementsNode (location: (12...18)) │ @ StatementsNode (location: (12...17))
│ └── body: (length: 1) │ └── body: (length: 1)
│ └── @ CallNode (location: (12...18)) │ └── @ CallNode (location: (12...17))
│ ├── receiver: ∅ │ ├── receiver: ∅
│ ├── call_operator_loc: ∅ │ ├── call_operator_loc: ∅
│ ├── message_loc: (12...15) = "bar" │ ├── message_loc: (12...15) = "bar"
│ ├── opening_loc: (15...16) = "(" │ ├── opening_loc: (15...16) = "("
│ ├── arguments: │ ├── arguments: ∅
│ │ @ ArgumentsNode (location: (16...17))
│ │ └── arguments: (length: 1)
│ │ └── @ BlockArgumentNode (location: (16...17))
│ │ ├── expression: ∅
│ │ └── operator_loc: (16...17) = "&"
│ ├── closing_loc: (17...18) = ")" │ ├── closing_loc: (17...18) = ")"
│ ├── block: ∅ │ ├── block:
│ │ @ BlockArgumentNode (location: (16...17))
│ │ ├── expression: ∅
│ │ └── operator_loc: (16...17) = "&"
│ ├── flags: ∅ │ ├── flags: ∅
│ └── name: "bar" │ └── name: "bar"
├── locals: [:&] ├── locals: [:&]

View File

@ -1,7 +1,7 @@
@ ProgramNode (location: (0...46)) @ ProgramNode (location: (0...45))
├── locals: [] ├── locals: []
└── statements: └── statements:
@ StatementsNode (location: (0...46)) @ StatementsNode (location: (0...45))
└── body: (length: 2) └── body: (length: 2)
├── @ CallNode (location: (0...19)) ├── @ CallNode (location: (0...19))
│ ├── receiver: ∅ │ ├── receiver: ∅
@ -38,14 +38,14 @@
│ ├── block: ∅ │ ├── block: ∅
│ ├── flags: ∅ │ ├── flags: ∅
│ └── name: "fun" │ └── name: "fun"
└── @ CallNode (location: (21...46)) └── @ CallNode (location: (21...45))
├── receiver: ∅ ├── receiver: ∅
├── call_operator_loc: ∅ ├── call_operator_loc: ∅
├── message_loc: (21...24) = "fun" ├── message_loc: (21...24) = "fun"
├── opening_loc: (24...25) = "(" ├── opening_loc: (24...25) = "("
├── arguments: ├── arguments:
│ @ ArgumentsNode (location: (25...45)) │ @ ArgumentsNode (location: (25...39))
│ └── arguments: (length: 3) │ └── arguments: (length: 2)
│ ├── @ CallNode (location: (25...28)) │ ├── @ CallNode (location: (25...28))
│ │ ├── receiver: ∅ │ │ ├── receiver: ∅
│ │ ├── call_operator_loc: ∅ │ │ ├── call_operator_loc: ∅
@ -56,33 +56,33 @@
│ │ ├── block: ∅ │ │ ├── block: ∅
│ │ ├── flags: variable_call │ │ ├── flags: variable_call
│ │ └── name: "foo" │ │ └── name: "foo"
│ ├── @ KeywordHashNode (location: (30...39)) │ └── @ KeywordHashNode (location: (30...39))
│ │ └── elements: (length: 1) │ └── elements: (length: 1)
│ │ └── @ AssocNode (location: (30...39)) │ └── @ AssocNode (location: (30...39))
│ │ ├── key: │ ├── key:
│ │ │ @ SymbolNode (location: (30...34)) │ │ @ SymbolNode (location: (30...34))
│ │ │ ├── opening_loc: (30...31) = ":" │ │ ├── opening_loc: (30...31) = ":"
│ │ │ ├── value_loc: (31...34) = "foo" │ │ ├── value_loc: (31...34) = "foo"
│ │ │ ├── closing_loc: ∅ │ │ ├── closing_loc: ∅
│ │ │ └── unescaped: "foo" │ │ └── unescaped: "foo"
│ │ ├── value: │ ├── value:
│ │ │ @ IntegerNode (location: (38...39)) │ │ @ IntegerNode (location: (38...39))
│ │ │ └── flags: decimal │ │ └── flags: decimal
│ │ └── operator_loc: (35...37) = "=>" │ └── operator_loc: (35...37) = "=>"
│ └── @ BlockArgumentNode (location: (41...45))
│ ├── expression:
│ │ @ CallNode (location: (42...45))
│ │ ├── receiver: ∅
│ │ ├── call_operator_loc: ∅
│ │ ├── message_loc: (42...45) = "baz"
│ │ ├── opening_loc: ∅
│ │ ├── arguments: ∅
│ │ ├── closing_loc: ∅
│ │ ├── block: ∅
│ │ ├── flags: variable_call
│ │ └── name: "baz"
│ └── operator_loc: (41...42) = "&"
├── closing_loc: (45...46) = ")" ├── closing_loc: (45...46) = ")"
├── block: ∅ ├── block:
│ @ BlockArgumentNode (location: (41...45))
│ ├── expression:
│ │ @ CallNode (location: (42...45))
│ │ ├── receiver: ∅
│ │ ├── call_operator_loc: ∅
│ │ ├── message_loc: (42...45) = "baz"
│ │ ├── opening_loc: ∅
│ │ ├── arguments: ∅
│ │ ├── closing_loc: ∅
│ │ ├── block: ∅
│ │ ├── flags: variable_call
│ │ └── name: "baz"
│ └── operator_loc: (41...42) = "&"
├── flags: ∅ ├── flags: ∅
└── name: "fun" └── name: "fun"

View File

@ -1,7 +1,7 @@
@ ProgramNode (location: (0...36)) @ ProgramNode (location: (0...35))
├── locals: [] ├── locals: []
└── statements: └── statements:
@ StatementsNode (location: (0...36)) @ StatementsNode (location: (0...35))
└── body: (length: 2) └── body: (length: 2)
├── @ CallNode (location: (0...14)) ├── @ CallNode (location: (0...14))
│ ├── receiver: ∅ │ ├── receiver: ∅
@ -38,14 +38,14 @@
│ ├── block: ∅ │ ├── block: ∅
│ ├── flags: ∅ │ ├── flags: ∅
│ └── name: "fun" │ └── name: "fun"
└── @ CallNode (location: (16...36)) └── @ CallNode (location: (16...35))
├── receiver: ∅ ├── receiver: ∅
├── call_operator_loc: ∅ ├── call_operator_loc: ∅
├── message_loc: (16...19) = "fun" ├── message_loc: (16...19) = "fun"
├── opening_loc: (19...20) = "(" ├── opening_loc: (19...20) = "("
├── arguments: ├── arguments:
│ @ ArgumentsNode (location: (20...35)) │ @ ArgumentsNode (location: (20...29))
│ └── arguments: (length: 3) │ └── arguments: (length: 2)
│ ├── @ CallNode (location: (20...23)) │ ├── @ CallNode (location: (20...23))
│ │ ├── receiver: ∅ │ │ ├── receiver: ∅
│ │ ├── call_operator_loc: ∅ │ │ ├── call_operator_loc: ∅
@ -56,33 +56,33 @@
│ │ ├── block: ∅ │ │ ├── block: ∅
│ │ ├── flags: variable_call │ │ ├── flags: variable_call
│ │ └── name: "foo" │ │ └── name: "foo"
│ ├── @ SplatNode (location: (25...29)) │ └── @ SplatNode (location: (25...29))
│ │ ├── operator_loc: (25...26) = "*" │ ├── operator_loc: (25...26) = "*"
│ │ └── expression: │ └── expression:
│ │ @ CallNode (location: (26...29)) │ @ CallNode (location: (26...29))
│ │ ├── receiver: ∅ │ ├── receiver: ∅
│ │ ├── call_operator_loc: ∅ │ ├── call_operator_loc: ∅
│ │ ├── message_loc: (26...29) = "bar" │ ├── message_loc: (26...29) = "bar"
│ │ ├── opening_loc: ∅ │ ├── opening_loc: ∅
│ │ ├── arguments: ∅ │ ├── arguments: ∅
│ │ ├── closing_loc: ∅ │ ├── closing_loc: ∅
│ │ ├── block: ∅ │ ├── block: ∅
│ │ ├── flags: variable_call │ ├── flags: variable_call
│ │ └── name: "bar" │ └── name: "bar"
│ └── @ BlockArgumentNode (location: (31...35))
│ ├── expression:
│ │ @ CallNode (location: (32...35))
│ │ ├── receiver: ∅
│ │ ├── call_operator_loc: ∅
│ │ ├── message_loc: (32...35) = "baz"
│ │ ├── opening_loc: ∅
│ │ ├── arguments: ∅
│ │ ├── closing_loc: ∅
│ │ ├── block: ∅
│ │ ├── flags: variable_call
│ │ └── name: "baz"
│ └── operator_loc: (31...32) = "&"
├── closing_loc: (35...36) = ")" ├── closing_loc: (35...36) = ")"
├── block: ∅ ├── block:
│ @ BlockArgumentNode (location: (31...35))
│ ├── expression:
│ │ @ CallNode (location: (32...35))
│ │ ├── receiver: ∅
│ │ ├── call_operator_loc: ∅
│ │ ├── message_loc: (32...35) = "baz"
│ │ ├── opening_loc: ∅
│ │ ├── arguments: ∅
│ │ ├── closing_loc: ∅
│ │ ├── block: ∅
│ │ ├── flags: variable_call
│ │ └── name: "baz"
│ └── operator_loc: (31...32) = "&"
├── flags: ∅ ├── flags: ∅
└── name: "fun" └── name: "fun"

View File

@ -28,42 +28,42 @@
│ ├── block: ∅ │ ├── block: ∅
│ ├── flags: ∅ │ ├── flags: ∅
│ └── name: "fun" │ └── name: "fun"
├── @ CallNode (location: (16...36)) ├── @ CallNode (location: (16...35))
│ ├── receiver: ∅ │ ├── receiver: ∅
│ ├── call_operator_loc: ∅ │ ├── call_operator_loc: ∅
│ ├── message_loc: (16...19) = "fun" │ ├── message_loc: (16...19) = "fun"
│ ├── opening_loc: (19...20) = "(" │ ├── opening_loc: (19...20) = "("
│ ├── arguments: │ ├── arguments:
│ │ @ ArgumentsNode (location: (20...35)) │ │ @ ArgumentsNode (location: (20...29))
│ │ └── arguments: (length: 2) │ │ └── arguments: (length: 1)
│ │ ├── @ KeywordHashNode (location: (20...29)) │ │ └── @ KeywordHashNode (location: (20...29))
│ │ │ └── elements: (length: 1) │ │ └── elements: (length: 1)
│ │ │ └── @ AssocNode (location: (20...29)) │ │ └── @ AssocNode (location: (20...29))
│ │ │ ├── key: │ │ ├── key:
│ │ │ │ @ SymbolNode (location: (20...24)) │ │ │ @ SymbolNode (location: (20...24))
│ │ │ │ ├── opening_loc: (20...21) = ":" │ │ │ ├── opening_loc: (20...21) = ":"
│ │ │ │ ├── value_loc: (21...24) = "foo" │ │ │ ├── value_loc: (21...24) = "foo"
│ │ │ │ ├── closing_loc: ∅ │ │ │ ├── closing_loc: ∅
│ │ │ │ └── unescaped: "foo" │ │ │ └── unescaped: "foo"
│ │ │ ├── value: │ │ ├── value:
│ │ │ │ @ IntegerNode (location: (28...29)) │ │ │ @ IntegerNode (location: (28...29))
│ │ │ │ └── flags: decimal │ │ │ └── flags: decimal
│ │ │ └── operator_loc: (25...27) = "=>" │ │ └── operator_loc: (25...27) = "=>"
│ │ └── @ BlockArgumentNode (location: (31...35))
│ │ ├── expression:
│ │ │ @ CallNode (location: (32...35))
│ │ │ ├── receiver: ∅
│ │ │ ├── call_operator_loc: ∅
│ │ │ ├── message_loc: (32...35) = "baz"
│ │ │ ├── opening_loc: ∅
│ │ │ ├── arguments: ∅
│ │ │ ├── closing_loc: ∅
│ │ │ ├── block: ∅
│ │ │ ├── flags: variable_call
│ │ │ └── name: "baz"
│ │ └── operator_loc: (31...32) = "&"
│ ├── closing_loc: (35...36) = ")" │ ├── closing_loc: (35...36) = ")"
│ ├── block: ∅ │ ├── block:
│ │ @ BlockArgumentNode (location: (31...35))
│ │ ├── expression:
│ │ │ @ CallNode (location: (32...35))
│ │ │ ├── receiver: ∅
│ │ │ ├── call_operator_loc: ∅
│ │ │ ├── message_loc: (32...35) = "baz"
│ │ │ ├── opening_loc: ∅
│ │ │ ├── arguments: ∅
│ │ │ ├── closing_loc: ∅
│ │ │ ├── block: ∅
│ │ │ ├── flags: variable_call
│ │ │ └── name: "baz"
│ │ └── operator_loc: (31...32) = "&"
│ ├── flags: ∅ │ ├── flags: ∅
│ └── name: "fun" │ └── name: "fun"
├── @ CallNode (location: (38...59)) ├── @ CallNode (location: (38...59))

View File

@ -28,42 +28,42 @@
│ ├── block: ∅ │ ├── block: ∅
│ ├── flags: ∅ │ ├── flags: ∅
│ └── name: "fun" │ └── name: "fun"
├── @ CallNode (location: (16...36)) ├── @ CallNode (location: (16...35))
│ ├── receiver: ∅ │ ├── receiver: ∅
│ ├── call_operator_loc: ∅ │ ├── call_operator_loc: ∅
│ ├── message_loc: (16...19) = "fun" │ ├── message_loc: (16...19) = "fun"
│ ├── opening_loc: (19...20) = "(" │ ├── opening_loc: (19...20) = "("
│ ├── arguments: │ ├── arguments:
│ │ @ ArgumentsNode (location: (20...35)) │ │ @ ArgumentsNode (location: (20...29))
│ │ └── arguments: (length: 2) │ │ └── arguments: (length: 1)
│ │ ├── @ KeywordHashNode (location: (20...29)) │ │ └── @ KeywordHashNode (location: (20...29))
│ │ │ └── elements: (length: 1) │ │ └── elements: (length: 1)
│ │ │ └── @ AssocNode (location: (20...29)) │ │ └── @ AssocNode (location: (20...29))
│ │ │ ├── key: │ │ ├── key:
│ │ │ │ @ SymbolNode (location: (20...24)) │ │ │ @ SymbolNode (location: (20...24))
│ │ │ │ ├── opening_loc: (20...21) = ":" │ │ │ ├── opening_loc: (20...21) = ":"
│ │ │ │ ├── value_loc: (21...24) = "foo" │ │ │ ├── value_loc: (21...24) = "foo"
│ │ │ │ ├── closing_loc: ∅ │ │ │ ├── closing_loc: ∅
│ │ │ │ └── unescaped: "foo" │ │ │ └── unescaped: "foo"
│ │ │ ├── value: │ │ ├── value:
│ │ │ │ @ IntegerNode (location: (28...29)) │ │ │ @ IntegerNode (location: (28...29))
│ │ │ │ └── flags: decimal │ │ │ └── flags: decimal
│ │ │ └── operator_loc: (25...27) = "=>" │ │ └── operator_loc: (25...27) = "=>"
│ │ └── @ BlockArgumentNode (location: (31...35))
│ │ ├── expression:
│ │ │ @ CallNode (location: (32...35))
│ │ │ ├── receiver: ∅
│ │ │ ├── call_operator_loc: ∅
│ │ │ ├── message_loc: (32...35) = "baz"
│ │ │ ├── opening_loc: ∅
│ │ │ ├── arguments: ∅
│ │ │ ├── closing_loc: ∅
│ │ │ ├── block: ∅
│ │ │ ├── flags: variable_call
│ │ │ └── name: "baz"
│ │ └── operator_loc: (31...32) = "&"
│ ├── closing_loc: (35...36) = ")" │ ├── closing_loc: (35...36) = ")"
│ ├── block: ∅ │ ├── block:
│ │ @ BlockArgumentNode (location: (31...35))
│ │ ├── expression:
│ │ │ @ CallNode (location: (32...35))
│ │ │ ├── receiver: ∅
│ │ │ ├── call_operator_loc: ∅
│ │ │ ├── message_loc: (32...35) = "baz"
│ │ │ ├── opening_loc: ∅
│ │ │ ├── arguments: ∅
│ │ │ ├── closing_loc: ∅
│ │ │ ├── block: ∅
│ │ │ ├── flags: variable_call
│ │ │ └── name: "baz"
│ │ └── operator_loc: (31...32) = "&"
│ ├── flags: ∅ │ ├── flags: ∅
│ └── name: "fun" │ └── name: "fun"
├── @ CallNode (location: (38...59)) ├── @ CallNode (location: (38...59))

View File

@ -1,30 +1,28 @@
@ ProgramNode (location: (0...9)) @ ProgramNode (location: (0...8))
├── locals: [] ├── locals: []
└── statements: └── statements:
@ StatementsNode (location: (0...9)) @ StatementsNode (location: (0...8))
└── body: (length: 1) └── body: (length: 1)
└── @ CallNode (location: (0...9)) └── @ CallNode (location: (0...8))
├── receiver: ∅ ├── receiver: ∅
├── call_operator_loc: ∅ ├── call_operator_loc: ∅
├── message_loc: (0...3) = "fun" ├── message_loc: (0...3) = "fun"
├── opening_loc: (3...4) = "(" ├── opening_loc: (3...4) = "("
├── arguments: ├── arguments: ∅
│ @ ArgumentsNode (location: (4...8))
│ └── arguments: (length: 1)
│ └── @ BlockArgumentNode (location: (4...8))
│ ├── expression:
│ │ @ CallNode (location: (5...8))
│ │ ├── receiver: ∅
│ │ ├── call_operator_loc: ∅
│ │ ├── message_loc: (5...8) = "bar"
│ │ ├── opening_loc: ∅
│ │ ├── arguments: ∅
│ │ ├── closing_loc: ∅
│ │ ├── block: ∅
│ │ ├── flags: variable_call
│ │ └── name: "bar"
│ └── operator_loc: (4...5) = "&"
├── closing_loc: (8...9) = ")" ├── closing_loc: (8...9) = ")"
├── block: ∅ ├── block:
│ @ BlockArgumentNode (location: (4...8))
│ ├── expression:
│ │ @ CallNode (location: (5...8))
│ │ ├── receiver: ∅
│ │ ├── call_operator_loc: ∅
│ │ ├── message_loc: (5...8) = "bar"
│ │ ├── opening_loc: ∅
│ │ ├── arguments: ∅
│ │ ├── closing_loc: ∅
│ │ ├── block: ∅
│ │ ├── flags: variable_call
│ │ └── name: "bar"
│ └── operator_loc: (4...5) = "&"
├── flags: ∅ ├── flags: ∅
└── name: "fun" └── name: "fun"

View File

@ -1,7 +1,7 @@
@ ProgramNode (location: (0...26)) @ ProgramNode (location: (0...25))
├── locals: [] ├── locals: []
└── statements: └── statements:
@ StatementsNode (location: (0...26)) @ StatementsNode (location: (0...25))
└── body: (length: 2) └── body: (length: 2)
├── @ CallNode (location: (0...9)) ├── @ CallNode (location: (0...9))
│ ├── receiver: ∅ │ ├── receiver: ∅
@ -28,41 +28,41 @@
│ ├── block: ∅ │ ├── block: ∅
│ ├── flags: ∅ │ ├── flags: ∅
│ └── name: "fun" │ └── name: "fun"
└── @ CallNode (location: (11...26)) └── @ CallNode (location: (11...25))
├── receiver: ∅ ├── receiver: ∅
├── call_operator_loc: ∅ ├── call_operator_loc: ∅
├── message_loc: (11...14) = "fun" ├── message_loc: (11...14) = "fun"
├── opening_loc: (14...15) = "(" ├── opening_loc: (14...15) = "("
├── arguments: ├── arguments:
│ @ ArgumentsNode (location: (15...25)) │ @ ArgumentsNode (location: (15...19))
│ └── arguments: (length: 2) │ └── arguments: (length: 1)
│ ├── @ SplatNode (location: (15...19)) │ └── @ SplatNode (location: (15...19))
│ │ ├── operator_loc: (15...16) = "*" │ ├── operator_loc: (15...16) = "*"
│ │ └── expression: │ └── expression:
│ │ @ CallNode (location: (16...19)) │ @ CallNode (location: (16...19))
│ │ ├── receiver: ∅ │ ├── receiver: ∅
│ │ ├── call_operator_loc: ∅ │ ├── call_operator_loc: ∅
│ │ ├── message_loc: (16...19) = "bar" │ ├── message_loc: (16...19) = "bar"
│ │ ├── opening_loc: ∅ │ ├── opening_loc: ∅
│ │ ├── arguments: ∅ │ ├── arguments: ∅
│ │ ├── closing_loc: ∅ │ ├── closing_loc: ∅
│ │ ├── block: ∅ │ ├── block: ∅
│ │ ├── flags: variable_call │ ├── flags: variable_call
│ │ └── name: "bar" │ └── name: "bar"
│ └── @ BlockArgumentNode (location: (21...25))
│ ├── expression:
│ │ @ CallNode (location: (22...25))
│ │ ├── receiver: ∅
│ │ ├── call_operator_loc: ∅
│ │ ├── message_loc: (22...25) = "baz"
│ │ ├── opening_loc: ∅
│ │ ├── arguments: ∅
│ │ ├── closing_loc: ∅
│ │ ├── block: ∅
│ │ ├── flags: variable_call
│ │ └── name: "baz"
│ └── operator_loc: (21...22) = "&"
├── closing_loc: (25...26) = ")" ├── closing_loc: (25...26) = ")"
├── block: ∅ ├── block:
│ @ BlockArgumentNode (location: (21...25))
│ ├── expression:
│ │ @ CallNode (location: (22...25))
│ │ ├── receiver: ∅
│ │ ├── call_operator_loc: ∅
│ │ ├── message_loc: (22...25) = "baz"
│ │ ├── opening_loc: ∅
│ │ ├── arguments: ∅
│ │ ├── closing_loc: ∅
│ │ ├── block: ∅
│ │ ├── flags: variable_call
│ │ └── name: "baz"
│ └── operator_loc: (21...22) = "&"
├── flags: ∅ ├── flags: ∅
└── name: "fun" └── name: "fun"

View File

@ -668,7 +668,6 @@ nodes:
type: location? type: location?
- name: block - name: block
type: node? type: node?
kind: BlockNode
- name: flags - name: flags
type: flags type: flags
kind: CallNodeFlags kind: CallNodeFlags
@ -2315,7 +2314,6 @@ nodes:
type: location? type: location?
- name: block - name: block
type: node? type: node?
kind: BlockNode
comment: | comment: |
Represents the use of the `super` keyword with parentheses or arguments. Represents the use of the `super` keyword with parentheses or arguments.

View File

@ -549,11 +549,7 @@ typedef struct {
yp_location_t opening_loc; yp_location_t opening_loc;
yp_arguments_node_t *arguments; yp_arguments_node_t *arguments;
yp_location_t closing_loc; yp_location_t closing_loc;
yp_block_node_t *block; yp_node_t *block;
// This boolean is used to tell if there is an implicit block (i.e., an
// argument passed with an & operator).
bool implicit_block;
} yp_arguments_t; } yp_arguments_t;
#define YP_EMPTY_ARGUMENTS ((yp_arguments_t) { \ #define YP_EMPTY_ARGUMENTS ((yp_arguments_t) { \
@ -561,36 +557,37 @@ typedef struct {
.arguments = NULL, \ .arguments = NULL, \
.closing_loc = YP_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, \ .closing_loc = YP_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, \
.block = NULL, \ .block = NULL, \
.implicit_block = false \
}) })
// Check that the set of arguments parsed for a given node is valid. This means // Check that we're not about to attempt to attach a brace block to a call that
// checking that we don't have both an implicit and explicit block. // has arguments without parentheses.
static void static void
yp_arguments_validate(yp_parser_t *parser, yp_arguments_t *arguments) { yp_arguments_validate_block(yp_parser_t *parser, yp_arguments_t *arguments, yp_block_node_t *block) {
if (arguments->block != NULL && arguments->implicit_block) { // First, check that we have arguments and that we don't have a closing
yp_diagnostic_list_append( // location for them.
&parser->error_list, if (arguments->arguments == NULL || arguments->closing_loc.start != NULL) {
arguments->block->base.location.start, return;
arguments->block->base.location.end,
YP_ERR_ARGUMENT_BLOCK_MULTI
);
} }
// Brace blocks can't be attached to arguments, only to the call // Next, check that we don't have a single parentheses argument. This would
if (arguments->block != NULL && // look like:
*arguments->block->opening_loc.start == '{' && //
arguments->arguments != NULL && // foo (1) {}
!(arguments->arguments->arguments.size == 1 && //
YP_NODE_TYPE_P(arguments->arguments->arguments.nodes[0], YP_PARENTHESES_NODE)) && // In this case, it's actually okay for the block to be attached to the
!arguments->closing_loc.end) { // call, even though it looks like it's attached to the argument.
yp_diagnostic_list_append( if (arguments->arguments->arguments.size == 1 && YP_NODE_TYPE_P(arguments->arguments->arguments.nodes[0], YP_PARENTHESES_NODE)) {
&parser->error_list, return;
arguments->block->base.location.start,
arguments->block->base.location.end,
YP_ERR_ARGUMENT_BLOCK_MULTI
);
} }
// If we didn't hit a case before this check, then at this point we need to
// add a syntax error.
yp_diagnostic_list_append(
&parser->error_list,
block->base.location.start,
block->base.location.end,
YP_ERR_ARGUMENT_UNEXPECTED_BLOCK
);
} }
/******************************************************************************/ /******************************************************************************/
@ -1340,7 +1337,7 @@ yp_call_node_aref_create(yp_parser_t *parser, yp_node_t *receiver, yp_arguments_
node->base.location.start = receiver->location.start; node->base.location.start = receiver->location.start;
if (arguments->block != NULL) { if (arguments->block != NULL) {
node->base.location.end = arguments->block->base.location.end; node->base.location.end = arguments->block->location.end;
} else { } else {
node->base.location.end = arguments->closing_loc.end; node->base.location.end = arguments->closing_loc.end;
} }
@ -1384,7 +1381,7 @@ yp_call_node_call_create(yp_parser_t *parser, yp_node_t *receiver, yp_token_t *o
node->base.location.start = receiver->location.start; node->base.location.start = receiver->location.start;
if (arguments->block != NULL) { if (arguments->block != NULL) {
node->base.location.end = arguments->block->base.location.end; node->base.location.end = arguments->block->location.end;
} else if (arguments->closing_loc.start != NULL) { } else if (arguments->closing_loc.start != NULL) {
node->base.location.end = arguments->closing_loc.end; node->base.location.end = arguments->closing_loc.end;
} else if (arguments->arguments != NULL) { } else if (arguments->arguments != NULL) {
@ -1417,7 +1414,7 @@ yp_call_node_fcall_create(yp_parser_t *parser, yp_token_t *message, yp_arguments
node->base.location.start = message->start; node->base.location.start = message->start;
if (arguments->block != NULL) { if (arguments->block != NULL) {
node->base.location.end = arguments->block->base.location.end; node->base.location.end = arguments->block->location.end;
} else if (arguments->closing_loc.start != NULL) { } else if (arguments->closing_loc.start != NULL) {
node->base.location.end = arguments->closing_loc.end; node->base.location.end = arguments->closing_loc.end;
} else if (arguments->arguments != NULL) { } else if (arguments->arguments != NULL) {
@ -1465,7 +1462,7 @@ yp_call_node_shorthand_create(yp_parser_t *parser, yp_node_t *receiver, yp_token
node->base.location.start = receiver->location.start; node->base.location.start = receiver->location.start;
if (arguments->block != NULL) { if (arguments->block != NULL) {
node->base.location.end = arguments->block->base.location.end; node->base.location.end = arguments->block->location.end;
} else { } else {
node->base.location.end = arguments->closing_loc.end; node->base.location.end = arguments->closing_loc.end;
} }
@ -2414,18 +2411,24 @@ yp_forwarding_parameter_node_create(yp_parser_t *parser, const yp_token_t *token
// Allocate and initialize a new ForwardingSuper node. // Allocate and initialize a new ForwardingSuper node.
static yp_forwarding_super_node_t * static yp_forwarding_super_node_t *
yp_forwarding_super_node_create(yp_parser_t *parser, const yp_token_t *token, yp_arguments_t *arguments) { yp_forwarding_super_node_create(yp_parser_t *parser, const yp_token_t *token, yp_arguments_t *arguments) {
assert(arguments->block == NULL || YP_NODE_TYPE_P(arguments->block, YP_BLOCK_NODE));
assert(token->type == YP_TOKEN_KEYWORD_SUPER); assert(token->type == YP_TOKEN_KEYWORD_SUPER);
yp_forwarding_super_node_t *node = YP_ALLOC_NODE(parser, yp_forwarding_super_node_t); yp_forwarding_super_node_t *node = YP_ALLOC_NODE(parser, yp_forwarding_super_node_t);
yp_block_node_t *block = NULL;
if (arguments->block != NULL) {
block = (yp_block_node_t *) arguments->block;
}
*node = (yp_forwarding_super_node_t) { *node = (yp_forwarding_super_node_t) {
{ {
.type = YP_FORWARDING_SUPER_NODE, .type = YP_FORWARDING_SUPER_NODE,
.location = { .location = {
.start = token->start, .start = token->start,
.end = arguments->block != NULL ? arguments->block->base.location.end : token->end .end = block != NULL ? block->base.location.end : token->end
}, },
}, },
.block = arguments->block .block = block
}; };
return node; return node;
@ -4282,7 +4285,7 @@ yp_super_node_create(yp_parser_t *parser, const yp_token_t *keyword, yp_argument
const uint8_t *end; const uint8_t *end;
if (arguments->block != NULL) { if (arguments->block != NULL) {
end = arguments->block->base.location.end; end = arguments->block->location.end;
} else if (arguments->closing_loc.start != NULL) { } else if (arguments->closing_loc.start != NULL) {
end = arguments->closing_loc.end; end = arguments->closing_loc.end;
} else if (arguments->arguments != NULL) { } else if (arguments->arguments != NULL) {
@ -8894,6 +8897,16 @@ parse_assocs(yp_parser_t *parser, yp_node_t *node) {
} }
} }
// Append an argument to a list of arguments.
static inline void
parse_arguments_append(yp_parser_t *parser, yp_arguments_t *arguments, yp_node_t *argument) {
if (arguments->arguments == NULL) {
arguments->arguments = yp_arguments_node_create(parser);
}
yp_arguments_node_arguments_append(arguments->arguments, argument);
}
// Parse a list of arguments. // Parse a list of arguments.
static void static void
parse_arguments(yp_parser_t *parser, yp_arguments_t *arguments, bool accepts_forwarding, yp_token_type_t terminator) { parse_arguments(yp_parser_t *parser, yp_arguments_t *arguments, bool accepts_forwarding, yp_token_type_t terminator) {
@ -8927,13 +8940,14 @@ parse_arguments(yp_parser_t *parser, yp_arguments_t *arguments, bool accepts_for
} }
yp_keyword_hash_node_t *hash = yp_keyword_hash_node_create(parser); yp_keyword_hash_node_t *hash = yp_keyword_hash_node_create(parser);
argument = (yp_node_t *)hash; argument = (yp_node_t *) hash;
if (!match7(parser, terminator, YP_TOKEN_NEWLINE, YP_TOKEN_SEMICOLON, YP_TOKEN_EOF, YP_TOKEN_BRACE_RIGHT, YP_TOKEN_KEYWORD_DO, YP_TOKEN_PARENTHESIS_RIGHT)) { if (!match7(parser, terminator, YP_TOKEN_NEWLINE, YP_TOKEN_SEMICOLON, YP_TOKEN_EOF, YP_TOKEN_BRACE_RIGHT, YP_TOKEN_KEYWORD_DO, YP_TOKEN_PARENTHESIS_RIGHT)) {
parse_assocs(parser, (yp_node_t *) hash); parse_assocs(parser, (yp_node_t *) hash);
} }
parsed_bare_hash = true; parsed_bare_hash = true;
parse_arguments_append(parser, arguments, argument);
break; break;
} }
case YP_TOKEN_UAMPERSAND: { case YP_TOKEN_UAMPERSAND: {
@ -8947,9 +8961,14 @@ parse_arguments(yp_parser_t *parser, yp_arguments_t *arguments, bool accepts_for
yp_diagnostic_list_append(&parser->error_list, operator.start, operator.end, YP_ERR_ARGUMENT_NO_FORWARDING_AMP); yp_diagnostic_list_append(&parser->error_list, operator.start, operator.end, YP_ERR_ARGUMENT_NO_FORWARDING_AMP);
} }
argument = (yp_node_t *)yp_block_argument_node_create(parser, &operator, expression); argument = (yp_node_t *) yp_block_argument_node_create(parser, &operator, expression);
if (parsed_block_argument) {
parse_arguments_append(parser, arguments, argument);
} else {
arguments->block = argument;
}
parsed_block_argument = true; parsed_block_argument = true;
arguments->implicit_block = true;
break; break;
} }
case YP_TOKEN_USTAR: { case YP_TOKEN_USTAR: {
@ -8972,6 +8991,7 @@ parse_arguments(yp_parser_t *parser, yp_arguments_t *arguments, bool accepts_for
argument = (yp_node_t *) yp_splat_node_create(parser, &operator, expression); argument = (yp_node_t *) yp_splat_node_create(parser, &operator, expression);
} }
parse_arguments_append(parser, arguments, argument);
break; break;
} }
case YP_TOKEN_UDOT_DOT_DOT: { case YP_TOKEN_UDOT_DOT_DOT: {
@ -8989,7 +9009,8 @@ parse_arguments(yp_parser_t *parser, yp_arguments_t *arguments, bool accepts_for
yp_diagnostic_list_append(&parser->error_list, parser->previous.start, parser->previous.end, YP_ERR_ARGUMENT_NO_FORWARDING_ELLIPSES); yp_diagnostic_list_append(&parser->error_list, parser->previous.start, parser->previous.end, YP_ERR_ARGUMENT_NO_FORWARDING_ELLIPSES);
} }
argument = (yp_node_t *)yp_forwarding_arguments_node_create(parser, &parser->previous); argument = (yp_node_t *) yp_forwarding_arguments_node_create(parser, &parser->previous);
parse_arguments_append(parser, arguments, argument);
break; break;
} }
} }
@ -9032,12 +9053,11 @@ parse_arguments(yp_parser_t *parser, yp_arguments_t *arguments, bool accepts_for
parsed_bare_hash = true; parsed_bare_hash = true;
} }
parse_arguments_append(parser, arguments, argument);
break; break;
} }
} }
yp_arguments_node_arguments_append(arguments->arguments, argument);
// If parsing the argument failed, we need to stop parsing arguments. // If parsing the argument failed, we need to stop parsing arguments.
if (YP_NODE_TYPE_P(argument, YP_MISSING_NODE) || parser->recovering) break; if (YP_NODE_TYPE_P(argument, YP_MISSING_NODE) || parser->recovering) break;
@ -9737,8 +9757,6 @@ parse_arguments_list(yp_parser_t *parser, yp_arguments_t *arguments, bool accept
if (accept1(parser, YP_TOKEN_PARENTHESIS_RIGHT)) { if (accept1(parser, YP_TOKEN_PARENTHESIS_RIGHT)) {
arguments->closing_loc = YP_LOCATION_TOKEN_VALUE(&parser->previous); arguments->closing_loc = YP_LOCATION_TOKEN_VALUE(&parser->previous);
} else { } else {
arguments->arguments = yp_arguments_node_create(parser);
yp_accepts_block_stack_push(parser, true); yp_accepts_block_stack_push(parser, true);
parse_arguments(parser, arguments, true, YP_TOKEN_PARENTHESIS_RIGHT); parse_arguments(parser, arguments, true, YP_TOKEN_PARENTHESIS_RIGHT);
expect1(parser, YP_TOKEN_PARENTHESIS_RIGHT, YP_ERR_ARGUMENT_TERM_PAREN); expect1(parser, YP_TOKEN_PARENTHESIS_RIGHT, YP_ERR_ARGUMENT_TERM_PAREN);
@ -9753,7 +9771,6 @@ parse_arguments_list(yp_parser_t *parser, yp_arguments_t *arguments, bool accept
// If we get here, then the subsequent token cannot be used as an infix // If we get here, then the subsequent token cannot be used as an infix
// operator. In this case we assume the subsequent token is part of an // operator. In this case we assume the subsequent token is part of an
// argument to this method call. // argument to this method call.
arguments->arguments = yp_arguments_node_create(parser);
parse_arguments(parser, arguments, true, YP_TOKEN_EOF); parse_arguments(parser, arguments, true, YP_TOKEN_EOF);
yp_accepts_block_stack_pop(parser); yp_accepts_block_stack_pop(parser);
@ -9763,16 +9780,28 @@ parse_arguments_list(yp_parser_t *parser, yp_arguments_t *arguments, bool accept
// node that starts with a {. If there is, then we can parse it and add it to // node that starts with a {. If there is, then we can parse it and add it to
// the arguments. // the arguments.
if (accepts_block) { if (accepts_block) {
yp_block_node_t *block = NULL;
if (accept1(parser, YP_TOKEN_BRACE_LEFT)) { if (accept1(parser, YP_TOKEN_BRACE_LEFT)) {
found |= true; found |= true;
arguments->block = parse_block(parser); block = parse_block(parser);
yp_arguments_validate_block(parser, arguments, block);
} else if (yp_accepts_block_stack_p(parser) && accept1(parser, YP_TOKEN_KEYWORD_DO)) { } else if (yp_accepts_block_stack_p(parser) && accept1(parser, YP_TOKEN_KEYWORD_DO)) {
found |= true; found |= true;
arguments->block = parse_block(parser); block = parse_block(parser);
}
if (block != NULL) {
if (arguments->block == NULL) {
arguments->block = (yp_node_t *) block;
} else {
yp_diagnostic_list_append(&parser->error_list, block->base.location.start, block->base.location.end, YP_ERR_ARGUMENT_BLOCK_MULTI);
yp_arguments_node_arguments_append(arguments->arguments, arguments->block);
arguments->block = (yp_node_t *) block;
}
} }
} }
yp_arguments_validate(parser, arguments);
return found; return found;
} }
@ -11706,7 +11735,7 @@ parse_expression_prefix(yp_parser_t *parser, yp_binding_power_t binding_power) {
call->block = arguments.block; call->block = arguments.block;
if (arguments.block != NULL) { if (arguments.block != NULL) {
call->base.location.end = arguments.block->base.location.end; call->base.location.end = arguments.block->location.end;
} else if (arguments.closing_loc.start == NULL) { } else if (arguments.closing_loc.start == NULL) {
if (arguments.arguments != NULL) { if (arguments.arguments != NULL) {
call->base.location.end = arguments.arguments->base.location.end; call->base.location.end = arguments.arguments->base.location.end;
@ -12125,7 +12154,6 @@ parse_expression_prefix(yp_parser_t *parser, yp_binding_power_t binding_power) {
yp_binding_power_t binding_power = yp_binding_powers[parser->current.type].left; yp_binding_power_t binding_power = yp_binding_powers[parser->current.type].left;
if (binding_power == YP_BINDING_POWER_UNSET || binding_power >= YP_BINDING_POWER_RANGE) { if (binding_power == YP_BINDING_POWER_UNSET || binding_power >= YP_BINDING_POWER_RANGE) {
arguments.arguments = yp_arguments_node_create(parser);
parse_arguments(parser, &arguments, false, YP_TOKEN_EOF); parse_arguments(parser, &arguments, false, YP_TOKEN_EOF);
} }
} }
@ -14083,11 +14111,8 @@ parse_expression_infix(yp_parser_t *parser, yp_node_t *node, yp_binding_power_t
if (!accept1(parser, YP_TOKEN_BRACKET_RIGHT)) { if (!accept1(parser, YP_TOKEN_BRACKET_RIGHT)) {
yp_accepts_block_stack_push(parser, true); yp_accepts_block_stack_push(parser, true);
arguments.arguments = yp_arguments_node_create(parser);
parse_arguments(parser, &arguments, false, YP_TOKEN_BRACKET_RIGHT); parse_arguments(parser, &arguments, false, YP_TOKEN_BRACKET_RIGHT);
yp_accepts_block_stack_pop(parser); yp_accepts_block_stack_pop(parser);
expect1(parser, YP_TOKEN_BRACKET_RIGHT, YP_ERR_EXPECT_RBRACKET); expect1(parser, YP_TOKEN_BRACKET_RIGHT, YP_ERR_EXPECT_RBRACKET);
} }
@ -14103,13 +14128,23 @@ parse_expression_infix(yp_parser_t *parser, yp_node_t *node, yp_binding_power_t
// If we're at the end of the arguments, we can now check if there is a // If we're at the end of the arguments, we can now check if there is a
// block node that starts with a {. If there is, then we can parse it and // block node that starts with a {. If there is, then we can parse it and
// add it to the arguments. // add it to the arguments.
yp_block_node_t *block = NULL;
if (accept1(parser, YP_TOKEN_BRACE_LEFT)) { if (accept1(parser, YP_TOKEN_BRACE_LEFT)) {
arguments.block = parse_block(parser); block = parse_block(parser);
yp_arguments_validate_block(parser, &arguments, block);
} else if (yp_accepts_block_stack_p(parser) && accept1(parser, YP_TOKEN_KEYWORD_DO)) { } else if (yp_accepts_block_stack_p(parser) && accept1(parser, YP_TOKEN_KEYWORD_DO)) {
arguments.block = parse_block(parser); block = parse_block(parser);
}
if (block != NULL) {
if (arguments.block != NULL) {
yp_diagnostic_list_append(&parser->error_list, block->base.location.start, block->base.location.end, YP_ERR_ARGUMENT_AFTER_BLOCK);
yp_arguments_node_arguments_append(arguments.arguments, arguments.block);
}
arguments.block = (yp_node_t *) block;
} }
yp_arguments_validate(parser, &arguments);
return (yp_node_t *) yp_call_node_aref_create(parser, node, &arguments); return (yp_node_t *) yp_call_node_aref_create(parser, node, &arguments);
} }
case YP_TOKEN_KEYWORD_IN: { case YP_TOKEN_KEYWORD_IN: {