diff options
Diffstat (limited to 'test/prism/snapshots/seattlerb')
489 files changed, 19200 insertions, 0 deletions
diff --git a/test/prism/snapshots/seattlerb/BEGIN.txt b/test/prism/snapshots/seattlerb/BEGIN.txt new file mode 100644 index 0000000000..3595e2a05c --- /dev/null +++ b/test/prism/snapshots/seattlerb/BEGIN.txt @@ -0,0 +1,14 @@ +@ ProgramNode (location: (1,0)-(1,12)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,12)) + └── body: (length: 1) + └── @ PreExecutionNode (location: (1,0)-(1,12)) + ├── statements: + │ @ StatementsNode (location: (1,8)-(1,10)) + │ └── body: (length: 1) + │ └── @ IntegerNode (location: (1,8)-(1,10)) + │ └── flags: decimal + ├── keyword_loc: (1,0)-(1,5) = "BEGIN" + ├── opening_loc: (1,6)-(1,7) = "{" + └── closing_loc: (1,11)-(1,12) = "}" diff --git a/test/prism/snapshots/seattlerb/TestRubyParserShared.txt b/test/prism/snapshots/seattlerb/TestRubyParserShared.txt new file mode 100644 index 0000000000..deb317781a --- /dev/null +++ b/test/prism/snapshots/seattlerb/TestRubyParserShared.txt @@ -0,0 +1,332 @@ +@ ProgramNode (location: (1,0)-(92,1)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(92,1)) + └── body: (length: 16) + ├── @ ArrayNode (location: (1,0)-(4,1)) + │ ├── elements: (length: 0) + │ ├── opening_loc: (1,0)-(1,3) = "%I[" + │ └── closing_loc: (4,0)-(4,1) = "]" + ├── @ ArrayNode (location: (6,0)-(9,1)) + │ ├── elements: (length: 2) + │ │ ├── @ SymbolNode (location: (7,0)-(7,5)) + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (7,0)-(7,5) = "line2" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "line2" + │ │ └── @ SymbolNode (location: (8,0)-(8,5)) + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (8,0)-(8,5) = "line3" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "line3" + │ ├── opening_loc: (6,0)-(6,3) = "%I[" + │ └── closing_loc: (9,0)-(9,1) = "]" + ├── @ ArrayNode (location: (11,0)-(14,1)) + │ ├── elements: (length: 0) + │ ├── opening_loc: (11,0)-(11,3) = "%W[" + │ └── closing_loc: (14,0)-(14,1) = "]" + ├── @ ArrayNode (location: (16,0)-(19,1)) + │ ├── elements: (length: 2) + │ │ ├── @ StringNode (location: (17,0)-(17,5)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (17,0)-(17,5) = "line2" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "line2" + │ │ └── @ StringNode (location: (18,0)-(18,5)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (18,0)-(18,5) = "line3" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "line3" + │ ├── opening_loc: (16,0)-(16,3) = "%W[" + │ └── closing_loc: (19,0)-(19,1) = "]" + ├── @ ArrayNode (location: (21,0)-(24,1)) + │ ├── elements: (length: 0) + │ ├── opening_loc: (21,0)-(21,3) = "%i[" + │ └── closing_loc: (24,0)-(24,1) = "]" + ├── @ ArrayNode (location: (26,0)-(29,1)) + │ ├── elements: (length: 2) + │ │ ├── @ SymbolNode (location: (27,0)-(27,5)) + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (27,0)-(27,5) = "line2" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "line2" + │ │ └── @ SymbolNode (location: (28,0)-(28,5)) + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (28,0)-(28,5) = "line3" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "line3" + │ ├── opening_loc: (26,0)-(26,3) = "%i[" + │ └── closing_loc: (29,0)-(29,1) = "]" + ├── @ RegularExpressionNode (location: (31,0)-(34,1)) + │ ├── opening_loc: (31,0)-(31,3) = "%r[" + │ ├── content_loc: (31,3)-(33,0) = "\n\n\n" + │ ├── closing_loc: (34,0)-(34,1) = "]" + │ ├── unescaped: "\n\n\n" + │ └── flags: ∅ + ├── @ ArrayNode (location: (36,0)-(39,1)) + │ ├── elements: (length: 0) + │ ├── opening_loc: (36,0)-(36,3) = "%w[" + │ └── closing_loc: (39,0)-(39,1) = "]" + ├── @ ArrayNode (location: (41,0)-(44,1)) + │ ├── elements: (length: 2) + │ │ ├── @ StringNode (location: (42,0)-(42,5)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (42,0)-(42,5) = "line2" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "line2" + │ │ └── @ StringNode (location: (43,0)-(43,5)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (43,0)-(43,5) = "line3" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "line3" + │ ├── opening_loc: (41,0)-(41,3) = "%w[" + │ └── closing_loc: (44,0)-(44,1) = "]" + ├── @ ArrayNode (location: (46,0)-(49,1)) + │ ├── elements: (length: 2) + │ │ ├── @ SymbolNode (location: (47,0)-(47,6)) + │ │ │ ├── opening_loc: (47,0)-(47,1) = ":" + │ │ │ ├── value_loc: (47,1)-(47,6) = "line2" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "line2" + │ │ └── @ SymbolNode (location: (48,0)-(48,6)) + │ │ ├── opening_loc: (48,0)-(48,1) = ":" + │ │ ├── value_loc: (48,1)-(48,6) = "line3" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "line3" + │ ├── opening_loc: (46,0)-(46,1) = "[" + │ └── closing_loc: (49,0)-(49,1) = "]" + ├── @ ClassNode (location: (51,0)-(56,3)) + │ ├── locals: [] + │ ├── class_keyword_loc: (51,0)-(51,5) = "class" + │ ├── constant_path: + │ │ @ ConstantReadNode (location: (51,6)-(51,7)) + │ │ └── name: :X + │ ├── inheritance_operator_loc: ∅ + │ ├── superclass: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (52,2)-(55,5)) + │ │ └── body: (length: 1) + │ │ └── @ DefNode (location: (52,2)-(55,5)) + │ │ ├── name: :y + │ │ ├── name_loc: (52,11)-(52,12) = "y" + │ │ ├── receiver: + │ │ │ @ SelfNode (location: (52,6)-(52,10)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (52,13)-(53,9)) + │ │ │ ├── requireds: (length: 2) + │ │ │ │ ├── @ RequiredParameterNode (location: (52,13)-(52,14)) + │ │ │ │ │ └── name: :a + │ │ │ │ └── @ RequiredParameterNode (location: (53,8)-(53,9)) + │ │ │ │ └── name: :b + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── body: + │ │ │ @ StatementsNode (location: (54,4)-(54,9)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (54,4)-(54,9)) + │ │ │ ├── receiver: + │ │ │ │ @ LocalVariableReadNode (location: (54,4)-(54,5)) + │ │ │ │ ├── name: :a + │ │ │ │ └── depth: 0 + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── message_loc: (54,6)-(54,7) = "+" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (54,8)-(54,9)) + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ LocalVariableReadNode (location: (54,8)-(54,9)) + │ │ │ │ ├── name: :b + │ │ │ │ └── depth: 0 + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── block: ∅ + │ │ │ ├── flags: ∅ + │ │ │ └── name: "+" + │ │ ├── locals: [:a, :b] + │ │ ├── def_keyword_loc: (52,2)-(52,5) = "def" + │ │ ├── operator_loc: (52,10)-(52,11) = "." + │ │ ├── lparen_loc: (52,12)-(52,13) = "(" + │ │ ├── rparen_loc: (53,9)-(53,10) = ")" + │ │ ├── equal_loc: ∅ + │ │ └── end_keyword_loc: (55,2)-(55,5) = "end" + │ ├── end_keyword_loc: (56,0)-(56,3) = "end" + │ └── name: :X + ├── @ ClassNode (location: (59,0)-(63,3)) + │ ├── locals: [] + │ ├── class_keyword_loc: (59,0)-(59,5) = "class" + │ ├── constant_path: + │ │ @ ConstantReadNode (location: (59,6)-(59,7)) + │ │ └── name: :X + │ ├── inheritance_operator_loc: ∅ + │ ├── superclass: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (60,2)-(62,5)) + │ │ └── body: (length: 1) + │ │ └── @ ClassNode (location: (60,2)-(62,5)) + │ │ ├── locals: [] + │ │ ├── class_keyword_loc: (60,2)-(60,7) = "class" + │ │ ├── constant_path: + │ │ │ @ ConstantReadNode (location: (60,8)-(60,9)) + │ │ │ └── name: :Y + │ │ ├── inheritance_operator_loc: ∅ + │ │ ├── superclass: ∅ + │ │ ├── body: + │ │ │ @ StatementsNode (location: (61,4)-(61,10)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ ConstantWriteNode (location: (61,4)-(61,10)) + │ │ │ ├── name: :Z + │ │ │ ├── name_loc: (61,4)-(61,5) = "Z" + │ │ │ ├── value: + │ │ │ │ @ IntegerNode (location: (61,8)-(61,10)) + │ │ │ │ └── flags: decimal + │ │ │ └── operator_loc: (61,6)-(61,7) = "=" + │ │ ├── end_keyword_loc: (62,2)-(62,5) = "end" + │ │ └── name: :Y + │ ├── end_keyword_loc: (63,0)-(63,3) = "end" + │ └── name: :X + ├── @ ClassNode (location: (66,0)-(71,3)) + │ ├── locals: [] + │ ├── class_keyword_loc: (66,0)-(66,5) = "class" + │ ├── constant_path: + │ │ @ ConstantReadNode (location: (66,6)-(66,7)) + │ │ └── name: :X + │ ├── inheritance_operator_loc: ∅ + │ ├── superclass: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (67,2)-(70,5)) + │ │ └── body: (length: 1) + │ │ └── @ DefNode (location: (67,2)-(70,5)) + │ │ ├── name: :y + │ │ ├── name_loc: (67,6)-(67,7) = "y" + │ │ ├── receiver: ∅ + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (67,8)-(68,9)) + │ │ │ ├── requireds: (length: 2) + │ │ │ │ ├── @ RequiredParameterNode (location: (67,8)-(67,9)) + │ │ │ │ │ └── name: :a + │ │ │ │ └── @ RequiredParameterNode (location: (68,8)-(68,9)) + │ │ │ │ └── name: :b + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── body: + │ │ │ @ StatementsNode (location: (69,4)-(69,9)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (69,4)-(69,9)) + │ │ │ ├── receiver: + │ │ │ │ @ LocalVariableReadNode (location: (69,4)-(69,5)) + │ │ │ │ ├── name: :a + │ │ │ │ └── depth: 0 + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── message_loc: (69,6)-(69,7) = "+" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (69,8)-(69,9)) + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ LocalVariableReadNode (location: (69,8)-(69,9)) + │ │ │ │ ├── name: :b + │ │ │ │ └── depth: 0 + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── block: ∅ + │ │ │ ├── flags: ∅ + │ │ │ └── name: "+" + │ │ ├── locals: [:a, :b] + │ │ ├── def_keyword_loc: (67,2)-(67,5) = "def" + │ │ ├── operator_loc: ∅ + │ │ ├── lparen_loc: (67,7)-(67,8) = "(" + │ │ ├── rparen_loc: (68,9)-(68,10) = ")" + │ │ ├── equal_loc: ∅ + │ │ └── end_keyword_loc: (70,2)-(70,5) = "end" + │ ├── end_keyword_loc: (71,0)-(71,3) = "end" + │ └── name: :X + ├── @ ModuleNode (location: (74,0)-(79,3)) + │ ├── locals: [] + │ ├── module_keyword_loc: (74,0)-(74,6) = "module" + │ ├── constant_path: + │ │ @ ConstantReadNode (location: (74,7)-(74,8)) + │ │ └── name: :X + │ ├── body: + │ │ @ StatementsNode (location: (75,2)-(78,3)) + │ │ └── body: (length: 1) + │ │ └── @ ConstantWriteNode (location: (75,2)-(78,3)) + │ │ ├── name: :X + │ │ ├── name_loc: (75,2)-(75,3) = "X" + │ │ ├── value: + │ │ │ @ ArrayNode (location: (75,6)-(78,3)) + │ │ │ ├── elements: (length: 2) + │ │ │ │ ├── @ SymbolNode (location: (76,4)-(76,10)) + │ │ │ │ │ ├── opening_loc: (76,4)-(76,5) = ":" + │ │ │ │ │ ├── value_loc: (76,5)-(76,10) = "line3" + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── unescaped: "line3" + │ │ │ │ └── @ SymbolNode (location: (77,4)-(77,10)) + │ │ │ │ ├── opening_loc: (77,4)-(77,5) = ":" + │ │ │ │ ├── value_loc: (77,5)-(77,10) = "line4" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "line4" + │ │ │ ├── opening_loc: (75,6)-(75,7) = "[" + │ │ │ └── closing_loc: (78,2)-(78,3) = "]" + │ │ └── operator_loc: (75,4)-(75,5) = "=" + │ ├── end_keyword_loc: (79,0)-(79,3) = "end" + │ └── name: :X + ├── @ ModuleNode (location: (82,0)-(86,3)) + │ ├── locals: [] + │ ├── module_keyword_loc: (82,0)-(82,6) = "module" + │ ├── constant_path: + │ │ @ ConstantReadNode (location: (82,7)-(82,8)) + │ │ └── name: :X + │ ├── body: + │ │ @ StatementsNode (location: (83,2)-(85,5)) + │ │ └── body: (length: 1) + │ │ └── @ ModuleNode (location: (83,2)-(85,5)) + │ │ ├── locals: [] + │ │ ├── module_keyword_loc: (83,2)-(83,8) = "module" + │ │ ├── constant_path: + │ │ │ @ ConstantReadNode (location: (83,9)-(83,10)) + │ │ │ └── name: :Y + │ │ ├── body: + │ │ │ @ StatementsNode (location: (84,4)-(84,10)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ ConstantWriteNode (location: (84,4)-(84,10)) + │ │ │ ├── name: :Z + │ │ │ ├── name_loc: (84,4)-(84,5) = "Z" + │ │ │ ├── value: + │ │ │ │ @ IntegerNode (location: (84,8)-(84,10)) + │ │ │ │ └── flags: decimal + │ │ │ └── operator_loc: (84,6)-(84,7) = "=" + │ │ ├── end_keyword_loc: (85,2)-(85,5) = "end" + │ │ └── name: :Y + │ ├── end_keyword_loc: (86,0)-(86,3) = "end" + │ └── name: :X + └── @ CallNode (location: (89,0)-(92,1)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (89,0)-(89,1) = "x" + ├── opening_loc: (89,1)-(89,2) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (90,0)-(91,6)) + │ └── arguments: (length: 2) + │ ├── @ SymbolNode (location: (90,0)-(90,6)) + │ │ ├── opening_loc: (90,0)-(90,1) = ":" + │ │ ├── value_loc: (90,1)-(90,6) = "line2" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "line2" + │ └── @ SymbolNode (location: (91,0)-(91,6)) + │ ├── opening_loc: (91,0)-(91,1) = ":" + │ ├── value_loc: (91,1)-(91,6) = "line3" + │ ├── closing_loc: ∅ + │ └── unescaped: "line3" + ├── closing_loc: (92,0)-(92,1) = ")" + ├── block: ∅ + ├── flags: ∅ + └── name: "x" diff --git a/test/prism/snapshots/seattlerb/__ENCODING__.txt b/test/prism/snapshots/seattlerb/__ENCODING__.txt new file mode 100644 index 0000000000..1b223bd8fe --- /dev/null +++ b/test/prism/snapshots/seattlerb/__ENCODING__.txt @@ -0,0 +1,6 @@ +@ ProgramNode (location: (1,0)-(1,12)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,12)) + └── body: (length: 1) + └── @ SourceEncodingNode (location: (1,0)-(1,12)) diff --git a/test/prism/snapshots/seattlerb/alias_gvar_backref.txt b/test/prism/snapshots/seattlerb/alias_gvar_backref.txt new file mode 100644 index 0000000000..4ba0469132 --- /dev/null +++ b/test/prism/snapshots/seattlerb/alias_gvar_backref.txt @@ -0,0 +1,12 @@ +@ ProgramNode (location: (1,0)-(1,15)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,15)) + └── body: (length: 1) + └── @ AliasGlobalVariableNode (location: (1,0)-(1,15)) + ├── new_name: + │ @ GlobalVariableReadNode (location: (1,6)-(1,12)) + │ └── name: :$MATCH + ├── old_name: + │ @ BackReferenceReadNode (location: (1,13)-(1,15)) + └── keyword_loc: (1,0)-(1,5) = "alias" diff --git a/test/prism/snapshots/seattlerb/alias_resword.txt b/test/prism/snapshots/seattlerb/alias_resword.txt new file mode 100644 index 0000000000..089819b528 --- /dev/null +++ b/test/prism/snapshots/seattlerb/alias_resword.txt @@ -0,0 +1,19 @@ +@ ProgramNode (location: (1,0)-(1,12)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,12)) + └── body: (length: 1) + └── @ AliasMethodNode (location: (1,0)-(1,12)) + ├── new_name: + │ @ SymbolNode (location: (1,6)-(1,8)) + │ ├── opening_loc: ∅ + │ ├── value_loc: (1,6)-(1,8) = "in" + │ ├── closing_loc: ∅ + │ └── unescaped: "in" + ├── old_name: + │ @ SymbolNode (location: (1,9)-(1,12)) + │ ├── opening_loc: ∅ + │ ├── value_loc: (1,9)-(1,12) = "out" + │ ├── closing_loc: ∅ + │ └── unescaped: "out" + └── keyword_loc: (1,0)-(1,5) = "alias" diff --git a/test/prism/snapshots/seattlerb/and_multi.txt b/test/prism/snapshots/seattlerb/and_multi.txt new file mode 100644 index 0000000000..575f75fe30 --- /dev/null +++ b/test/prism/snapshots/seattlerb/and_multi.txt @@ -0,0 +1,26 @@ +@ ProgramNode (location: (1,0)-(3,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,4)) + └── body: (length: 1) + └── @ AndNode (location: (1,0)-(3,4)) + ├── left: + │ @ AndNode (location: (1,0)-(2,9)) + │ ├── left: + │ │ @ TrueNode (location: (1,0)-(1,4)) + │ ├── right: + │ │ @ CallNode (location: (2,0)-(2,9)) + │ │ ├── receiver: + │ │ │ @ FalseNode (location: (2,4)-(2,9)) + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (2,0)-(2,3) = "not" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: ∅ + │ │ └── name: "!" + │ └── operator_loc: (1,5)-(1,8) = "and" + ├── right: + │ @ TrueNode (location: (3,0)-(3,4)) + └── operator_loc: (2,10)-(2,13) = "and" diff --git a/test/prism/snapshots/seattlerb/aref_args_assocs.txt b/test/prism/snapshots/seattlerb/aref_args_assocs.txt new file mode 100644 index 0000000000..02bfd74b50 --- /dev/null +++ b/test/prism/snapshots/seattlerb/aref_args_assocs.txt @@ -0,0 +1,19 @@ +@ ProgramNode (location: (1,0)-(1,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,8)) + └── body: (length: 1) + └── @ ArrayNode (location: (1,0)-(1,8)) + ├── elements: (length: 1) + │ └── @ KeywordHashNode (location: (1,1)-(1,7)) + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (1,1)-(1,7)) + │ ├── key: + │ │ @ IntegerNode (location: (1,1)-(1,2)) + │ │ └── flags: decimal + │ ├── value: + │ │ @ IntegerNode (location: (1,6)-(1,7)) + │ │ └── flags: decimal + │ └── operator_loc: (1,3)-(1,5) = "=>" + ├── opening_loc: (1,0)-(1,1) = "[" + └── closing_loc: (1,7)-(1,8) = "]" diff --git a/test/prism/snapshots/seattlerb/aref_args_lit_assocs.txt b/test/prism/snapshots/seattlerb/aref_args_lit_assocs.txt new file mode 100644 index 0000000000..bbe45dfc0e --- /dev/null +++ b/test/prism/snapshots/seattlerb/aref_args_lit_assocs.txt @@ -0,0 +1,21 @@ +@ ProgramNode (location: (1,0)-(1,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,11)) + └── body: (length: 1) + └── @ ArrayNode (location: (1,0)-(1,11)) + ├── elements: (length: 2) + │ ├── @ IntegerNode (location: (1,1)-(1,2)) + │ │ └── flags: decimal + │ └── @ KeywordHashNode (location: (1,4)-(1,10)) + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (1,4)-(1,10)) + │ ├── key: + │ │ @ IntegerNode (location: (1,4)-(1,5)) + │ │ └── flags: decimal + │ ├── value: + │ │ @ IntegerNode (location: (1,9)-(1,10)) + │ │ └── flags: decimal + │ └── operator_loc: (1,6)-(1,8) = "=>" + ├── opening_loc: (1,0)-(1,1) = "[" + └── closing_loc: (1,10)-(1,11) = "]" diff --git a/test/prism/snapshots/seattlerb/args_kw_block.txt b/test/prism/snapshots/seattlerb/args_kw_block.txt new file mode 100644 index 0000000000..3cbd2c1705 --- /dev/null +++ b/test/prism/snapshots/seattlerb/args_kw_block.txt @@ -0,0 +1,36 @@ +@ ProgramNode (location: (1,0)-(1,20)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,20)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,20)) + ├── name: :f + ├── name_loc: (1,4)-(1,5) = "f" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,6)-(1,14)) + │ ├── requireds: (length: 0) + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 1) + │ │ └── @ KeywordParameterNode (location: (1,6)-(1,10)) + │ │ ├── name: :a + │ │ ├── name_loc: (1,6)-(1,8) = "a:" + │ │ └── value: + │ │ @ IntegerNode (location: (1,9)-(1,10)) + │ │ └── flags: decimal + │ ├── keyword_rest: ∅ + │ └── block: + │ @ BlockParameterNode (location: (1,12)-(1,14)) + │ ├── name: :b + │ ├── name_loc: (1,13)-(1,14) = "b" + │ └── operator_loc: (1,12)-(1,13) = "&" + ├── body: ∅ + ├── locals: [:a, :b] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (1,5)-(1,6) = "(" + ├── rparen_loc: (1,14)-(1,15) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (1,17)-(1,20) = "end" diff --git a/test/prism/snapshots/seattlerb/array_line_breaks.txt b/test/prism/snapshots/seattlerb/array_line_breaks.txt new file mode 100644 index 0000000000..b6ebac1688 --- /dev/null +++ b/test/prism/snapshots/seattlerb/array_line_breaks.txt @@ -0,0 +1,23 @@ +@ ProgramNode (location: (1,0)-(4,1)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,1)) + └── body: (length: 2) + ├── @ ArrayNode (location: (1,0)-(3,4)) + │ ├── elements: (length: 2) + │ │ ├── @ StringNode (location: (2,0)-(2,3)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (2,0)-(2,1) = "'" + │ │ │ ├── content_loc: (2,1)-(2,2) = "a" + │ │ │ ├── closing_loc: (2,2)-(2,3) = "'" + │ │ │ └── unescaped: "a" + │ │ └── @ StringNode (location: (3,0)-(3,3)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (3,0)-(3,1) = "'" + │ │ ├── content_loc: (3,1)-(3,2) = "b" + │ │ ├── closing_loc: (3,2)-(3,3) = "'" + │ │ └── unescaped: "b" + │ ├── opening_loc: (1,0)-(1,1) = "[" + │ └── closing_loc: (3,3)-(3,4) = "]" + └── @ IntegerNode (location: (4,0)-(4,1)) + └── flags: decimal diff --git a/test/prism/snapshots/seattlerb/array_lits_trailing_calls.txt b/test/prism/snapshots/seattlerb/array_lits_trailing_calls.txt new file mode 100644 index 0000000000..ef31ed8bbc --- /dev/null +++ b/test/prism/snapshots/seattlerb/array_lits_trailing_calls.txt @@ -0,0 +1,33 @@ +@ ProgramNode (location: (1,0)-(3,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,4)) + └── body: (length: 2) + ├── @ CallNode (location: (1,0)-(1,6)) + │ ├── receiver: + │ │ @ ArrayNode (location: (1,0)-(1,4)) + │ │ ├── elements: (length: 0) + │ │ ├── opening_loc: (1,0)-(1,3) = "%w[" + │ │ └── closing_loc: (1,3)-(1,4) = "]" + │ ├── call_operator_loc: (1,4)-(1,5) = "." + │ ├── message_loc: (1,5)-(1,6) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "b" + └── @ CallNode (location: (3,0)-(3,4)) + ├── receiver: + │ @ ArrayNode (location: (3,0)-(3,2)) + │ ├── elements: (length: 0) + │ ├── opening_loc: (3,0)-(3,1) = "[" + │ └── closing_loc: (3,1)-(3,2) = "]" + ├── call_operator_loc: (3,2)-(3,3) = "." + ├── message_loc: (3,3)-(3,4) = "b" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "b" diff --git a/test/prism/snapshots/seattlerb/assoc__bare.txt b/test/prism/snapshots/seattlerb/assoc__bare.txt new file mode 100644 index 0000000000..1de54f236d --- /dev/null +++ b/test/prism/snapshots/seattlerb/assoc__bare.txt @@ -0,0 +1,30 @@ +@ ProgramNode (location: (1,0)-(1,6)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,6)) + └── body: (length: 1) + └── @ HashNode (location: (1,0)-(1,6)) + ├── opening_loc: (1,0)-(1,1) = "{" + ├── elements: (length: 1) + │ └── @ AssocNode (location: (1,2)-(1,4)) + │ ├── key: + │ │ @ SymbolNode (location: (1,2)-(1,4)) + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (1,2)-(1,3) = "y" + │ │ ├── closing_loc: (1,3)-(1,4) = ":" + │ │ └── unescaped: "y" + │ ├── value: + │ │ @ ImplicitNode (location: (1,2)-(1,4)) + │ │ └── value: + │ │ @ CallNode (location: (1,2)-(1,4)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,2)-(1,3) = "y" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: ∅ + │ │ └── name: "y" + │ └── operator_loc: ∅ + └── closing_loc: (1,5)-(1,6) = "}" diff --git a/test/prism/snapshots/seattlerb/assoc_label.txt b/test/prism/snapshots/seattlerb/assoc_label.txt new file mode 100644 index 0000000000..2e20f9fc29 --- /dev/null +++ b/test/prism/snapshots/seattlerb/assoc_label.txt @@ -0,0 +1,30 @@ +@ ProgramNode (location: (1,0)-(1,6)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,6)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,6)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: (1,1)-(1,2) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,5)) + │ └── arguments: (length: 1) + │ └── @ KeywordHashNode (location: (1,2)-(1,5)) + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (1,2)-(1,5)) + │ ├── key: + │ │ @ SymbolNode (location: (1,2)-(1,4)) + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (1,2)-(1,3) = "b" + │ │ ├── closing_loc: (1,3)-(1,4) = ":" + │ │ └── unescaped: "b" + │ ├── value: + │ │ @ IntegerNode (location: (1,4)-(1,5)) + │ │ └── flags: decimal + │ └── operator_loc: ∅ + ├── closing_loc: (1,5)-(1,6) = ")" + ├── block: ∅ + ├── flags: ∅ + └── name: "a" diff --git a/test/prism/snapshots/seattlerb/attr_asgn_colon_id.txt b/test/prism/snapshots/seattlerb/attr_asgn_colon_id.txt new file mode 100644 index 0000000000..5232738267 --- /dev/null +++ b/test/prism/snapshots/seattlerb/attr_asgn_colon_id.txt @@ -0,0 +1,21 @@ +@ ProgramNode (location: (1,0)-(1,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,8)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,8)) + ├── receiver: + │ @ ConstantReadNode (location: (1,0)-(1,1)) + │ └── name: :A + ├── call_operator_loc: (1,1)-(1,3) = "::" + ├── message_loc: (1,3)-(1,4) = "b" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,7)-(1,8)) + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,7)-(1,8)) + │ └── flags: decimal + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "b=" diff --git a/test/prism/snapshots/seattlerb/attrasgn_array_arg.txt b/test/prism/snapshots/seattlerb/attrasgn_array_arg.txt new file mode 100644 index 0000000000..5d30d718c9 --- /dev/null +++ b/test/prism/snapshots/seattlerb/attrasgn_array_arg.txt @@ -0,0 +1,37 @@ +@ ProgramNode (location: (1,0)-(1,13)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,13)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,13)) + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "a" + ├── call_operator_loc: ∅ + ├── message_loc: (1,1)-(1,9) = "[[1, 2]]" + ├── opening_loc: (1,1)-(1,2) = "[" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,13)) + │ └── arguments: (length: 2) + │ ├── @ ArrayNode (location: (1,2)-(1,8)) + │ │ ├── elements: (length: 2) + │ │ │ ├── @ IntegerNode (location: (1,3)-(1,4)) + │ │ │ │ └── flags: decimal + │ │ │ └── @ IntegerNode (location: (1,6)-(1,7)) + │ │ │ └── flags: decimal + │ │ ├── opening_loc: (1,2)-(1,3) = "[" + │ │ └── closing_loc: (1,7)-(1,8) = "]" + │ └── @ IntegerNode (location: (1,12)-(1,13)) + │ └── flags: decimal + ├── closing_loc: (1,8)-(1,9) = "]" + ├── block: ∅ + ├── flags: ∅ + └── name: "[]=" diff --git a/test/prism/snapshots/seattlerb/attrasgn_array_lhs.txt b/test/prism/snapshots/seattlerb/attrasgn_array_lhs.txt new file mode 100644 index 0000000000..741e1cba09 --- /dev/null +++ b/test/prism/snapshots/seattlerb/attrasgn_array_lhs.txt @@ -0,0 +1,76 @@ +@ ProgramNode (location: (1,0)-(1,42)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,42)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,42)) + ├── receiver: + │ @ ArrayNode (location: (1,0)-(1,12)) + │ ├── elements: (length: 4) + │ │ ├── @ IntegerNode (location: (1,1)-(1,2)) + │ │ │ └── flags: decimal + │ │ ├── @ IntegerNode (location: (1,4)-(1,5)) + │ │ │ └── flags: decimal + │ │ ├── @ IntegerNode (location: (1,7)-(1,8)) + │ │ │ └── flags: decimal + │ │ └── @ IntegerNode (location: (1,10)-(1,11)) + │ │ └── flags: decimal + │ ├── opening_loc: (1,0)-(1,1) = "[" + │ └── closing_loc: (1,11)-(1,12) = "]" + ├── call_operator_loc: ∅ + ├── message_loc: (1,12)-(1,24) = "[from .. to]" + ├── opening_loc: (1,12)-(1,13) = "[" + ├── arguments: + │ @ ArgumentsNode (location: (1,13)-(1,42)) + │ └── arguments: (length: 2) + │ ├── @ RangeNode (location: (1,13)-(1,23)) + │ │ ├── left: + │ │ │ @ CallNode (location: (1,13)-(1,17)) + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── message_loc: (1,13)-(1,17) = "from" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── block: ∅ + │ │ │ ├── flags: variable_call + │ │ │ └── name: "from" + │ │ ├── right: + │ │ │ @ CallNode (location: (1,21)-(1,23)) + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── message_loc: (1,21)-(1,23) = "to" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── block: ∅ + │ │ │ ├── flags: variable_call + │ │ │ └── name: "to" + │ │ ├── operator_loc: (1,18)-(1,20) = ".." + │ │ └── flags: ∅ + │ └── @ ArrayNode (location: (1,27)-(1,42)) + │ ├── elements: (length: 3) + │ │ ├── @ StringNode (location: (1,28)-(1,31)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (1,28)-(1,29) = "\"" + │ │ │ ├── content_loc: (1,29)-(1,30) = "a" + │ │ │ ├── closing_loc: (1,30)-(1,31) = "\"" + │ │ │ └── unescaped: "a" + │ │ ├── @ StringNode (location: (1,33)-(1,36)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (1,33)-(1,34) = "\"" + │ │ │ ├── content_loc: (1,34)-(1,35) = "b" + │ │ │ ├── closing_loc: (1,35)-(1,36) = "\"" + │ │ │ └── unescaped: "b" + │ │ └── @ StringNode (location: (1,38)-(1,41)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (1,38)-(1,39) = "\"" + │ │ ├── content_loc: (1,39)-(1,40) = "c" + │ │ ├── closing_loc: (1,40)-(1,41) = "\"" + │ │ └── unescaped: "c" + │ ├── opening_loc: (1,27)-(1,28) = "[" + │ └── closing_loc: (1,41)-(1,42) = "]" + ├── closing_loc: (1,23)-(1,24) = "]" + ├── block: ∅ + ├── flags: ∅ + └── name: "[]=" diff --git a/test/prism/snapshots/seattlerb/attrasgn_primary_dot_constant.txt b/test/prism/snapshots/seattlerb/attrasgn_primary_dot_constant.txt new file mode 100644 index 0000000000..73b65fc636 --- /dev/null +++ b/test/prism/snapshots/seattlerb/attrasgn_primary_dot_constant.txt @@ -0,0 +1,29 @@ +@ ProgramNode (location: (1,0)-(1,7)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,7)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,7)) + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "a" + ├── call_operator_loc: (1,1)-(1,2) = "." + ├── message_loc: (1,2)-(1,3) = "B" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,6)-(1,7)) + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,6)-(1,7)) + │ └── flags: decimal + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "B=" diff --git a/test/prism/snapshots/seattlerb/backticks_interpolation_line.txt b/test/prism/snapshots/seattlerb/backticks_interpolation_line.txt new file mode 100644 index 0000000000..d56a532bc4 --- /dev/null +++ b/test/prism/snapshots/seattlerb/backticks_interpolation_line.txt @@ -0,0 +1,37 @@ +@ ProgramNode (location: (1,0)-(1,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,8)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,8)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "x" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,8)) + │ └── arguments: (length: 1) + │ └── @ InterpolatedXStringNode (location: (1,2)-(1,8)) + │ ├── opening_loc: (1,2)-(1,3) = "`" + │ ├── parts: (length: 1) + │ │ └── @ EmbeddedStatementsNode (location: (1,3)-(1,7)) + │ │ ├── opening_loc: (1,3)-(1,5) = "\#{" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (1,5)-(1,6)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (1,5)-(1,6)) + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── message_loc: (1,5)-(1,6) = "y" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── block: ∅ + │ │ │ ├── flags: variable_call + │ │ │ └── name: "y" + │ │ └── closing_loc: (1,6)-(1,7) = "}" + │ └── closing_loc: (1,7)-(1,8) = "`" + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "x" diff --git a/test/prism/snapshots/seattlerb/bang_eq.txt b/test/prism/snapshots/seattlerb/bang_eq.txt new file mode 100644 index 0000000000..b2fc7b7bb7 --- /dev/null +++ b/test/prism/snapshots/seattlerb/bang_eq.txt @@ -0,0 +1,21 @@ +@ ProgramNode (location: (1,0)-(1,6)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,6)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,6)) + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ └── flags: decimal + ├── call_operator_loc: ∅ + ├── message_loc: (1,2)-(1,4) = "!=" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,5)-(1,6)) + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,5)-(1,6)) + │ └── flags: decimal + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "!=" diff --git a/test/prism/snapshots/seattlerb/bdot2.txt b/test/prism/snapshots/seattlerb/bdot2.txt new file mode 100644 index 0000000000..2fc74e52a7 --- /dev/null +++ b/test/prism/snapshots/seattlerb/bdot2.txt @@ -0,0 +1,37 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 3) + ├── @ RangeNode (location: (1,0)-(1,4)) + │ ├── left: ∅ + │ ├── right: + │ │ @ IntegerNode (location: (1,2)-(1,4)) + │ │ └── flags: decimal + │ ├── operator_loc: (1,0)-(1,2) = ".." + │ └── flags: ∅ + ├── @ RangeNode (location: (2,2)-(2,5)) + │ ├── left: ∅ + │ ├── right: + │ │ @ CallNode (location: (2,4)-(2,5)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (2,4)-(2,5) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "a" + │ ├── operator_loc: (2,2)-(2,4) = ".." + │ └── flags: ∅ + └── @ CallNode (location: (3,2)-(3,3)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (3,2)-(3,3) = "c" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: variable_call + └── name: "c" diff --git a/test/prism/snapshots/seattlerb/bdot3.txt b/test/prism/snapshots/seattlerb/bdot3.txt new file mode 100644 index 0000000000..f282688f85 --- /dev/null +++ b/test/prism/snapshots/seattlerb/bdot3.txt @@ -0,0 +1,37 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 3) + ├── @ RangeNode (location: (1,0)-(1,5)) + │ ├── left: ∅ + │ ├── right: + │ │ @ IntegerNode (location: (1,3)-(1,5)) + │ │ └── flags: decimal + │ ├── operator_loc: (1,0)-(1,3) = "..." + │ └── flags: exclude_end + ├── @ RangeNode (location: (2,2)-(2,6)) + │ ├── left: ∅ + │ ├── right: + │ │ @ CallNode (location: (2,5)-(2,6)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (2,5)-(2,6) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "a" + │ ├── operator_loc: (2,2)-(2,5) = "..." + │ └── flags: exclude_end + └── @ CallNode (location: (3,2)-(3,3)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (3,2)-(3,3) = "c" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: variable_call + └── name: "c" diff --git a/test/prism/snapshots/seattlerb/begin_ensure_no_bodies.txt b/test/prism/snapshots/seattlerb/begin_ensure_no_bodies.txt new file mode 100644 index 0000000000..e1698d0bae --- /dev/null +++ b/test/prism/snapshots/seattlerb/begin_ensure_no_bodies.txt @@ -0,0 +1,16 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ BeginNode (location: (1,0)-(3,3)) + ├── begin_keyword_loc: (1,0)-(1,5) = "begin" + ├── statements: ∅ + ├── rescue_clause: ∅ + ├── else_clause: ∅ + ├── ensure_clause: + │ @ EnsureNode (location: (2,0)-(3,3)) + │ ├── ensure_keyword_loc: (2,0)-(2,6) = "ensure" + │ ├── statements: ∅ + │ └── end_keyword_loc: (3,0)-(3,3) = "end" + └── end_keyword_loc: (3,0)-(3,3) = "end" diff --git a/test/prism/snapshots/seattlerb/begin_rescue_else_ensure_bodies.txt b/test/prism/snapshots/seattlerb/begin_rescue_else_ensure_bodies.txt new file mode 100644 index 0000000000..686fa100f1 --- /dev/null +++ b/test/prism/snapshots/seattlerb/begin_rescue_else_ensure_bodies.txt @@ -0,0 +1,43 @@ +@ ProgramNode (location: (1,0)-(9,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(9,3)) + └── body: (length: 1) + └── @ BeginNode (location: (1,0)-(9,3)) + ├── begin_keyword_loc: (1,0)-(1,5) = "begin" + ├── statements: + │ @ StatementsNode (location: (2,2)-(2,3)) + │ └── body: (length: 1) + │ └── @ IntegerNode (location: (2,2)-(2,3)) + │ └── flags: decimal + ├── rescue_clause: + │ @ RescueNode (location: (3,0)-(4,3)) + │ ├── keyword_loc: (3,0)-(3,6) = "rescue" + │ ├── exceptions: (length: 0) + │ ├── operator_loc: ∅ + │ ├── reference: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (4,2)-(4,3)) + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (4,2)-(4,3)) + │ │ └── flags: decimal + │ └── consequent: ∅ + ├── else_clause: + │ @ ElseNode (location: (5,0)-(7,6)) + │ ├── else_keyword_loc: (5,0)-(5,4) = "else" + │ ├── statements: + │ │ @ StatementsNode (location: (6,2)-(6,3)) + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (6,2)-(6,3)) + │ │ └── flags: decimal + │ └── end_keyword_loc: (7,0)-(7,6) = "ensure" + ├── ensure_clause: + │ @ EnsureNode (location: (7,0)-(9,3)) + │ ├── ensure_keyword_loc: (7,0)-(7,6) = "ensure" + │ ├── statements: + │ │ @ StatementsNode (location: (8,2)-(8,3)) + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (8,2)-(8,3)) + │ │ └── flags: decimal + │ └── end_keyword_loc: (9,0)-(9,3) = "end" + └── end_keyword_loc: (9,0)-(9,3) = "end" diff --git a/test/prism/snapshots/seattlerb/begin_rescue_else_ensure_no_bodies.txt b/test/prism/snapshots/seattlerb/begin_rescue_else_ensure_no_bodies.txt new file mode 100644 index 0000000000..02e1f097ac --- /dev/null +++ b/test/prism/snapshots/seattlerb/begin_rescue_else_ensure_no_bodies.txt @@ -0,0 +1,27 @@ +@ ProgramNode (location: (1,0)-(9,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(9,3)) + └── body: (length: 1) + └── @ BeginNode (location: (1,0)-(9,3)) + ├── begin_keyword_loc: (1,0)-(1,5) = "begin" + ├── statements: ∅ + ├── rescue_clause: + │ @ RescueNode (location: (3,0)-(3,6)) + │ ├── keyword_loc: (3,0)-(3,6) = "rescue" + │ ├── exceptions: (length: 0) + │ ├── operator_loc: ∅ + │ ├── reference: ∅ + │ ├── statements: ∅ + │ └── consequent: ∅ + ├── else_clause: + │ @ ElseNode (location: (5,0)-(7,6)) + │ ├── else_keyword_loc: (5,0)-(5,4) = "else" + │ ├── statements: ∅ + │ └── end_keyword_loc: (7,0)-(7,6) = "ensure" + ├── ensure_clause: + │ @ EnsureNode (location: (7,0)-(9,3)) + │ ├── ensure_keyword_loc: (7,0)-(7,6) = "ensure" + │ ├── statements: ∅ + │ └── end_keyword_loc: (9,0)-(9,3) = "end" + └── end_keyword_loc: (9,0)-(9,3) = "end" diff --git a/test/prism/snapshots/seattlerb/begin_rescue_ensure_no_bodies.txt b/test/prism/snapshots/seattlerb/begin_rescue_ensure_no_bodies.txt new file mode 100644 index 0000000000..b36fe5c1fe --- /dev/null +++ b/test/prism/snapshots/seattlerb/begin_rescue_ensure_no_bodies.txt @@ -0,0 +1,23 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ BeginNode (location: (1,0)-(4,3)) + ├── begin_keyword_loc: (1,0)-(1,5) = "begin" + ├── statements: ∅ + ├── rescue_clause: + │ @ RescueNode (location: (2,0)-(2,6)) + │ ├── keyword_loc: (2,0)-(2,6) = "rescue" + │ ├── exceptions: (length: 0) + │ ├── operator_loc: ∅ + │ ├── reference: ∅ + │ ├── statements: ∅ + │ └── consequent: ∅ + ├── else_clause: ∅ + ├── ensure_clause: + │ @ EnsureNode (location: (3,0)-(4,3)) + │ ├── ensure_keyword_loc: (3,0)-(3,6) = "ensure" + │ ├── statements: ∅ + │ └── end_keyword_loc: (4,0)-(4,3) = "end" + └── end_keyword_loc: (4,0)-(4,3) = "end" diff --git a/test/prism/snapshots/seattlerb/block_arg__bare.txt b/test/prism/snapshots/seattlerb/block_arg__bare.txt new file mode 100644 index 0000000000..fb9b0bdd0d --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_arg__bare.txt @@ -0,0 +1,30 @@ +@ ProgramNode (location: (1,0)-(1,13)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,13)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,13)) + ├── name: :x + ├── name_loc: (1,4)-(1,5) = "x" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,6)-(1,7)) + │ ├── requireds: (length: 0) + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 0) + │ ├── keyword_rest: ∅ + │ └── block: + │ @ BlockParameterNode (location: (1,6)-(1,7)) + │ ├── name: nil + │ ├── name_loc: ∅ + │ └── operator_loc: (1,6)-(1,7) = "&" + ├── body: ∅ + ├── locals: [:&] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (1,5)-(1,6) = "(" + ├── rparen_loc: (1,7)-(1,8) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (1,10)-(1,13) = "end" diff --git a/test/prism/snapshots/seattlerb/block_arg_kwsplat.txt b/test/prism/snapshots/seattlerb/block_arg_kwsplat.txt new file mode 100644 index 0000000000..c3041819bf --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_arg_kwsplat.txt @@ -0,0 +1,38 @@ +@ ProgramNode (location: (1,0)-(1,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,11)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,11)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,11)) + │ ├── locals: [:b] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,9)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,8)) + │ │ │ ├── requireds: (length: 0) + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: + │ │ │ │ @ KeywordRestParameterNode (location: (1,5)-(1,8)) + │ │ │ │ ├── name: :b + │ │ │ │ ├── name_loc: (1,7)-(1,8) = "b" + │ │ │ │ └── operator_loc: (1,5)-(1,7) = "**" + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,8)-(1,9) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,10)-(1,11) = "}" + ├── flags: ∅ + └── name: "a" diff --git a/test/prism/snapshots/seattlerb/block_arg_opt_arg_block.txt b/test/prism/snapshots/seattlerb/block_arg_opt_arg_block.txt new file mode 100644 index 0000000000..d1382f9a53 --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_arg_opt_arg_block.txt @@ -0,0 +1,49 @@ +@ ProgramNode (location: (1,0)-(1,21)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,21)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,21)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,21)) + │ ├── locals: [:b, :c, :d, :e] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,19)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,18)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ │ └── name: :b + │ │ │ ├── optionals: (length: 1) + │ │ │ │ └── @ OptionalParameterNode (location: (1,8)-(1,11)) + │ │ │ │ ├── name: :c + │ │ │ │ ├── name_loc: (1,8)-(1,9) = "c" + │ │ │ │ ├── operator_loc: (1,9)-(1,10) = "=" + │ │ │ │ └── value: + │ │ │ │ @ IntegerNode (location: (1,10)-(1,11)) + │ │ │ │ └── flags: decimal + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,13)-(1,14)) + │ │ │ │ └── name: :d + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: + │ │ │ @ BlockParameterNode (location: (1,16)-(1,18)) + │ │ │ ├── name: :e + │ │ │ ├── name_loc: (1,17)-(1,18) = "e" + │ │ │ └── operator_loc: (1,16)-(1,17) = "&" + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,18)-(1,19) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,20)-(1,21) = "}" + ├── flags: ∅ + └── name: "a" diff --git a/test/prism/snapshots/seattlerb/block_arg_opt_splat.txt b/test/prism/snapshots/seattlerb/block_arg_opt_splat.txt new file mode 100644 index 0000000000..1119f827dd --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_arg_opt_splat.txt @@ -0,0 +1,47 @@ +@ ProgramNode (location: (1,0)-(1,20)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,20)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,20)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,20)) + │ ├── locals: [:b, :c, :d] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,18)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,17)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ │ └── name: :b + │ │ │ ├── optionals: (length: 1) + │ │ │ │ └── @ OptionalParameterNode (location: (1,8)-(1,13)) + │ │ │ │ ├── name: :c + │ │ │ │ ├── name_loc: (1,8)-(1,9) = "c" + │ │ │ │ ├── operator_loc: (1,10)-(1,11) = "=" + │ │ │ │ └── value: + │ │ │ │ @ IntegerNode (location: (1,12)-(1,13)) + │ │ │ │ └── flags: decimal + │ │ │ ├── rest: + │ │ │ │ @ RestParameterNode (location: (1,15)-(1,17)) + │ │ │ │ ├── name: :d + │ │ │ │ ├── name_loc: (1,16)-(1,17) = "d" + │ │ │ │ └── operator_loc: (1,15)-(1,16) = "*" + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,17)-(1,18) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,19)-(1,20) = "}" + ├── flags: ∅ + └── name: "a" diff --git a/test/prism/snapshots/seattlerb/block_arg_opt_splat_arg_block_omfg.txt b/test/prism/snapshots/seattlerb/block_arg_opt_splat_arg_block_omfg.txt new file mode 100644 index 0000000000..5bb2de2a16 --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_arg_opt_splat_arg_block_omfg.txt @@ -0,0 +1,53 @@ +@ ProgramNode (location: (1,0)-(1,25)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,25)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,25)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,25)) + │ ├── locals: [:b, :c, :d, :e, :f] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,23)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,22)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ │ └── name: :b + │ │ │ ├── optionals: (length: 1) + │ │ │ │ └── @ OptionalParameterNode (location: (1,8)-(1,11)) + │ │ │ │ ├── name: :c + │ │ │ │ ├── name_loc: (1,8)-(1,9) = "c" + │ │ │ │ ├── operator_loc: (1,9)-(1,10) = "=" + │ │ │ │ └── value: + │ │ │ │ @ IntegerNode (location: (1,10)-(1,11)) + │ │ │ │ └── flags: decimal + │ │ │ ├── rest: + │ │ │ │ @ RestParameterNode (location: (1,13)-(1,15)) + │ │ │ │ ├── name: :d + │ │ │ │ ├── name_loc: (1,14)-(1,15) = "d" + │ │ │ │ └── operator_loc: (1,13)-(1,14) = "*" + │ │ │ ├── posts: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,17)-(1,18)) + │ │ │ │ └── name: :e + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: + │ │ │ @ BlockParameterNode (location: (1,20)-(1,22)) + │ │ │ ├── name: :f + │ │ │ ├── name_loc: (1,21)-(1,22) = "f" + │ │ │ └── operator_loc: (1,20)-(1,21) = "&" + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,22)-(1,23) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,24)-(1,25) = "}" + ├── flags: ∅ + └── name: "a" diff --git a/test/prism/snapshots/seattlerb/block_arg_optional.txt b/test/prism/snapshots/seattlerb/block_arg_optional.txt new file mode 100644 index 0000000000..8b29ce6e9f --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_arg_optional.txt @@ -0,0 +1,41 @@ +@ ProgramNode (location: (1,0)-(1,13)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,13)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,13)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,13)) + │ ├── locals: [:b] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,11)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,10)) + │ │ │ ├── requireds: (length: 0) + │ │ │ ├── optionals: (length: 1) + │ │ │ │ └── @ OptionalParameterNode (location: (1,5)-(1,10)) + │ │ │ │ ├── name: :b + │ │ │ │ ├── name_loc: (1,5)-(1,6) = "b" + │ │ │ │ ├── operator_loc: (1,7)-(1,8) = "=" + │ │ │ │ └── value: + │ │ │ │ @ IntegerNode (location: (1,9)-(1,10)) + │ │ │ │ └── flags: decimal + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,10)-(1,11) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,12)-(1,13) = "}" + ├── flags: ∅ + └── name: "a" diff --git a/test/prism/snapshots/seattlerb/block_arg_scope.txt b/test/prism/snapshots/seattlerb/block_arg_scope.txt new file mode 100644 index 0000000000..e70f2f4ce7 --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_arg_scope.txt @@ -0,0 +1,38 @@ +@ ProgramNode (location: (1,0)-(1,12)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,12)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,12)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,12)) + │ ├── locals: [:b, :c] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,10)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,6)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ │ └── name: :b + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 1) + │ │ │ └── @ BlockLocalVariableNode (location: (1,8)-(1,9)) + │ │ │ └── name: :c + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,9)-(1,10) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,11)-(1,12) = "}" + ├── flags: ∅ + └── name: "a" diff --git a/test/prism/snapshots/seattlerb/block_arg_scope2.txt b/test/prism/snapshots/seattlerb/block_arg_scope2.txt new file mode 100644 index 0000000000..99af39a109 --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_arg_scope2.txt @@ -0,0 +1,40 @@ +@ ProgramNode (location: (1,0)-(1,14)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,14)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,14)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,14)) + │ ├── locals: [:b, :c, :d] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,3)-(1,12)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,4)-(1,5)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,4)-(1,5)) + │ │ │ │ └── name: :b + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 2) + │ │ │ ├── @ BlockLocalVariableNode (location: (1,7)-(1,8)) + │ │ │ │ └── name: :c + │ │ │ └── @ BlockLocalVariableNode (location: (1,10)-(1,11)) + │ │ │ └── name: :d + │ │ ├── opening_loc: (1,3)-(1,4) = "|" + │ │ └── closing_loc: (1,11)-(1,12) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,13)-(1,14) = "}" + ├── flags: ∅ + └── name: "a" diff --git a/test/prism/snapshots/seattlerb/block_arg_splat_arg.txt b/test/prism/snapshots/seattlerb/block_arg_splat_arg.txt new file mode 100644 index 0000000000..a3a194f30b --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_arg_splat_arg.txt @@ -0,0 +1,42 @@ +@ ProgramNode (location: (1,0)-(1,16)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,16)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,16)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,16)) + │ ├── locals: [:b, :c, :d] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,14)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,13)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ │ └── name: :b + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: + │ │ │ │ @ RestParameterNode (location: (1,8)-(1,10)) + │ │ │ │ ├── name: :c + │ │ │ │ ├── name_loc: (1,9)-(1,10) = "c" + │ │ │ │ └── operator_loc: (1,8)-(1,9) = "*" + │ │ │ ├── posts: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,12)-(1,13)) + │ │ │ │ └── name: :d + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,13)-(1,14) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,15)-(1,16) = "}" + ├── flags: ∅ + └── name: "a" diff --git a/test/prism/snapshots/seattlerb/block_args_kwargs.txt b/test/prism/snapshots/seattlerb/block_args_kwargs.txt new file mode 100644 index 0000000000..4d2255fd66 --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_args_kwargs.txt @@ -0,0 +1,43 @@ +@ ProgramNode (location: (1,0)-(1,23)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,23)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,23)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,23)) + │ ├── locals: [:kwargs] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,14)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,13)) + │ │ │ ├── requireds: (length: 0) + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: + │ │ │ │ @ KeywordRestParameterNode (location: (1,5)-(1,13)) + │ │ │ │ ├── name: :kwargs + │ │ │ │ ├── name_loc: (1,7)-(1,13) = "kwargs" + │ │ │ │ └── operator_loc: (1,5)-(1,7) = "**" + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,13)-(1,14) = "|" + │ ├── body: + │ │ @ StatementsNode (location: (1,15)-(1,21)) + │ │ └── body: (length: 1) + │ │ └── @ LocalVariableReadNode (location: (1,15)-(1,21)) + │ │ ├── name: :kwargs + │ │ └── depth: 0 + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,22)-(1,23) = "}" + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/block_args_no_kwargs.txt b/test/prism/snapshots/seattlerb/block_args_no_kwargs.txt new file mode 100644 index 0000000000..b8542f2ab7 --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_args_no_kwargs.txt @@ -0,0 +1,37 @@ +@ ProgramNode (location: (1,0)-(1,13)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,13)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,13)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,13)) + │ ├── locals: [] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,11)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,10)) + │ │ │ ├── requireds: (length: 0) + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: + │ │ │ │ @ NoKeywordsParameterNode (location: (1,5)-(1,10)) + │ │ │ │ ├── operator_loc: (1,5)-(1,7) = "**" + │ │ │ │ └── keyword_loc: (1,7)-(1,10) = "nil" + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,10)-(1,11) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,12)-(1,13) = "}" + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/block_args_opt1.txt b/test/prism/snapshots/seattlerb/block_args_opt1.txt new file mode 100644 index 0000000000..7e022ab1ea --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_args_opt1.txt @@ -0,0 +1,55 @@ +@ ProgramNode (location: (1,0)-(1,24)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,24)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,24)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,24)) + │ ├── locals: [:a, :b] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,15)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,14)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ │ └── name: :a + │ │ │ ├── optionals: (length: 1) + │ │ │ │ └── @ OptionalParameterNode (location: (1,8)-(1,14)) + │ │ │ │ ├── name: :b + │ │ │ │ ├── name_loc: (1,8)-(1,9) = "b" + │ │ │ │ ├── operator_loc: (1,10)-(1,11) = "=" + │ │ │ │ └── value: + │ │ │ │ @ IntegerNode (location: (1,12)-(1,14)) + │ │ │ │ └── flags: decimal + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,14)-(1,15) = "|" + │ ├── body: + │ │ @ StatementsNode (location: (1,16)-(1,22)) + │ │ └── body: (length: 1) + │ │ └── @ ArrayNode (location: (1,16)-(1,22)) + │ │ ├── elements: (length: 2) + │ │ │ ├── @ LocalVariableReadNode (location: (1,17)-(1,18)) + │ │ │ │ ├── name: :a + │ │ │ │ └── depth: 0 + │ │ │ └── @ LocalVariableReadNode (location: (1,20)-(1,21)) + │ │ │ ├── name: :b + │ │ │ └── depth: 0 + │ │ ├── opening_loc: (1,16)-(1,17) = "[" + │ │ └── closing_loc: (1,21)-(1,22) = "]" + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,23)-(1,24) = "}" + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/block_args_opt2.txt b/test/prism/snapshots/seattlerb/block_args_opt2.txt new file mode 100644 index 0000000000..4a5b0ef03d --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_args_opt2.txt @@ -0,0 +1,48 @@ +@ ProgramNode (location: (1,0)-(1,18)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,18)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,18)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,18)) + │ ├── locals: [:b, :c] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,16)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,6)-(1,14)) + │ │ │ ├── requireds: (length: 0) + │ │ │ ├── optionals: (length: 2) + │ │ │ │ ├── @ OptionalParameterNode (location: (1,6)-(1,9)) + │ │ │ │ │ ├── name: :b + │ │ │ │ │ ├── name_loc: (1,6)-(1,7) = "b" + │ │ │ │ │ ├── operator_loc: (1,7)-(1,8) = "=" + │ │ │ │ │ └── value: + │ │ │ │ │ @ IntegerNode (location: (1,8)-(1,9)) + │ │ │ │ │ └── flags: decimal + │ │ │ │ └── @ OptionalParameterNode (location: (1,11)-(1,14)) + │ │ │ │ ├── name: :c + │ │ │ │ ├── name_loc: (1,11)-(1,12) = "c" + │ │ │ │ ├── operator_loc: (1,12)-(1,13) = "=" + │ │ │ │ └── value: + │ │ │ │ @ IntegerNode (location: (1,13)-(1,14)) + │ │ │ │ └── flags: decimal + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,15)-(1,16) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,17)-(1,18) = "}" + ├── flags: ∅ + └── name: "a" diff --git a/test/prism/snapshots/seattlerb/block_args_opt2_2.txt b/test/prism/snapshots/seattlerb/block_args_opt2_2.txt new file mode 100644 index 0000000000..da706e2306 --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_args_opt2_2.txt @@ -0,0 +1,65 @@ +@ ProgramNode (location: (1,0)-(1,35)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,35)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,35)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,35)) + │ ├── locals: [:a, :b, :c] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,23)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,22)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ │ └── name: :a + │ │ │ ├── optionals: (length: 2) + │ │ │ │ ├── @ OptionalParameterNode (location: (1,8)-(1,14)) + │ │ │ │ │ ├── name: :b + │ │ │ │ │ ├── name_loc: (1,8)-(1,9) = "b" + │ │ │ │ │ ├── operator_loc: (1,10)-(1,11) = "=" + │ │ │ │ │ └── value: + │ │ │ │ │ @ IntegerNode (location: (1,12)-(1,14)) + │ │ │ │ │ └── flags: decimal + │ │ │ │ └── @ OptionalParameterNode (location: (1,16)-(1,22)) + │ │ │ │ ├── name: :c + │ │ │ │ ├── name_loc: (1,16)-(1,17) = "c" + │ │ │ │ ├── operator_loc: (1,18)-(1,19) = "=" + │ │ │ │ └── value: + │ │ │ │ @ IntegerNode (location: (1,20)-(1,22)) + │ │ │ │ └── flags: decimal + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,22)-(1,23) = "|" + │ ├── body: + │ │ @ StatementsNode (location: (1,24)-(1,33)) + │ │ └── body: (length: 1) + │ │ └── @ ArrayNode (location: (1,24)-(1,33)) + │ │ ├── elements: (length: 3) + │ │ │ ├── @ LocalVariableReadNode (location: (1,25)-(1,26)) + │ │ │ │ ├── name: :a + │ │ │ │ └── depth: 0 + │ │ │ ├── @ LocalVariableReadNode (location: (1,28)-(1,29)) + │ │ │ │ ├── name: :b + │ │ │ │ └── depth: 0 + │ │ │ └── @ LocalVariableReadNode (location: (1,31)-(1,32)) + │ │ │ ├── name: :c + │ │ │ └── depth: 0 + │ │ ├── opening_loc: (1,24)-(1,25) = "[" + │ │ └── closing_loc: (1,32)-(1,33) = "]" + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,34)-(1,35) = "}" + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/block_args_opt3.txt b/test/prism/snapshots/seattlerb/block_args_opt3.txt new file mode 100644 index 0000000000..5f187e20cf --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_args_opt3.txt @@ -0,0 +1,72 @@ +@ ProgramNode (location: (1,0)-(1,42)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,42)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,42)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,42)) + │ ├── locals: [:a, :b, :c, :d] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,27)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,26)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ │ └── name: :a + │ │ │ ├── optionals: (length: 2) + │ │ │ │ ├── @ OptionalParameterNode (location: (1,8)-(1,14)) + │ │ │ │ │ ├── name: :b + │ │ │ │ │ ├── name_loc: (1,8)-(1,9) = "b" + │ │ │ │ │ ├── operator_loc: (1,10)-(1,11) = "=" + │ │ │ │ │ └── value: + │ │ │ │ │ @ IntegerNode (location: (1,12)-(1,14)) + │ │ │ │ │ └── flags: decimal + │ │ │ │ └── @ OptionalParameterNode (location: (1,16)-(1,22)) + │ │ │ │ ├── name: :c + │ │ │ │ ├── name_loc: (1,16)-(1,17) = "c" + │ │ │ │ ├── operator_loc: (1,18)-(1,19) = "=" + │ │ │ │ └── value: + │ │ │ │ @ IntegerNode (location: (1,20)-(1,22)) + │ │ │ │ └── flags: decimal + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: + │ │ │ @ BlockParameterNode (location: (1,24)-(1,26)) + │ │ │ ├── name: :d + │ │ │ ├── name_loc: (1,25)-(1,26) = "d" + │ │ │ └── operator_loc: (1,24)-(1,25) = "&" + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,26)-(1,27) = "|" + │ ├── body: + │ │ @ StatementsNode (location: (1,28)-(1,40)) + │ │ └── body: (length: 1) + │ │ └── @ ArrayNode (location: (1,28)-(1,40)) + │ │ ├── elements: (length: 4) + │ │ │ ├── @ LocalVariableReadNode (location: (1,29)-(1,30)) + │ │ │ │ ├── name: :a + │ │ │ │ └── depth: 0 + │ │ │ ├── @ LocalVariableReadNode (location: (1,32)-(1,33)) + │ │ │ │ ├── name: :b + │ │ │ │ └── depth: 0 + │ │ │ ├── @ LocalVariableReadNode (location: (1,35)-(1,36)) + │ │ │ │ ├── name: :c + │ │ │ │ └── depth: 0 + │ │ │ └── @ LocalVariableReadNode (location: (1,38)-(1,39)) + │ │ │ ├── name: :d + │ │ │ └── depth: 0 + │ │ ├── opening_loc: (1,28)-(1,29) = "[" + │ │ └── closing_loc: (1,39)-(1,40) = "]" + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,41)-(1,42) = "}" + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/block_break.txt b/test/prism/snapshots/seattlerb/block_break.txt new file mode 100644 index 0000000000..ce4f94f1c9 --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_break.txt @@ -0,0 +1,53 @@ +@ ProgramNode (location: (1,0)-(1,26)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,26)) + └── body: (length: 1) + └── @ BreakNode (location: (1,0)-(1,26)) + ├── arguments: + │ @ ArgumentsNode (location: (1,6)-(1,26)) + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (1,6)-(1,26)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,6)-(1,9) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,10)-(1,13)) + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (1,10)-(1,13)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,10)-(1,13) = "arg" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "arg" + │ ├── closing_loc: ∅ + │ ├── block: + │ │ @ BlockNode (location: (1,14)-(1,26)) + │ │ ├── locals: [:bar] + │ │ ├── parameters: + │ │ │ @ BlockParametersNode (location: (1,17)-(1,22)) + │ │ │ ├── parameters: + │ │ │ │ @ ParametersNode (location: (1,18)-(1,21)) + │ │ │ │ ├── requireds: (length: 1) + │ │ │ │ │ └── @ RequiredParameterNode (location: (1,18)-(1,21)) + │ │ │ │ │ └── name: :bar + │ │ │ │ ├── optionals: (length: 0) + │ │ │ │ ├── rest: ∅ + │ │ │ │ ├── posts: (length: 0) + │ │ │ │ ├── keywords: (length: 0) + │ │ │ │ ├── keyword_rest: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── locals: (length: 0) + │ │ │ ├── opening_loc: (1,17)-(1,18) = "|" + │ │ │ └── closing_loc: (1,21)-(1,22) = "|" + │ │ ├── body: ∅ + │ │ ├── opening_loc: (1,14)-(1,16) = "do" + │ │ └── closing_loc: (1,23)-(1,26) = "end" + │ ├── flags: ∅ + │ └── name: "foo" + └── keyword_loc: (1,0)-(1,5) = "break" diff --git a/test/prism/snapshots/seattlerb/block_call_defn_call_block_call.txt b/test/prism/snapshots/seattlerb/block_call_defn_call_block_call.txt new file mode 100644 index 0000000000..49ddad48b2 --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_call_defn_call_block_call.txt @@ -0,0 +1,78 @@ +@ ProgramNode (location: (1,0)-(4,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,11)) + └── body: (length: 2) + ├── @ CallNode (location: (1,0)-(3,4)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,2)-(3,4)) + │ │ └── arguments: (length: 1) + │ │ └── @ DefNode (location: (1,2)-(3,4)) + │ │ ├── name: :b + │ │ ├── name_loc: (1,6)-(1,7) = "b" + │ │ ├── receiver: ∅ + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,8)-(1,9)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,8)-(1,9)) + │ │ │ │ └── name: :c + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── body: + │ │ │ @ StatementsNode (location: (2,1)-(2,2)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (2,1)-(2,2)) + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── message_loc: (2,1)-(2,2) = "d" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── block: ∅ + │ │ │ ├── flags: variable_call + │ │ │ └── name: "d" + │ │ ├── locals: [:c] + │ │ ├── def_keyword_loc: (1,2)-(1,5) = "def" + │ │ ├── operator_loc: ∅ + │ │ ├── lparen_loc: (1,7)-(1,8) = "(" + │ │ ├── rparen_loc: (1,9)-(1,10) = ")" + │ │ ├── equal_loc: ∅ + │ │ └── end_keyword_loc: (3,1)-(3,4) = "end" + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "a" + └── @ CallNode (location: (4,1)-(4,11)) + ├── receiver: + │ @ CallNode (location: (4,1)-(4,2)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (4,1)-(4,2) = "e" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "e" + ├── call_operator_loc: (4,2)-(4,3) = "." + ├── message_loc: (4,3)-(4,4) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (4,5)-(4,11)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (4,5)-(4,7) = "do" + │ └── closing_loc: (4,8)-(4,11) = "end" + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/block_call_dot_op2_brace_block.txt b/test/prism/snapshots/seattlerb/block_call_dot_op2_brace_block.txt new file mode 100644 index 0000000000..812b7ab151 --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_call_dot_op2_brace_block.txt @@ -0,0 +1,98 @@ +@ ProgramNode (location: (1,0)-(1,31)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,31)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,31)) + ├── receiver: + │ @ CallNode (location: (1,0)-(1,16)) + │ ├── receiver: + │ │ @ CallNode (location: (1,0)-(1,1)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,0)-(1,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "a" + │ ├── call_operator_loc: (1,1)-(1,2) = "." + │ ├── message_loc: (1,2)-(1,3) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,4)-(1,7)) + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (1,4)-(1,7)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,4)-(1,5) = "c" + │ │ ├── opening_loc: (1,5)-(1,6) = "(" + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: (1,6)-(1,7) = ")" + │ │ ├── block: ∅ + │ │ ├── flags: ∅ + │ │ └── name: "c" + │ ├── closing_loc: ∅ + │ ├── block: + │ │ @ BlockNode (location: (1,8)-(1,16)) + │ │ ├── locals: [] + │ │ ├── parameters: ∅ + │ │ ├── body: + │ │ │ @ StatementsNode (location: (1,11)-(1,12)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (1,11)-(1,12)) + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── message_loc: (1,11)-(1,12) = "d" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── block: ∅ + │ │ │ ├── flags: variable_call + │ │ │ └── name: "d" + │ │ ├── opening_loc: (1,8)-(1,10) = "do" + │ │ └── closing_loc: (1,13)-(1,16) = "end" + │ ├── flags: ∅ + │ └── name: "b" + ├── call_operator_loc: (1,16)-(1,17) = "." + ├── message_loc: (1,17)-(1,18) = "e" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,19)-(1,31)) + │ ├── locals: [:f] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,22)-(1,25)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,23)-(1,24)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,23)-(1,24)) + │ │ │ │ └── name: :f + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,22)-(1,23) = "|" + │ │ └── closing_loc: (1,24)-(1,25) = "|" + │ ├── body: + │ │ @ StatementsNode (location: (1,26)-(1,27)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (1,26)-(1,27)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,26)-(1,27) = "g" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "g" + │ ├── opening_loc: (1,19)-(1,21) = "do" + │ └── closing_loc: (1,28)-(1,31) = "end" + ├── flags: ∅ + └── name: "e" diff --git a/test/prism/snapshots/seattlerb/block_call_dot_op2_cmd_args_do_block.txt b/test/prism/snapshots/seattlerb/block_call_dot_op2_cmd_args_do_block.txt new file mode 100644 index 0000000000..2262a7cc88 --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_call_dot_op2_cmd_args_do_block.txt @@ -0,0 +1,110 @@ +@ ProgramNode (location: (1,0)-(1,33)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,33)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,33)) + ├── receiver: + │ @ CallNode (location: (1,0)-(1,16)) + │ ├── receiver: + │ │ @ CallNode (location: (1,0)-(1,1)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,0)-(1,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "a" + │ ├── call_operator_loc: (1,1)-(1,2) = "." + │ ├── message_loc: (1,2)-(1,3) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,4)-(1,7)) + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (1,4)-(1,7)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,4)-(1,5) = "c" + │ │ ├── opening_loc: (1,5)-(1,6) = "(" + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: (1,6)-(1,7) = ")" + │ │ ├── block: ∅ + │ │ ├── flags: ∅ + │ │ └── name: "c" + │ ├── closing_loc: ∅ + │ ├── block: + │ │ @ BlockNode (location: (1,8)-(1,16)) + │ │ ├── locals: [] + │ │ ├── parameters: ∅ + │ │ ├── body: + │ │ │ @ StatementsNode (location: (1,11)-(1,12)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (1,11)-(1,12)) + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── message_loc: (1,11)-(1,12) = "d" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── block: ∅ + │ │ │ ├── flags: variable_call + │ │ │ └── name: "d" + │ │ ├── opening_loc: (1,8)-(1,10) = "do" + │ │ └── closing_loc: (1,13)-(1,16) = "end" + │ ├── flags: ∅ + │ └── name: "b" + ├── call_operator_loc: (1,16)-(1,17) = "." + ├── message_loc: (1,17)-(1,18) = "e" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,19)-(1,20)) + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (1,19)-(1,20)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,19)-(1,20) = "f" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "f" + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,21)-(1,33)) + │ ├── locals: [:g] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,24)-(1,27)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,25)-(1,26)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,25)-(1,26)) + │ │ │ │ └── name: :g + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,24)-(1,25) = "|" + │ │ └── closing_loc: (1,26)-(1,27) = "|" + │ ├── body: + │ │ @ StatementsNode (location: (1,28)-(1,29)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (1,28)-(1,29)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,28)-(1,29) = "h" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "h" + │ ├── opening_loc: (1,21)-(1,23) = "do" + │ └── closing_loc: (1,30)-(1,33) = "end" + ├── flags: ∅ + └── name: "e" diff --git a/test/prism/snapshots/seattlerb/block_call_operation_colon.txt b/test/prism/snapshots/seattlerb/block_call_operation_colon.txt new file mode 100644 index 0000000000..3bcc89b50a --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_call_operation_colon.txt @@ -0,0 +1,53 @@ +@ ProgramNode (location: (1,0)-(1,15)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,15)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,15)) + ├── receiver: + │ @ CallNode (location: (1,0)-(1,12)) + │ ├── receiver: + │ │ @ CallNode (location: (1,0)-(1,1)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,0)-(1,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "a" + │ ├── call_operator_loc: (1,1)-(1,2) = "." + │ ├── message_loc: (1,2)-(1,3) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,4)-(1,5)) + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (1,4)-(1,5)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,4)-(1,5) = "c" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "c" + │ ├── closing_loc: ∅ + │ ├── block: + │ │ @ BlockNode (location: (1,6)-(1,12)) + │ │ ├── locals: [] + │ │ ├── parameters: ∅ + │ │ ├── body: ∅ + │ │ ├── opening_loc: (1,6)-(1,8) = "do" + │ │ └── closing_loc: (1,9)-(1,12) = "end" + │ ├── flags: ∅ + │ └── name: "b" + ├── call_operator_loc: (1,12)-(1,14) = "::" + ├── message_loc: (1,14)-(1,15) = "d" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "d" diff --git a/test/prism/snapshots/seattlerb/block_call_operation_dot.txt b/test/prism/snapshots/seattlerb/block_call_operation_dot.txt new file mode 100644 index 0000000000..93116aed58 --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_call_operation_dot.txt @@ -0,0 +1,53 @@ +@ ProgramNode (location: (1,0)-(1,14)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,14)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,14)) + ├── receiver: + │ @ CallNode (location: (1,0)-(1,12)) + │ ├── receiver: + │ │ @ CallNode (location: (1,0)-(1,1)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,0)-(1,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "a" + │ ├── call_operator_loc: (1,1)-(1,2) = "." + │ ├── message_loc: (1,2)-(1,3) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,4)-(1,5)) + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (1,4)-(1,5)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,4)-(1,5) = "c" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "c" + │ ├── closing_loc: ∅ + │ ├── block: + │ │ @ BlockNode (location: (1,6)-(1,12)) + │ │ ├── locals: [] + │ │ ├── parameters: ∅ + │ │ ├── body: ∅ + │ │ ├── opening_loc: (1,6)-(1,8) = "do" + │ │ └── closing_loc: (1,9)-(1,12) = "end" + │ ├── flags: ∅ + │ └── name: "b" + ├── call_operator_loc: (1,12)-(1,13) = "." + ├── message_loc: (1,13)-(1,14) = "d" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "d" diff --git a/test/prism/snapshots/seattlerb/block_call_paren_call_block_call.txt b/test/prism/snapshots/seattlerb/block_call_paren_call_block_call.txt new file mode 100644 index 0000000000..ec75ca056a --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_call_paren_call_block_call.txt @@ -0,0 +1,59 @@ +@ ProgramNode (location: (1,0)-(2,10)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,10)) + └── body: (length: 2) + ├── @ CallNode (location: (1,0)-(1,5)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,2)-(1,5)) + │ │ └── arguments: (length: 1) + │ │ └── @ ParenthesesNode (location: (1,2)-(1,5)) + │ │ ├── body: + │ │ │ @ StatementsNode (location: (1,3)-(1,4)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (1,3)-(1,4)) + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── message_loc: (1,3)-(1,4) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── block: ∅ + │ │ │ ├── flags: variable_call + │ │ │ └── name: "b" + │ │ ├── opening_loc: (1,2)-(1,3) = "(" + │ │ └── closing_loc: (1,4)-(1,5) = ")" + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "a" + └── @ CallNode (location: (2,0)-(2,10)) + ├── receiver: + │ @ CallNode (location: (2,0)-(2,1)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (2,0)-(2,1) = "c" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "c" + ├── call_operator_loc: (2,1)-(2,2) = "." + ├── message_loc: (2,2)-(2,3) = "d" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (2,4)-(2,10)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (2,4)-(2,6) = "do" + │ └── closing_loc: (2,7)-(2,10) = "end" + ├── flags: ∅ + └── name: "d" diff --git a/test/prism/snapshots/seattlerb/block_command_operation_colon.txt b/test/prism/snapshots/seattlerb/block_command_operation_colon.txt new file mode 100644 index 0000000000..90bb7ad6d0 --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_command_operation_colon.txt @@ -0,0 +1,45 @@ +@ ProgramNode (location: (1,0)-(1,17)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,17)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,17)) + ├── receiver: + │ @ CallNode (location: (1,0)-(1,11)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,2)-(1,4)) + │ │ └── arguments: (length: 1) + │ │ └── @ SymbolNode (location: (1,2)-(1,4)) + │ │ ├── opening_loc: (1,2)-(1,3) = ":" + │ │ ├── value_loc: (1,3)-(1,4) = "b" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "b" + │ ├── closing_loc: ∅ + │ ├── block: + │ │ @ BlockNode (location: (1,5)-(1,11)) + │ │ ├── locals: [] + │ │ ├── parameters: ∅ + │ │ ├── body: ∅ + │ │ ├── opening_loc: (1,5)-(1,7) = "do" + │ │ └── closing_loc: (1,8)-(1,11) = "end" + │ ├── flags: ∅ + │ └── name: "a" + ├── call_operator_loc: (1,11)-(1,13) = "::" + ├── message_loc: (1,13)-(1,14) = "c" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,15)-(1,17)) + │ └── arguments: (length: 1) + │ └── @ SymbolNode (location: (1,15)-(1,17)) + │ ├── opening_loc: (1,15)-(1,16) = ":" + │ ├── value_loc: (1,16)-(1,17) = "d" + │ ├── closing_loc: ∅ + │ └── unescaped: "d" + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "c" diff --git a/test/prism/snapshots/seattlerb/block_command_operation_dot.txt b/test/prism/snapshots/seattlerb/block_command_operation_dot.txt new file mode 100644 index 0000000000..94be9641fb --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_command_operation_dot.txt @@ -0,0 +1,45 @@ +@ ProgramNode (location: (1,0)-(1,16)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,16)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,16)) + ├── receiver: + │ @ CallNode (location: (1,0)-(1,11)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,2)-(1,4)) + │ │ └── arguments: (length: 1) + │ │ └── @ SymbolNode (location: (1,2)-(1,4)) + │ │ ├── opening_loc: (1,2)-(1,3) = ":" + │ │ ├── value_loc: (1,3)-(1,4) = "b" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "b" + │ ├── closing_loc: ∅ + │ ├── block: + │ │ @ BlockNode (location: (1,5)-(1,11)) + │ │ ├── locals: [] + │ │ ├── parameters: ∅ + │ │ ├── body: ∅ + │ │ ├── opening_loc: (1,5)-(1,7) = "do" + │ │ └── closing_loc: (1,8)-(1,11) = "end" + │ ├── flags: ∅ + │ └── name: "a" + ├── call_operator_loc: (1,11)-(1,12) = "." + ├── message_loc: (1,12)-(1,13) = "c" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,14)-(1,16)) + │ └── arguments: (length: 1) + │ └── @ SymbolNode (location: (1,14)-(1,16)) + │ ├── opening_loc: (1,14)-(1,15) = ":" + │ ├── value_loc: (1,15)-(1,16) = "d" + │ ├── closing_loc: ∅ + │ └── unescaped: "d" + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "c" diff --git a/test/prism/snapshots/seattlerb/block_decomp_anon_splat_arg.txt b/test/prism/snapshots/seattlerb/block_decomp_anon_splat_arg.txt new file mode 100644 index 0000000000..76c3b8c413 --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_decomp_anon_splat_arg.txt @@ -0,0 +1,43 @@ +@ ProgramNode (location: (1,0)-(1,14)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,14)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,14)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,14)) + │ ├── locals: [:a] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,12)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,11)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredDestructuredParameterNode (location: (1,5)-(1,11)) + │ │ │ │ ├── parameters: (length: 2) + │ │ │ │ │ ├── @ SplatNode (location: (1,6)-(1,7)) + │ │ │ │ │ │ ├── operator_loc: (1,6)-(1,7) = "*" + │ │ │ │ │ │ └── expression: ∅ + │ │ │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ │ │ └── name: :a + │ │ │ │ ├── opening_loc: (1,5)-(1,6) = "(" + │ │ │ │ └── closing_loc: (1,10)-(1,11) = ")" + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,11)-(1,12) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,13)-(1,14) = "}" + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/block_decomp_arg_splat.txt b/test/prism/snapshots/seattlerb/block_decomp_arg_splat.txt new file mode 100644 index 0000000000..3eebb50b72 --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_decomp_arg_splat.txt @@ -0,0 +1,43 @@ +@ ProgramNode (location: (1,0)-(1,14)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,14)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,14)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,14)) + │ ├── locals: [:b] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,12)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,11)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredDestructuredParameterNode (location: (1,5)-(1,11)) + │ │ │ │ ├── parameters: (length: 2) + │ │ │ │ │ ├── @ RequiredParameterNode (location: (1,6)-(1,7)) + │ │ │ │ │ │ └── name: :b + │ │ │ │ │ └── @ SplatNode (location: (1,9)-(1,10)) + │ │ │ │ │ ├── operator_loc: (1,9)-(1,10) = "*" + │ │ │ │ │ └── expression: ∅ + │ │ │ │ ├── opening_loc: (1,5)-(1,6) = "(" + │ │ │ │ └── closing_loc: (1,10)-(1,11) = ")" + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,11)-(1,12) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,13)-(1,14) = "}" + ├── flags: ∅ + └── name: "a" diff --git a/test/prism/snapshots/seattlerb/block_decomp_arg_splat_arg.txt b/test/prism/snapshots/seattlerb/block_decomp_arg_splat_arg.txt new file mode 100644 index 0000000000..4ee66e215b --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_decomp_arg_splat_arg.txt @@ -0,0 +1,47 @@ +@ ProgramNode (location: (1,0)-(1,18)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,18)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,18)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,18)) + │ ├── locals: [:a, :b, :c] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,16)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,15)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredDestructuredParameterNode (location: (1,5)-(1,15)) + │ │ │ │ ├── parameters: (length: 3) + │ │ │ │ │ ├── @ RequiredParameterNode (location: (1,6)-(1,7)) + │ │ │ │ │ │ └── name: :a + │ │ │ │ │ ├── @ SplatNode (location: (1,9)-(1,11)) + │ │ │ │ │ │ ├── operator_loc: (1,9)-(1,10) = "*" + │ │ │ │ │ │ └── expression: + │ │ │ │ │ │ @ RequiredParameterNode (location: (1,10)-(1,11)) + │ │ │ │ │ │ └── name: :b + │ │ │ │ │ └── @ RequiredParameterNode (location: (1,13)-(1,14)) + │ │ │ │ │ └── name: :c + │ │ │ │ ├── opening_loc: (1,5)-(1,6) = "(" + │ │ │ │ └── closing_loc: (1,14)-(1,15) = ")" + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,15)-(1,16) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,17)-(1,18) = "}" + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/block_decomp_splat.txt b/test/prism/snapshots/seattlerb/block_decomp_splat.txt new file mode 100644 index 0000000000..698dba24db --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_decomp_splat.txt @@ -0,0 +1,43 @@ +@ ProgramNode (location: (1,0)-(1,12)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,12)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,12)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,12)) + │ ├── locals: [:a] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,10)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,9)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredDestructuredParameterNode (location: (1,5)-(1,9)) + │ │ │ │ ├── parameters: (length: 1) + │ │ │ │ │ └── @ SplatNode (location: (1,6)-(1,8)) + │ │ │ │ │ ├── operator_loc: (1,6)-(1,7) = "*" + │ │ │ │ │ └── expression: + │ │ │ │ │ @ RequiredParameterNode (location: (1,7)-(1,8)) + │ │ │ │ │ └── name: :a + │ │ │ │ ├── opening_loc: (1,5)-(1,6) = "(" + │ │ │ │ └── closing_loc: (1,8)-(1,9) = ")" + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,9)-(1,10) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,11)-(1,12) = "}" + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/block_kw.txt b/test/prism/snapshots/seattlerb/block_kw.txt new file mode 100644 index 0000000000..f706063884 --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_kw.txt @@ -0,0 +1,40 @@ +@ ProgramNode (location: (1,0)-(1,15)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,15)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,15)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,4) = "blah" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,5)-(1,15)) + │ ├── locals: [:k] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,7)-(1,13)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,8)-(1,12)) + │ │ │ ├── requireds: (length: 0) + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 1) + │ │ │ │ └── @ KeywordParameterNode (location: (1,8)-(1,12)) + │ │ │ │ ├── name: :k + │ │ │ │ ├── name_loc: (1,8)-(1,10) = "k:" + │ │ │ │ └── value: + │ │ │ │ @ IntegerNode (location: (1,10)-(1,12)) + │ │ │ │ └── flags: decimal + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,7)-(1,8) = "|" + │ │ └── closing_loc: (1,12)-(1,13) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,5)-(1,6) = "{" + │ └── closing_loc: (1,14)-(1,15) = "}" + ├── flags: ∅ + └── name: "blah" diff --git a/test/prism/snapshots/seattlerb/block_kw__required.txt b/test/prism/snapshots/seattlerb/block_kw__required.txt new file mode 100644 index 0000000000..d46bfcf21a --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_kw__required.txt @@ -0,0 +1,38 @@ +@ ProgramNode (location: (1,0)-(1,16)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,16)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,16)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,4) = "blah" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,5)-(1,16)) + │ ├── locals: [:k] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,8)-(1,12)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,9)-(1,11)) + │ │ │ ├── requireds: (length: 0) + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 1) + │ │ │ │ └── @ KeywordParameterNode (location: (1,9)-(1,11)) + │ │ │ │ ├── name: :k + │ │ │ │ ├── name_loc: (1,9)-(1,11) = "k:" + │ │ │ │ └── value: ∅ + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,8)-(1,9) = "|" + │ │ └── closing_loc: (1,11)-(1,12) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,5)-(1,7) = "do" + │ └── closing_loc: (1,13)-(1,16) = "end" + ├── flags: ∅ + └── name: "blah" diff --git a/test/prism/snapshots/seattlerb/block_kwarg_lvar.txt b/test/prism/snapshots/seattlerb/block_kwarg_lvar.txt new file mode 100644 index 0000000000..f268418a5f --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_kwarg_lvar.txt @@ -0,0 +1,48 @@ +@ ProgramNode (location: (1,0)-(1,20)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,20)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,20)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,2) = "bl" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,3)-(1,20)) + │ ├── locals: [:kw] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,5)-(1,15)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,6)-(1,14)) + │ │ │ ├── requireds: (length: 0) + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 1) + │ │ │ │ └── @ KeywordParameterNode (location: (1,6)-(1,14)) + │ │ │ │ ├── name: :kw + │ │ │ │ ├── name_loc: (1,6)-(1,9) = "kw:" + │ │ │ │ └── value: + │ │ │ │ @ SymbolNode (location: (1,10)-(1,14)) + │ │ │ │ ├── opening_loc: (1,10)-(1,11) = ":" + │ │ │ │ ├── value_loc: (1,11)-(1,14) = "val" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "val" + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,5)-(1,6) = "|" + │ │ └── closing_loc: (1,14)-(1,15) = "|" + │ ├── body: + │ │ @ StatementsNode (location: (1,16)-(1,18)) + │ │ └── body: (length: 1) + │ │ └── @ LocalVariableReadNode (location: (1,16)-(1,18)) + │ │ ├── name: :kw + │ │ └── depth: 0 + │ ├── opening_loc: (1,3)-(1,4) = "{" + │ └── closing_loc: (1,19)-(1,20) = "}" + ├── flags: ∅ + └── name: "bl" diff --git a/test/prism/snapshots/seattlerb/block_kwarg_lvar_multiple.txt b/test/prism/snapshots/seattlerb/block_kwarg_lvar_multiple.txt new file mode 100644 index 0000000000..f062044909 --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_kwarg_lvar_multiple.txt @@ -0,0 +1,57 @@ +@ ProgramNode (location: (1,0)-(1,33)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,33)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,33)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,2) = "bl" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,3)-(1,33)) + │ ├── locals: [:kw, :kw2] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,5)-(1,28)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,6)-(1,26)) + │ │ │ ├── requireds: (length: 0) + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 2) + │ │ │ │ ├── @ KeywordParameterNode (location: (1,6)-(1,14)) + │ │ │ │ │ ├── name: :kw + │ │ │ │ │ ├── name_loc: (1,6)-(1,9) = "kw:" + │ │ │ │ │ └── value: + │ │ │ │ │ @ SymbolNode (location: (1,10)-(1,14)) + │ │ │ │ │ ├── opening_loc: (1,10)-(1,11) = ":" + │ │ │ │ │ ├── value_loc: (1,11)-(1,14) = "val" + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── unescaped: "val" + │ │ │ │ └── @ KeywordParameterNode (location: (1,16)-(1,26)) + │ │ │ │ ├── name: :kw2 + │ │ │ │ ├── name_loc: (1,16)-(1,20) = "kw2:" + │ │ │ │ └── value: + │ │ │ │ @ SymbolNode (location: (1,21)-(1,26)) + │ │ │ │ ├── opening_loc: (1,21)-(1,22) = ":" + │ │ │ │ ├── value_loc: (1,22)-(1,26) = "val2" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "val2" + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,5)-(1,6) = "|" + │ │ └── closing_loc: (1,27)-(1,28) = "|" + │ ├── body: + │ │ @ StatementsNode (location: (1,29)-(1,31)) + │ │ └── body: (length: 1) + │ │ └── @ LocalVariableReadNode (location: (1,29)-(1,31)) + │ │ ├── name: :kw + │ │ └── depth: 0 + │ ├── opening_loc: (1,3)-(1,4) = "{" + │ └── closing_loc: (1,32)-(1,33) = "}" + ├── flags: ∅ + └── name: "bl" diff --git a/test/prism/snapshots/seattlerb/block_next.txt b/test/prism/snapshots/seattlerb/block_next.txt new file mode 100644 index 0000000000..5c1b27d8f3 --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_next.txt @@ -0,0 +1,53 @@ +@ ProgramNode (location: (1,0)-(1,25)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,25)) + └── body: (length: 1) + └── @ NextNode (location: (1,0)-(1,25)) + ├── arguments: + │ @ ArgumentsNode (location: (1,5)-(1,25)) + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (1,5)-(1,25)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,5)-(1,8) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,9)-(1,12)) + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (1,9)-(1,12)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,9)-(1,12) = "arg" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "arg" + │ ├── closing_loc: ∅ + │ ├── block: + │ │ @ BlockNode (location: (1,13)-(1,25)) + │ │ ├── locals: [:bar] + │ │ ├── parameters: + │ │ │ @ BlockParametersNode (location: (1,16)-(1,21)) + │ │ │ ├── parameters: + │ │ │ │ @ ParametersNode (location: (1,17)-(1,20)) + │ │ │ │ ├── requireds: (length: 1) + │ │ │ │ │ └── @ RequiredParameterNode (location: (1,17)-(1,20)) + │ │ │ │ │ └── name: :bar + │ │ │ │ ├── optionals: (length: 0) + │ │ │ │ ├── rest: ∅ + │ │ │ │ ├── posts: (length: 0) + │ │ │ │ ├── keywords: (length: 0) + │ │ │ │ ├── keyword_rest: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── locals: (length: 0) + │ │ │ ├── opening_loc: (1,16)-(1,17) = "|" + │ │ │ └── closing_loc: (1,20)-(1,21) = "|" + │ │ ├── body: ∅ + │ │ ├── opening_loc: (1,13)-(1,15) = "do" + │ │ └── closing_loc: (1,22)-(1,25) = "end" + │ ├── flags: ∅ + │ └── name: "foo" + └── keyword_loc: (1,0)-(1,4) = "next" diff --git a/test/prism/snapshots/seattlerb/block_opt_arg.txt b/test/prism/snapshots/seattlerb/block_opt_arg.txt new file mode 100644 index 0000000000..32d5738df3 --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_opt_arg.txt @@ -0,0 +1,43 @@ +@ ProgramNode (location: (1,0)-(1,14)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,14)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,14)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,14)) + │ ├── locals: [:b, :c] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,12)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,11)) + │ │ │ ├── requireds: (length: 0) + │ │ │ ├── optionals: (length: 1) + │ │ │ │ └── @ OptionalParameterNode (location: (1,5)-(1,8)) + │ │ │ │ ├── name: :b + │ │ │ │ ├── name_loc: (1,5)-(1,6) = "b" + │ │ │ │ ├── operator_loc: (1,6)-(1,7) = "=" + │ │ │ │ └── value: + │ │ │ │ @ IntegerNode (location: (1,7)-(1,8)) + │ │ │ │ └── flags: decimal + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,10)-(1,11)) + │ │ │ │ └── name: :c + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,11)-(1,12) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,13)-(1,14) = "}" + ├── flags: ∅ + └── name: "a" diff --git a/test/prism/snapshots/seattlerb/block_opt_splat.txt b/test/prism/snapshots/seattlerb/block_opt_splat.txt new file mode 100644 index 0000000000..9a8a4938fe --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_opt_splat.txt @@ -0,0 +1,45 @@ +@ ProgramNode (location: (1,0)-(1,17)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,17)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,17)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,17)) + │ ├── locals: [:b, :c] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,15)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,14)) + │ │ │ ├── requireds: (length: 0) + │ │ │ ├── optionals: (length: 1) + │ │ │ │ └── @ OptionalParameterNode (location: (1,5)-(1,10)) + │ │ │ │ ├── name: :b + │ │ │ │ ├── name_loc: (1,5)-(1,6) = "b" + │ │ │ │ ├── operator_loc: (1,7)-(1,8) = "=" + │ │ │ │ └── value: + │ │ │ │ @ IntegerNode (location: (1,9)-(1,10)) + │ │ │ │ └── flags: decimal + │ │ │ ├── rest: + │ │ │ │ @ RestParameterNode (location: (1,12)-(1,14)) + │ │ │ │ ├── name: :c + │ │ │ │ ├── name_loc: (1,13)-(1,14) = "c" + │ │ │ │ └── operator_loc: (1,12)-(1,13) = "*" + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,14)-(1,15) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,16)-(1,17) = "}" + ├── flags: ∅ + └── name: "a" diff --git a/test/prism/snapshots/seattlerb/block_opt_splat_arg_block_omfg.txt b/test/prism/snapshots/seattlerb/block_opt_splat_arg_block_omfg.txt new file mode 100644 index 0000000000..e3fc328737 --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_opt_splat_arg_block_omfg.txt @@ -0,0 +1,51 @@ +@ ProgramNode (location: (1,0)-(1,22)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,22)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,22)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,22)) + │ ├── locals: [:b, :c, :d, :e] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,20)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,19)) + │ │ │ ├── requireds: (length: 0) + │ │ │ ├── optionals: (length: 1) + │ │ │ │ └── @ OptionalParameterNode (location: (1,5)-(1,8)) + │ │ │ │ ├── name: :b + │ │ │ │ ├── name_loc: (1,5)-(1,6) = "b" + │ │ │ │ ├── operator_loc: (1,6)-(1,7) = "=" + │ │ │ │ └── value: + │ │ │ │ @ IntegerNode (location: (1,7)-(1,8)) + │ │ │ │ └── flags: decimal + │ │ │ ├── rest: + │ │ │ │ @ RestParameterNode (location: (1,10)-(1,12)) + │ │ │ │ ├── name: :c + │ │ │ │ ├── name_loc: (1,11)-(1,12) = "c" + │ │ │ │ └── operator_loc: (1,10)-(1,11) = "*" + │ │ │ ├── posts: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,14)-(1,15)) + │ │ │ │ └── name: :d + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: + │ │ │ @ BlockParameterNode (location: (1,17)-(1,19)) + │ │ │ ├── name: :e + │ │ │ ├── name_loc: (1,18)-(1,19) = "e" + │ │ │ └── operator_loc: (1,17)-(1,18) = "&" + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,19)-(1,20) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,21)-(1,22) = "}" + ├── flags: ∅ + └── name: "a" diff --git a/test/prism/snapshots/seattlerb/block_optarg.txt b/test/prism/snapshots/seattlerb/block_optarg.txt new file mode 100644 index 0000000000..b930687f3b --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_optarg.txt @@ -0,0 +1,44 @@ +@ ProgramNode (location: (1,0)-(1,14)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,14)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,14)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,14)) + │ ├── locals: [:b] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,12)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,11)) + │ │ │ ├── requireds: (length: 0) + │ │ │ ├── optionals: (length: 1) + │ │ │ │ └── @ OptionalParameterNode (location: (1,5)-(1,11)) + │ │ │ │ ├── name: :b + │ │ │ │ ├── name_loc: (1,5)-(1,6) = "b" + │ │ │ │ ├── operator_loc: (1,7)-(1,8) = "=" + │ │ │ │ └── value: + │ │ │ │ @ SymbolNode (location: (1,9)-(1,11)) + │ │ │ │ ├── opening_loc: (1,9)-(1,10) = ":" + │ │ │ │ ├── value_loc: (1,10)-(1,11) = "c" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "c" + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,11)-(1,12) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,13)-(1,14) = "}" + ├── flags: ∅ + └── name: "a" diff --git a/test/prism/snapshots/seattlerb/block_paren_splat.txt b/test/prism/snapshots/seattlerb/block_paren_splat.txt new file mode 100644 index 0000000000..f7592497f1 --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_paren_splat.txt @@ -0,0 +1,45 @@ +@ ProgramNode (location: (1,0)-(1,15)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,15)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,15)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,15)) + │ ├── locals: [:b, :c] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,13)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,12)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredDestructuredParameterNode (location: (1,5)-(1,12)) + │ │ │ │ ├── parameters: (length: 2) + │ │ │ │ │ ├── @ RequiredParameterNode (location: (1,6)-(1,7)) + │ │ │ │ │ │ └── name: :b + │ │ │ │ │ └── @ SplatNode (location: (1,9)-(1,11)) + │ │ │ │ │ ├── operator_loc: (1,9)-(1,10) = "*" + │ │ │ │ │ └── expression: + │ │ │ │ │ @ RequiredParameterNode (location: (1,10)-(1,11)) + │ │ │ │ │ └── name: :c + │ │ │ │ ├── opening_loc: (1,5)-(1,6) = "(" + │ │ │ │ └── closing_loc: (1,11)-(1,12) = ")" + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,12)-(1,13) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,14)-(1,15) = "}" + ├── flags: ∅ + └── name: "a" diff --git a/test/prism/snapshots/seattlerb/block_reg_optarg.txt b/test/prism/snapshots/seattlerb/block_reg_optarg.txt new file mode 100644 index 0000000000..2d6d50122c --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_reg_optarg.txt @@ -0,0 +1,46 @@ +@ ProgramNode (location: (1,0)-(1,17)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,17)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,17)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,17)) + │ ├── locals: [:b, :c] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,15)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,14)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ │ └── name: :b + │ │ │ ├── optionals: (length: 1) + │ │ │ │ └── @ OptionalParameterNode (location: (1,8)-(1,14)) + │ │ │ │ ├── name: :c + │ │ │ │ ├── name_loc: (1,8)-(1,9) = "c" + │ │ │ │ ├── operator_loc: (1,10)-(1,11) = "=" + │ │ │ │ └── value: + │ │ │ │ @ SymbolNode (location: (1,12)-(1,14)) + │ │ │ │ ├── opening_loc: (1,12)-(1,13) = ":" + │ │ │ │ ├── value_loc: (1,13)-(1,14) = "d" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "d" + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,14)-(1,15) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,16)-(1,17) = "}" + ├── flags: ∅ + └── name: "a" diff --git a/test/prism/snapshots/seattlerb/block_return.txt b/test/prism/snapshots/seattlerb/block_return.txt new file mode 100644 index 0000000000..8c391abd53 --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_return.txt @@ -0,0 +1,53 @@ +@ ProgramNode (location: (1,0)-(1,27)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,27)) + └── body: (length: 1) + └── @ ReturnNode (location: (1,0)-(1,27)) + ├── keyword_loc: (1,0)-(1,6) = "return" + └── arguments: + @ ArgumentsNode (location: (1,7)-(1,27)) + └── arguments: (length: 1) + └── @ CallNode (location: (1,7)-(1,27)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,7)-(1,10) = "foo" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,11)-(1,14)) + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (1,11)-(1,14)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,11)-(1,14) = "arg" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "arg" + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,15)-(1,27)) + │ ├── locals: [:bar] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,18)-(1,23)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,19)-(1,22)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,19)-(1,22)) + │ │ │ │ └── name: :bar + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,18)-(1,19) = "|" + │ │ └── closing_loc: (1,22)-(1,23) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,15)-(1,17) = "do" + │ └── closing_loc: (1,24)-(1,27) = "end" + ├── flags: ∅ + └── name: "foo" diff --git a/test/prism/snapshots/seattlerb/block_scope.txt b/test/prism/snapshots/seattlerb/block_scope.txt new file mode 100644 index 0000000000..14263c5623 --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_scope.txt @@ -0,0 +1,28 @@ +@ ProgramNode (location: (1,0)-(1,10)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,10)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,10)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,10)) + │ ├── locals: [:b] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,8)) + │ │ ├── parameters: ∅ + │ │ ├── locals: (length: 1) + │ │ │ └── @ BlockLocalVariableNode (location: (1,6)-(1,7)) + │ │ │ └── name: :b + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,7)-(1,8) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,9)-(1,10) = "}" + ├── flags: ∅ + └── name: "a" diff --git a/test/prism/snapshots/seattlerb/block_splat_reg.txt b/test/prism/snapshots/seattlerb/block_splat_reg.txt new file mode 100644 index 0000000000..4b12ce34a8 --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_splat_reg.txt @@ -0,0 +1,40 @@ +@ ProgramNode (location: (1,0)-(1,13)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,13)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,13)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,13)) + │ ├── locals: [:b, :c] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,11)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,10)) + │ │ │ ├── requireds: (length: 0) + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: + │ │ │ │ @ RestParameterNode (location: (1,5)-(1,7)) + │ │ │ │ ├── name: :b + │ │ │ │ ├── name_loc: (1,6)-(1,7) = "b" + │ │ │ │ └── operator_loc: (1,5)-(1,6) = "*" + │ │ │ ├── posts: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ │ └── name: :c + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,10)-(1,11) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,12)-(1,13) = "}" + ├── flags: ∅ + └── name: "a" diff --git a/test/prism/snapshots/seattlerb/bug169.txt b/test/prism/snapshots/seattlerb/bug169.txt new file mode 100644 index 0000000000..94c2597316 --- /dev/null +++ b/test/prism/snapshots/seattlerb/bug169.txt @@ -0,0 +1,27 @@ +@ ProgramNode (location: (1,0)-(1,7)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,7)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,7)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "m" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,4)) + │ └── arguments: (length: 1) + │ └── @ ParenthesesNode (location: (1,2)-(1,4)) + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "(" + │ └── closing_loc: (1,3)-(1,4) = ")" + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,5)-(1,7)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (1,5)-(1,6) = "{" + │ └── closing_loc: (1,6)-(1,7) = "}" + ├── flags: ∅ + └── name: "m" diff --git a/test/prism/snapshots/seattlerb/bug179.txt b/test/prism/snapshots/seattlerb/bug179.txt new file mode 100644 index 0000000000..233a4767e0 --- /dev/null +++ b/test/prism/snapshots/seattlerb/bug179.txt @@ -0,0 +1,27 @@ +@ ProgramNode (location: (1,0)-(1,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,9)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,9)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "p" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,9)) + │ └── arguments: (length: 1) + │ └── @ RangeNode (location: (1,2)-(1,9)) + │ ├── left: + │ │ @ ParenthesesNode (location: (1,2)-(1,4)) + │ │ ├── body: ∅ + │ │ ├── opening_loc: (1,2)-(1,3) = "(" + │ │ └── closing_loc: (1,3)-(1,4) = ")" + │ ├── right: + │ │ @ NilNode (location: (1,6)-(1,9)) + │ ├── operator_loc: (1,4)-(1,6) = ".." + │ └── flags: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "p" diff --git a/test/prism/snapshots/seattlerb/bug190.txt b/test/prism/snapshots/seattlerb/bug190.txt new file mode 100644 index 0000000000..527304835a --- /dev/null +++ b/test/prism/snapshots/seattlerb/bug190.txt @@ -0,0 +1,11 @@ +@ ProgramNode (location: (1,0)-(1,6)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,6)) + └── body: (length: 1) + └── @ RegularExpressionNode (location: (1,0)-(1,6)) + ├── opening_loc: (1,0)-(1,3) = "%r'" + ├── content_loc: (1,3)-(1,5) = "\\'" + ├── closing_loc: (1,5)-(1,6) = "'" + ├── unescaped: "'" + └── flags: ∅ diff --git a/test/prism/snapshots/seattlerb/bug191.txt b/test/prism/snapshots/seattlerb/bug191.txt new file mode 100644 index 0000000000..313e892629 --- /dev/null +++ b/test/prism/snapshots/seattlerb/bug191.txt @@ -0,0 +1,85 @@ +@ ProgramNode (location: (1,0)-(3,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,9)) + └── body: (length: 2) + ├── @ IfNode (location: (1,0)-(1,9)) + │ ├── if_keyword_loc: ∅ + │ ├── predicate: + │ │ @ CallNode (location: (1,0)-(1,1)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,0)-(1,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "a" + │ ├── statements: + │ │ @ StatementsNode (location: (1,4)-(1,6)) + │ │ └── body: (length: 1) + │ │ └── @ StringNode (location: (1,4)-(1,6)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (1,4)-(1,5) = "\"" + │ │ ├── content_loc: (1,5)-(1,5) = "" + │ │ ├── closing_loc: (1,5)-(1,6) = "\"" + │ │ └── unescaped: "" + │ ├── consequent: + │ │ @ ElseNode (location: (1,6)-(1,9)) + │ │ ├── else_keyword_loc: (1,6)-(1,7) = ":" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (1,8)-(1,9)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (1,8)-(1,9)) + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── message_loc: (1,8)-(1,9) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── block: ∅ + │ │ │ ├── flags: variable_call + │ │ │ └── name: "b" + │ │ └── end_keyword_loc: ∅ + │ └── end_keyword_loc: ∅ + └── @ IfNode (location: (3,0)-(3,9)) + ├── if_keyword_loc: ∅ + ├── predicate: + │ @ CallNode (location: (3,0)-(3,1)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (3,0)-(3,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "a" + ├── statements: + │ @ StatementsNode (location: (3,4)-(3,6)) + │ └── body: (length: 1) + │ └── @ StringNode (location: (3,4)-(3,6)) + │ ├── flags: ∅ + │ ├── opening_loc: (3,4)-(3,5) = "'" + │ ├── content_loc: (3,5)-(3,5) = "" + │ ├── closing_loc: (3,5)-(3,6) = "'" + │ └── unescaped: "" + ├── consequent: + │ @ ElseNode (location: (3,6)-(3,9)) + │ ├── else_keyword_loc: (3,6)-(3,7) = ":" + │ ├── statements: + │ │ @ StatementsNode (location: (3,8)-(3,9)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (3,8)-(3,9)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (3,8)-(3,9) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "b" + │ └── end_keyword_loc: ∅ + └── end_keyword_loc: ∅ diff --git a/test/prism/snapshots/seattlerb/bug202.txt b/test/prism/snapshots/seattlerb/bug202.txt new file mode 100644 index 0000000000..3faff193dc --- /dev/null +++ b/test/prism/snapshots/seattlerb/bug202.txt @@ -0,0 +1,20 @@ +@ ProgramNode (location: (1,0)-(2,10)) +├── locals: [:测试] +└── statements: + @ StatementsNode (location: (1,0)-(2,10)) + └── body: (length: 2) + ├── @ GlobalVariableWriteNode (location: (1,0)-(1,11)) + │ ├── name: :$测试 + │ ├── name_loc: (1,0)-(1,7) = "$测试" + │ ├── value: + │ │ @ IntegerNode (location: (1,10)-(1,11)) + │ │ └── flags: decimal + │ └── operator_loc: (1,8)-(1,9) = "=" + └── @ LocalVariableWriteNode (location: (2,0)-(2,10)) + ├── name: :测试 + ├── depth: 0 + ├── name_loc: (2,0)-(2,6) = "测试" + ├── value: + │ @ IntegerNode (location: (2,9)-(2,10)) + │ └── flags: decimal + └── operator_loc: (2,7)-(2,8) = "=" diff --git a/test/prism/snapshots/seattlerb/bug236.txt b/test/prism/snapshots/seattlerb/bug236.txt new file mode 100644 index 0000000000..c53055bae0 --- /dev/null +++ b/test/prism/snapshots/seattlerb/bug236.txt @@ -0,0 +1,71 @@ +@ ProgramNode (location: (1,0)-(3,6)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,6)) + └── body: (length: 2) + ├── @ CallNode (location: (1,0)-(1,7)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,0)-(1,1) = "x" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: + │ │ @ BlockNode (location: (1,1)-(1,7)) + │ │ ├── locals: [:a] + │ │ ├── parameters: + │ │ │ @ BlockParametersNode (location: (1,2)-(1,6)) + │ │ │ ├── parameters: + │ │ │ │ @ ParametersNode (location: (1,3)-(1,5)) + │ │ │ │ ├── requireds: (length: 1) + │ │ │ │ │ └── @ RequiredParameterNode (location: (1,3)-(1,4)) + │ │ │ │ │ └── name: :a + │ │ │ │ ├── optionals: (length: 0) + │ │ │ │ ├── rest: + │ │ │ │ │ @ RestParameterNode (location: (1,4)-(1,5)) + │ │ │ │ │ ├── name: nil + │ │ │ │ │ ├── name_loc: ∅ + │ │ │ │ │ └── operator_loc: (1,4)-(1,5) = "," + │ │ │ │ ├── posts: (length: 0) + │ │ │ │ ├── keywords: (length: 0) + │ │ │ │ ├── keyword_rest: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── locals: (length: 0) + │ │ │ ├── opening_loc: (1,2)-(1,3) = "|" + │ │ │ └── closing_loc: (1,5)-(1,6) = "|" + │ │ ├── body: ∅ + │ │ ├── opening_loc: (1,1)-(1,2) = "{" + │ │ └── closing_loc: (1,6)-(1,7) = "}" + │ ├── flags: ∅ + │ └── name: "x" + └── @ CallNode (location: (3,0)-(3,6)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (3,0)-(3,1) = "x" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (3,1)-(3,6)) + │ ├── locals: [:a] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (3,2)-(3,5)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (3,3)-(3,4)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (3,3)-(3,4)) + │ │ │ │ └── name: :a + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (3,2)-(3,3) = "|" + │ │ └── closing_loc: (3,4)-(3,5) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (3,1)-(3,2) = "{" + │ └── closing_loc: (3,5)-(3,6) = "}" + ├── flags: ∅ + └── name: "x" diff --git a/test/prism/snapshots/seattlerb/bug290.txt b/test/prism/snapshots/seattlerb/bug290.txt new file mode 100644 index 0000000000..dbe69a5a15 --- /dev/null +++ b/test/prism/snapshots/seattlerb/bug290.txt @@ -0,0 +1,24 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ BeginNode (location: (1,0)-(3,3)) + ├── begin_keyword_loc: (1,0)-(1,5) = "begin" + ├── statements: + │ @ StatementsNode (location: (2,2)-(2,5)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (2,2)-(2,5)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (2,2)-(2,5) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "foo" + ├── rescue_clause: ∅ + ├── else_clause: ∅ + ├── ensure_clause: ∅ + └── end_keyword_loc: (3,0)-(3,3) = "end" diff --git a/test/prism/snapshots/seattlerb/bug_187.txt b/test/prism/snapshots/seattlerb/bug_187.txt new file mode 100644 index 0000000000..0f55dc049c --- /dev/null +++ b/test/prism/snapshots/seattlerb/bug_187.txt @@ -0,0 +1,58 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(3,3)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,7) = "private" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,8)-(3,3)) + │ └── arguments: (length: 1) + │ └── @ DefNode (location: (1,8)-(3,3)) + │ ├── name: :f + │ ├── name_loc: (1,12)-(1,13) = "f" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (2,0)-(2,10)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (2,0)-(2,10)) + │ │ ├── receiver: + │ │ │ @ CallNode (location: (2,0)-(2,1)) + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── message_loc: (2,0)-(2,1) = "a" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── block: ∅ + │ │ │ ├── flags: variable_call + │ │ │ └── name: "a" + │ │ ├── call_operator_loc: (2,1)-(2,2) = "." + │ │ ├── message_loc: (2,2)-(2,3) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: + │ │ │ @ BlockNode (location: (2,4)-(2,10)) + │ │ │ ├── locals: [] + │ │ │ ├── parameters: ∅ + │ │ │ ├── body: ∅ + │ │ │ ├── opening_loc: (2,4)-(2,6) = "do" + │ │ │ └── closing_loc: (2,7)-(2,10) = "end" + │ │ ├── flags: ∅ + │ │ └── name: "b" + │ ├── locals: [] + │ ├── def_keyword_loc: (1,8)-(1,11) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (3,0)-(3,3) = "end" + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "private" diff --git a/test/prism/snapshots/seattlerb/bug_215.txt b/test/prism/snapshots/seattlerb/bug_215.txt new file mode 100644 index 0000000000..0ce43b58de --- /dev/null +++ b/test/prism/snapshots/seattlerb/bug_215.txt @@ -0,0 +1,13 @@ +@ ProgramNode (location: (1,0)-(1,13)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,13)) + └── body: (length: 1) + └── @ UndefNode (location: (1,0)-(1,13)) + ├── names: (length: 1) + │ └── @ SymbolNode (location: (1,6)-(1,13)) + │ ├── opening_loc: (1,6)-(1,9) = "%s(" + │ ├── value_loc: (1,9)-(1,12) = "foo" + │ ├── closing_loc: (1,12)-(1,13) = ")" + │ └── unescaped: "foo" + └── keyword_loc: (1,0)-(1,5) = "undef" diff --git a/test/prism/snapshots/seattlerb/bug_249.txt b/test/prism/snapshots/seattlerb/bug_249.txt new file mode 100644 index 0000000000..3fd204a71b --- /dev/null +++ b/test/prism/snapshots/seattlerb/bug_249.txt @@ -0,0 +1,83 @@ +@ ProgramNode (location: (1,0)-(4,28)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,28)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(4,28)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,5) = "mount" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,6)-(4,28)) + │ └── arguments: (length: 2) + │ ├── @ CallNode (location: (1,6)-(4,9)) + │ │ ├── receiver: + │ │ │ @ ParenthesesNode (location: (1,6)-(4,5)) + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (1,7)-(4,4)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (1,7)-(4,4)) + │ │ │ │ ├── receiver: + │ │ │ │ │ @ ConstantReadNode (location: (1,7)-(1,12)) + │ │ │ │ │ └── name: :Class + │ │ │ │ ├── call_operator_loc: (1,12)-(1,13) = "." + │ │ │ │ ├── message_loc: (1,13)-(1,16) = "new" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── block: + │ │ │ │ │ @ BlockNode (location: (1,17)-(4,4)) + │ │ │ │ │ ├── locals: [] + │ │ │ │ │ ├── parameters: ∅ + │ │ │ │ │ ├── body: + │ │ │ │ │ │ @ StatementsNode (location: (2,0)-(3,3)) + │ │ │ │ │ │ └── body: (length: 1) + │ │ │ │ │ │ └── @ DefNode (location: (2,0)-(3,3)) + │ │ │ │ │ │ ├── name: :initialize + │ │ │ │ │ │ ├── name_loc: (2,4)-(2,14) = "initialize" + │ │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ │ ├── parameters: ∅ + │ │ │ │ │ │ ├── body: ∅ + │ │ │ │ │ │ ├── locals: [] + │ │ │ │ │ │ ├── def_keyword_loc: (2,0)-(2,3) = "def" + │ │ │ │ │ │ ├── operator_loc: ∅ + │ │ │ │ │ │ ├── lparen_loc: ∅ + │ │ │ │ │ │ ├── rparen_loc: ∅ + │ │ │ │ │ │ ├── equal_loc: ∅ + │ │ │ │ │ │ └── end_keyword_loc: (3,0)-(3,3) = "end" + │ │ │ │ │ ├── opening_loc: (1,17)-(1,19) = "do" + │ │ │ │ │ └── closing_loc: (4,1)-(4,4) = "end" + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: "new" + │ │ │ ├── opening_loc: (1,6)-(1,7) = "(" + │ │ │ └── closing_loc: (4,4)-(4,5) = ")" + │ │ ├── call_operator_loc: (4,5)-(4,6) = "." + │ │ ├── message_loc: (4,6)-(4,9) = "new" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: ∅ + │ │ └── name: "new" + │ └── @ KeywordHashNode (location: (4,11)-(4,28)) + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (4,11)-(4,28)) + │ ├── key: + │ │ @ SymbolNode (location: (4,11)-(4,14)) + │ │ ├── opening_loc: (4,11)-(4,12) = ":" + │ │ ├── value_loc: (4,12)-(4,14) = "at" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "at" + │ ├── value: + │ │ @ StringNode (location: (4,18)-(4,28)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (4,18)-(4,19) = "'" + │ │ ├── content_loc: (4,19)-(4,27) = "endpoint" + │ │ ├── closing_loc: (4,27)-(4,28) = "'" + │ │ └── unescaped: "endpoint" + │ └── operator_loc: (4,15)-(4,17) = "=>" + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "mount" diff --git a/test/prism/snapshots/seattlerb/bug_and.txt b/test/prism/snapshots/seattlerb/bug_and.txt new file mode 100644 index 0000000000..49c387a72d --- /dev/null +++ b/test/prism/snapshots/seattlerb/bug_and.txt @@ -0,0 +1,20 @@ +@ ProgramNode (location: (1,0)-(4,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,11)) + └── body: (length: 2) + ├── @ AndNode (location: (1,0)-(2,4)) + │ ├── left: + │ │ @ TrueNode (location: (1,0)-(1,4)) + │ ├── right: + │ │ @ TrueNode (location: (2,0)-(2,4)) + │ └── operator_loc: (1,5)-(1,8) = "and" + └── @ AndNode (location: (4,0)-(4,11)) + ├── left: + │ @ TrueNode (location: (4,0)-(4,4)) + ├── right: + │ @ ArrayNode (location: (4,9)-(4,11)) + │ ├── elements: (length: 0) + │ ├── opening_loc: (4,9)-(4,10) = "[" + │ └── closing_loc: (4,10)-(4,11) = "]" + └── operator_loc: (4,5)-(4,8) = "and" diff --git a/test/prism/snapshots/seattlerb/bug_args__19.txt b/test/prism/snapshots/seattlerb/bug_args__19.txt new file mode 100644 index 0000000000..45abd4c0e4 --- /dev/null +++ b/test/prism/snapshots/seattlerb/bug_args__19.txt @@ -0,0 +1,54 @@ +@ ProgramNode (location: (1,0)-(1,16)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,16)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,16)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,16)) + │ ├── locals: [:a, :b] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,12)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,11)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredDestructuredParameterNode (location: (1,5)-(1,11)) + │ │ │ │ ├── parameters: (length: 2) + │ │ │ │ │ ├── @ RequiredParameterNode (location: (1,6)-(1,7)) + │ │ │ │ │ │ └── name: :a + │ │ │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ │ │ └── name: :b + │ │ │ │ ├── opening_loc: (1,5)-(1,6) = "(" + │ │ │ │ └── closing_loc: (1,10)-(1,11) = ")" + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,11)-(1,12) = "|" + │ ├── body: + │ │ @ StatementsNode (location: (1,13)-(1,14)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (1,13)-(1,14)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,13)-(1,14) = "d" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "d" + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,15)-(1,16) = "}" + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/bug_args_masgn.txt b/test/prism/snapshots/seattlerb/bug_args_masgn.txt new file mode 100644 index 0000000000..748eb80f26 --- /dev/null +++ b/test/prism/snapshots/seattlerb/bug_args_masgn.txt @@ -0,0 +1,44 @@ +@ ProgramNode (location: (1,0)-(1,17)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,17)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,17)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,17)) + │ ├── locals: [:a, :b, :c] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,15)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,14)) + │ │ │ ├── requireds: (length: 2) + │ │ │ │ ├── @ RequiredDestructuredParameterNode (location: (1,5)-(1,11)) + │ │ │ │ │ ├── parameters: (length: 2) + │ │ │ │ │ │ ├── @ RequiredParameterNode (location: (1,6)-(1,7)) + │ │ │ │ │ │ │ └── name: :a + │ │ │ │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ │ │ │ └── name: :b + │ │ │ │ │ ├── opening_loc: (1,5)-(1,6) = "(" + │ │ │ │ │ └── closing_loc: (1,10)-(1,11) = ")" + │ │ │ │ └── @ RequiredParameterNode (location: (1,13)-(1,14)) + │ │ │ │ └── name: :c + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,14)-(1,15) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,16)-(1,17) = "}" + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/bug_args_masgn2.txt b/test/prism/snapshots/seattlerb/bug_args_masgn2.txt new file mode 100644 index 0000000000..b4e786c7c2 --- /dev/null +++ b/test/prism/snapshots/seattlerb/bug_args_masgn2.txt @@ -0,0 +1,50 @@ +@ ProgramNode (location: (1,0)-(1,22)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,22)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,22)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,22)) + │ ├── locals: [:a, :b, :c, :d] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,20)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,19)) + │ │ │ ├── requireds: (length: 2) + │ │ │ │ ├── @ RequiredDestructuredParameterNode (location: (1,5)-(1,16)) + │ │ │ │ │ ├── parameters: (length: 2) + │ │ │ │ │ │ ├── @ RequiredDestructuredParameterNode (location: (1,6)-(1,12)) + │ │ │ │ │ │ │ ├── parameters: (length: 2) + │ │ │ │ │ │ │ │ ├── @ RequiredParameterNode (location: (1,7)-(1,8)) + │ │ │ │ │ │ │ │ │ └── name: :a + │ │ │ │ │ │ │ │ └── @ RequiredParameterNode (location: (1,10)-(1,11)) + │ │ │ │ │ │ │ │ └── name: :b + │ │ │ │ │ │ │ ├── opening_loc: (1,6)-(1,7) = "(" + │ │ │ │ │ │ │ └── closing_loc: (1,11)-(1,12) = ")" + │ │ │ │ │ │ └── @ RequiredParameterNode (location: (1,14)-(1,15)) + │ │ │ │ │ │ └── name: :c + │ │ │ │ │ ├── opening_loc: (1,5)-(1,6) = "(" + │ │ │ │ │ └── closing_loc: (1,15)-(1,16) = ")" + │ │ │ │ └── @ RequiredParameterNode (location: (1,18)-(1,19)) + │ │ │ │ └── name: :d + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,19)-(1,20) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,21)-(1,22) = "}" + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/bug_args_masgn_outer_parens__19.txt b/test/prism/snapshots/seattlerb/bug_args_masgn_outer_parens__19.txt new file mode 100644 index 0000000000..61eacf4421 --- /dev/null +++ b/test/prism/snapshots/seattlerb/bug_args_masgn_outer_parens__19.txt @@ -0,0 +1,48 @@ +@ ProgramNode (location: (1,0)-(1,19)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,19)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,19)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,19)) + │ ├── locals: [:k, :v, :i] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,17)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,16)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredDestructuredParameterNode (location: (1,5)-(1,16)) + │ │ │ │ ├── parameters: (length: 2) + │ │ │ │ │ ├── @ RequiredDestructuredParameterNode (location: (1,6)-(1,12)) + │ │ │ │ │ │ ├── parameters: (length: 2) + │ │ │ │ │ │ │ ├── @ RequiredParameterNode (location: (1,7)-(1,8)) + │ │ │ │ │ │ │ │ └── name: :k + │ │ │ │ │ │ │ └── @ RequiredParameterNode (location: (1,10)-(1,11)) + │ │ │ │ │ │ │ └── name: :v + │ │ │ │ │ │ ├── opening_loc: (1,6)-(1,7) = "(" + │ │ │ │ │ │ └── closing_loc: (1,11)-(1,12) = ")" + │ │ │ │ │ └── @ RequiredParameterNode (location: (1,14)-(1,15)) + │ │ │ │ │ └── name: :i + │ │ │ │ ├── opening_loc: (1,5)-(1,6) = "(" + │ │ │ │ └── closing_loc: (1,15)-(1,16) = ")" + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,16)-(1,17) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,18)-(1,19) = "}" + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/bug_call_arglist_parens.txt b/test/prism/snapshots/seattlerb/bug_call_arglist_parens.txt new file mode 100644 index 0000000000..3a7d533238 --- /dev/null +++ b/test/prism/snapshots/seattlerb/bug_call_arglist_parens.txt @@ -0,0 +1,101 @@ +@ ProgramNode (location: (1,6)-(11,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,6)-(11,9)) + └── body: (length: 3) + ├── @ DefNode (location: (1,6)-(3,9)) + │ ├── name: :f + │ ├── name_loc: (1,10)-(1,11) = "f" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (2,8)-(2,17)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (2,8)-(2,17)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (2,8)-(2,9) = "g" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (2,10)-(2,17)) + │ │ │ └── arguments: (length: 2) + │ │ │ ├── @ ParenthesesNode (location: (2,10)-(2,14)) + │ │ │ │ ├── body: + │ │ │ │ │ @ StatementsNode (location: (2,12)-(2,13)) + │ │ │ │ │ └── body: (length: 1) + │ │ │ │ │ └── @ IntegerNode (location: (2,12)-(2,13)) + │ │ │ │ │ └── flags: decimal + │ │ │ │ ├── opening_loc: (2,10)-(2,11) = "(" + │ │ │ │ └── closing_loc: (2,13)-(2,14) = ")" + │ │ │ └── @ IntegerNode (location: (2,16)-(2,17)) + │ │ │ └── flags: decimal + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: ∅ + │ │ └── name: "g" + │ ├── locals: [] + │ ├── def_keyword_loc: (1,6)-(1,9) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (3,6)-(3,9) = "end" + ├── @ DefNode (location: (6,6)-(8,9)) + │ ├── name: :f + │ ├── name_loc: (6,10)-(6,11) = "f" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (7,8)-(7,16)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (7,8)-(7,16)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (7,8)-(7,9) = "g" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (7,10)-(7,16)) + │ │ │ └── arguments: (length: 2) + │ │ │ ├── @ ParenthesesNode (location: (7,10)-(7,13)) + │ │ │ │ ├── body: + │ │ │ │ │ @ StatementsNode (location: (7,11)-(7,12)) + │ │ │ │ │ └── body: (length: 1) + │ │ │ │ │ └── @ IntegerNode (location: (7,11)-(7,12)) + │ │ │ │ │ └── flags: decimal + │ │ │ │ ├── opening_loc: (7,10)-(7,11) = "(" + │ │ │ │ └── closing_loc: (7,12)-(7,13) = ")" + │ │ │ └── @ IntegerNode (location: (7,15)-(7,16)) + │ │ │ └── flags: decimal + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: ∅ + │ │ └── name: "g" + │ ├── locals: [] + │ ├── def_keyword_loc: (6,6)-(6,9) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (6,11)-(6,12) = "(" + │ ├── rparen_loc: (6,12)-(6,13) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (8,6)-(8,9) = "end" + └── @ CallNode (location: (11,0)-(11,9)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (11,0)-(11,1) = "g" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (11,2)-(11,9)) + │ └── arguments: (length: 2) + │ ├── @ ParenthesesNode (location: (11,2)-(11,6)) + │ │ ├── body: + │ │ │ @ StatementsNode (location: (11,4)-(11,5)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ IntegerNode (location: (11,4)-(11,5)) + │ │ │ └── flags: decimal + │ │ ├── opening_loc: (11,2)-(11,3) = "(" + │ │ └── closing_loc: (11,5)-(11,6) = ")" + │ └── @ IntegerNode (location: (11,8)-(11,9)) + │ └── flags: decimal + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "g" diff --git a/test/prism/snapshots/seattlerb/bug_case_when_regexp.txt b/test/prism/snapshots/seattlerb/bug_case_when_regexp.txt new file mode 100644 index 0000000000..ac948bc6c9 --- /dev/null +++ b/test/prism/snapshots/seattlerb/bug_case_when_regexp.txt @@ -0,0 +1,26 @@ +@ ProgramNode (location: (1,0)-(1,26)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,26)) + └── body: (length: 1) + └── @ CaseNode (location: (1,0)-(1,26)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── opening_loc: (1,5)-(1,6) = ":" + │ ├── value_loc: (1,6)-(1,7) = "x" + │ ├── closing_loc: ∅ + │ └── unescaped: "x" + ├── conditions: (length: 1) + │ └── @ WhenNode (location: (1,9)-(1,17)) + │ ├── keyword_loc: (1,9)-(1,13) = "when" + │ ├── conditions: (length: 1) + │ │ └── @ RegularExpressionNode (location: (1,14)-(1,17)) + │ │ ├── opening_loc: (1,14)-(1,15) = "/" + │ │ ├── content_loc: (1,15)-(1,16) = "x" + │ │ ├── closing_loc: (1,16)-(1,17) = "/" + │ │ ├── unescaped: "x" + │ │ └── flags: ∅ + │ └── statements: ∅ + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (1,23)-(1,26) = "end" diff --git a/test/prism/snapshots/seattlerb/bug_comma.txt b/test/prism/snapshots/seattlerb/bug_comma.txt new file mode 100644 index 0000000000..07ec02b232 --- /dev/null +++ b/test/prism/snapshots/seattlerb/bug_comma.txt @@ -0,0 +1,39 @@ +@ ProgramNode (location: (1,0)-(1,24)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,24)) + └── body: (length: 1) + └── @ IfNode (location: (1,0)-(1,24)) + ├── if_keyword_loc: (1,0)-(1,2) = "if" + ├── predicate: + │ @ CallNode (location: (1,3)-(1,15)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,3)-(1,7) = "test" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,8)-(1,15)) + │ │ └── arguments: (length: 2) + │ │ ├── @ StringNode (location: (1,8)-(1,10)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (1,8)-(1,9) = "?" + │ │ │ ├── content_loc: (1,9)-(1,10) = "d" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "d" + │ │ └── @ CallNode (location: (1,12)-(1,15)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,12)-(1,15) = "dir" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "dir" + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "test" + ├── statements: ∅ + ├── consequent: ∅ + └── end_keyword_loc: (1,21)-(1,24) = "end" diff --git a/test/prism/snapshots/seattlerb/bug_cond_pct.txt b/test/prism/snapshots/seattlerb/bug_cond_pct.txt new file mode 100644 index 0000000000..bb07f009aa --- /dev/null +++ b/test/prism/snapshots/seattlerb/bug_cond_pct.txt @@ -0,0 +1,21 @@ +@ ProgramNode (location: (1,0)-(1,28)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,28)) + └── body: (length: 1) + └── @ CaseNode (location: (1,0)-(1,28)) + ├── predicate: ∅ + ├── conditions: (length: 1) + │ └── @ WhenNode (location: (1,6)-(1,23)) + │ ├── keyword_loc: (1,6)-(1,10) = "when" + │ ├── conditions: (length: 1) + │ │ └── @ RegularExpressionNode (location: (1,11)-(1,23)) + │ │ ├── opening_loc: (1,11)-(1,14) = "%r%" + │ │ ├── content_loc: (1,14)-(1,22) = "blahblah" + │ │ ├── closing_loc: (1,22)-(1,23) = "%" + │ │ ├── unescaped: "blahblah" + │ │ └── flags: ∅ + │ └── statements: ∅ + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (1,25)-(1,28) = "end" diff --git a/test/prism/snapshots/seattlerb/bug_hash_args.txt b/test/prism/snapshots/seattlerb/bug_hash_args.txt new file mode 100644 index 0000000000..3a204fb4b8 --- /dev/null +++ b/test/prism/snapshots/seattlerb/bug_hash_args.txt @@ -0,0 +1,34 @@ +@ ProgramNode (location: (1,0)-(1,19)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,19)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,19)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,3) = "foo" + ├── opening_loc: (1,3)-(1,4) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,4)-(1,18)) + │ └── arguments: (length: 2) + │ ├── @ SymbolNode (location: (1,4)-(1,8)) + │ │ ├── opening_loc: (1,4)-(1,5) = ":" + │ │ ├── value_loc: (1,5)-(1,8) = "bar" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "bar" + │ └── @ KeywordHashNode (location: (1,10)-(1,18)) + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (1,10)-(1,18)) + │ ├── key: + │ │ @ SymbolNode (location: (1,10)-(1,14)) + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (1,10)-(1,13) = "baz" + │ │ ├── closing_loc: (1,13)-(1,14) = ":" + │ │ └── unescaped: "baz" + │ ├── value: + │ │ @ NilNode (location: (1,15)-(1,18)) + │ └── operator_loc: ∅ + ├── closing_loc: (1,18)-(1,19) = ")" + ├── block: ∅ + ├── flags: ∅ + └── name: "foo" diff --git a/test/prism/snapshots/seattlerb/bug_hash_args_trailing_comma.txt b/test/prism/snapshots/seattlerb/bug_hash_args_trailing_comma.txt new file mode 100644 index 0000000000..73bc04243d --- /dev/null +++ b/test/prism/snapshots/seattlerb/bug_hash_args_trailing_comma.txt @@ -0,0 +1,34 @@ +@ ProgramNode (location: (1,0)-(1,20)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,20)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,20)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,3) = "foo" + ├── opening_loc: (1,3)-(1,4) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,4)-(1,18)) + │ └── arguments: (length: 2) + │ ├── @ SymbolNode (location: (1,4)-(1,8)) + │ │ ├── opening_loc: (1,4)-(1,5) = ":" + │ │ ├── value_loc: (1,5)-(1,8) = "bar" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "bar" + │ └── @ KeywordHashNode (location: (1,10)-(1,18)) + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (1,10)-(1,18)) + │ ├── key: + │ │ @ SymbolNode (location: (1,10)-(1,14)) + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (1,10)-(1,13) = "baz" + │ │ ├── closing_loc: (1,13)-(1,14) = ":" + │ │ └── unescaped: "baz" + │ ├── value: + │ │ @ NilNode (location: (1,15)-(1,18)) + │ └── operator_loc: ∅ + ├── closing_loc: (1,19)-(1,20) = ")" + ├── block: ∅ + ├── flags: ∅ + └── name: "foo" diff --git a/test/prism/snapshots/seattlerb/bug_hash_interp_array.txt b/test/prism/snapshots/seattlerb/bug_hash_interp_array.txt new file mode 100644 index 0000000000..e4b9536b87 --- /dev/null +++ b/test/prism/snapshots/seattlerb/bug_hash_interp_array.txt @@ -0,0 +1,25 @@ +@ ProgramNode (location: (1,0)-(1,13)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,13)) + └── body: (length: 1) + └── @ HashNode (location: (1,0)-(1,13)) + ├── opening_loc: (1,0)-(1,1) = "{" + ├── elements: (length: 1) + │ └── @ AssocNode (location: (1,2)-(1,11)) + │ ├── key: + │ │ @ InterpolatedSymbolNode (location: (1,2)-(1,8)) + │ │ ├── opening_loc: (1,2)-(1,3) = "\"" + │ │ ├── parts: (length: 1) + │ │ │ └── @ EmbeddedStatementsNode (location: (1,3)-(1,6)) + │ │ │ ├── opening_loc: (1,3)-(1,5) = "\#{" + │ │ │ ├── statements: ∅ + │ │ │ └── closing_loc: (1,5)-(1,6) = "}" + │ │ └── closing_loc: (1,6)-(1,8) = "\":" + │ ├── value: + │ │ @ ArrayNode (location: (1,9)-(1,11)) + │ │ ├── elements: (length: 0) + │ │ ├── opening_loc: (1,9)-(1,10) = "[" + │ │ └── closing_loc: (1,10)-(1,11) = "]" + │ └── operator_loc: ∅ + └── closing_loc: (1,12)-(1,13) = "}" diff --git a/test/prism/snapshots/seattlerb/bug_masgn_right.txt b/test/prism/snapshots/seattlerb/bug_masgn_right.txt new file mode 100644 index 0000000000..c19931cdd1 --- /dev/null +++ b/test/prism/snapshots/seattlerb/bug_masgn_right.txt @@ -0,0 +1,44 @@ +@ ProgramNode (location: (1,0)-(1,17)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,17)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,17)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,17)) + │ ├── locals: [:a, :b, :c] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,15)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,14)) + │ │ │ ├── requireds: (length: 2) + │ │ │ │ ├── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ │ │ └── name: :a + │ │ │ │ └── @ RequiredDestructuredParameterNode (location: (1,8)-(1,14)) + │ │ │ │ ├── parameters: (length: 2) + │ │ │ │ │ ├── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ │ │ │ └── name: :b + │ │ │ │ │ └── @ RequiredParameterNode (location: (1,12)-(1,13)) + │ │ │ │ │ └── name: :c + │ │ │ │ ├── opening_loc: (1,8)-(1,9) = "(" + │ │ │ │ └── closing_loc: (1,13)-(1,14) = ")" + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,14)-(1,15) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,16)-(1,17) = "}" + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/bug_not_parens.txt b/test/prism/snapshots/seattlerb/bug_not_parens.txt new file mode 100644 index 0000000000..8b937728d0 --- /dev/null +++ b/test/prism/snapshots/seattlerb/bug_not_parens.txt @@ -0,0 +1,25 @@ +@ ProgramNode (location: (1,0)-(1,6)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,6)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,6)) + ├── receiver: + │ @ CallNode (location: (1,4)-(1,5)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,4)-(1,5) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "a" + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,3) = "not" + ├── opening_loc: (1,3)-(1,4) = "(" + ├── arguments: ∅ + ├── closing_loc: (1,5)-(1,6) = ")" + ├── block: ∅ + ├── flags: ∅ + └── name: "!" diff --git a/test/prism/snapshots/seattlerb/bug_op_asgn_rescue.txt b/test/prism/snapshots/seattlerb/bug_op_asgn_rescue.txt new file mode 100644 index 0000000000..c3df9b1be9 --- /dev/null +++ b/test/prism/snapshots/seattlerb/bug_op_asgn_rescue.txt @@ -0,0 +1,26 @@ +@ ProgramNode (location: (1,0)-(1,18)) +├── locals: [:a] +└── statements: + @ StatementsNode (location: (1,0)-(1,18)) + └── body: (length: 1) + └── @ LocalVariableOrWriteNode (location: (1,0)-(1,18)) + ├── name_loc: (1,0)-(1,1) = "a" + ├── operator_loc: (1,2)-(1,5) = "||=" + ├── value: + │ @ RescueModifierNode (location: (1,6)-(1,18)) + │ ├── expression: + │ │ @ CallNode (location: (1,6)-(1,7)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,6)-(1,7) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "b" + │ ├── keyword_loc: (1,8)-(1,14) = "rescue" + │ └── rescue_expression: + │ @ NilNode (location: (1,15)-(1,18)) + ├── name: :a + └── depth: 0 diff --git a/test/prism/snapshots/seattlerb/call_and.txt b/test/prism/snapshots/seattlerb/call_and.txt new file mode 100644 index 0000000000..009eb877d0 --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_and.txt @@ -0,0 +1,21 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,5)) + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ └── flags: decimal + ├── call_operator_loc: ∅ + ├── message_loc: (1,2)-(1,3) = "&" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,4)-(1,5)) + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,4)-(1,5)) + │ └── flags: decimal + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "&" diff --git a/test/prism/snapshots/seattlerb/call_arg_assoc.txt b/test/prism/snapshots/seattlerb/call_arg_assoc.txt new file mode 100644 index 0000000000..2f7f20b2d9 --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_arg_assoc.txt @@ -0,0 +1,29 @@ +@ ProgramNode (location: (1,0)-(1,10)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,10)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,10)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: (1,1)-(1,2) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,9)) + │ └── arguments: (length: 2) + │ ├── @ IntegerNode (location: (1,2)-(1,3)) + │ │ └── flags: decimal + │ └── @ KeywordHashNode (location: (1,5)-(1,9)) + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (1,5)-(1,9)) + │ ├── key: + │ │ @ IntegerNode (location: (1,5)-(1,6)) + │ │ └── flags: decimal + │ ├── value: + │ │ @ IntegerNode (location: (1,8)-(1,9)) + │ │ └── flags: decimal + │ └── operator_loc: (1,6)-(1,8) = "=>" + ├── closing_loc: (1,9)-(1,10) = ")" + ├── block: ∅ + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/call_arg_assoc_kwsplat.txt b/test/prism/snapshots/seattlerb/call_arg_assoc_kwsplat.txt new file mode 100644 index 0000000000..f477f046ac --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_arg_assoc_kwsplat.txt @@ -0,0 +1,37 @@ +@ ProgramNode (location: (1,0)-(1,16)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,16)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,16)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: (1,1)-(1,2) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,15)) + │ └── arguments: (length: 2) + │ ├── @ IntegerNode (location: (1,2)-(1,3)) + │ │ └── flags: decimal + │ └── @ KeywordHashNode (location: (1,5)-(1,15)) + │ └── elements: (length: 2) + │ ├── @ AssocNode (location: (1,5)-(1,10)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (1,5)-(1,8)) + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (1,5)-(1,7) = "kw" + │ │ │ ├── closing_loc: (1,7)-(1,8) = ":" + │ │ │ └── unescaped: "kw" + │ │ ├── value: + │ │ │ @ IntegerNode (location: (1,9)-(1,10)) + │ │ │ └── flags: decimal + │ │ └── operator_loc: ∅ + │ └── @ AssocSplatNode (location: (1,12)-(1,15)) + │ ├── value: + │ │ @ IntegerNode (location: (1,14)-(1,15)) + │ │ └── flags: decimal + │ └── operator_loc: (1,12)-(1,14) = "**" + ├── closing_loc: (1,15)-(1,16) = ")" + ├── block: ∅ + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/call_arg_kwsplat.txt b/test/prism/snapshots/seattlerb/call_arg_kwsplat.txt new file mode 100644 index 0000000000..6ebfe62964 --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_arg_kwsplat.txt @@ -0,0 +1,34 @@ +@ ProgramNode (location: (1,0)-(1,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,9)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,9)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: (1,1)-(1,2) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,8)) + │ └── arguments: (length: 2) + │ ├── @ CallNode (location: (1,2)-(1,3)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,2)-(1,3) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "b" + │ └── @ KeywordHashNode (location: (1,5)-(1,8)) + │ └── elements: (length: 1) + │ └── @ AssocSplatNode (location: (1,5)-(1,8)) + │ ├── value: + │ │ @ IntegerNode (location: (1,7)-(1,8)) + │ │ └── flags: decimal + │ └── operator_loc: (1,5)-(1,7) = "**" + ├── closing_loc: (1,8)-(1,9) = ")" + ├── block: ∅ + ├── flags: ∅ + └── name: "a" diff --git a/test/prism/snapshots/seattlerb/call_args_assoc_quoted.txt b/test/prism/snapshots/seattlerb/call_args_assoc_quoted.txt new file mode 100644 index 0000000000..095bab4ce1 --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_args_assoc_quoted.txt @@ -0,0 +1,95 @@ +@ ProgramNode (location: (1,0)-(5,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(5,8)) + └── body: (length: 3) + ├── @ CallNode (location: (1,0)-(1,11)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,0)-(1,1) = "x" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,2)-(1,11)) + │ │ └── arguments: (length: 1) + │ │ └── @ KeywordHashNode (location: (1,2)-(1,11)) + │ │ └── elements: (length: 1) + │ │ └── @ AssocNode (location: (1,2)-(1,11)) + │ │ ├── key: + │ │ │ @ InterpolatedSymbolNode (location: (1,2)-(1,9)) + │ │ │ ├── opening_loc: (1,2)-(1,3) = "\"" + │ │ │ ├── parts: (length: 1) + │ │ │ │ └── @ EmbeddedStatementsNode (location: (1,3)-(1,7)) + │ │ │ │ ├── opening_loc: (1,3)-(1,5) = "\#{" + │ │ │ │ ├── statements: + │ │ │ │ │ @ StatementsNode (location: (1,5)-(1,6)) + │ │ │ │ │ └── body: (length: 1) + │ │ │ │ │ └── @ CallNode (location: (1,5)-(1,6)) + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── message_loc: (1,5)-(1,6) = "k" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── block: ∅ + │ │ │ │ │ ├── flags: variable_call + │ │ │ │ │ └── name: "k" + │ │ │ │ └── closing_loc: (1,6)-(1,7) = "}" + │ │ │ └── closing_loc: (1,7)-(1,9) = "\":" + │ │ ├── value: + │ │ │ @ IntegerNode (location: (1,9)-(1,11)) + │ │ │ └── flags: decimal + │ │ └── operator_loc: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "x" + ├── @ CallNode (location: (3,0)-(3,8)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (3,0)-(3,1) = "x" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (3,2)-(3,8)) + │ │ └── arguments: (length: 1) + │ │ └── @ KeywordHashNode (location: (3,2)-(3,8)) + │ │ └── elements: (length: 1) + │ │ └── @ AssocNode (location: (3,2)-(3,8)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (3,2)-(3,6)) + │ │ │ ├── opening_loc: (3,2)-(3,3) = "\"" + │ │ │ ├── value_loc: (3,3)-(3,4) = "k" + │ │ │ ├── closing_loc: (3,4)-(3,6) = "\":" + │ │ │ └── unescaped: "k" + │ │ ├── value: + │ │ │ @ IntegerNode (location: (3,6)-(3,8)) + │ │ │ └── flags: decimal + │ │ └── operator_loc: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "x" + └── @ CallNode (location: (5,0)-(5,8)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (5,0)-(5,1) = "x" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (5,2)-(5,8)) + │ └── arguments: (length: 1) + │ └── @ KeywordHashNode (location: (5,2)-(5,8)) + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (5,2)-(5,8)) + │ ├── key: + │ │ @ SymbolNode (location: (5,2)-(5,6)) + │ │ ├── opening_loc: (5,2)-(5,3) = "'" + │ │ ├── value_loc: (5,3)-(5,4) = "k" + │ │ ├── closing_loc: (5,4)-(5,6) = "':" + │ │ └── unescaped: "k" + │ ├── value: + │ │ @ IntegerNode (location: (5,6)-(5,8)) + │ │ └── flags: decimal + │ └── operator_loc: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "x" diff --git a/test/prism/snapshots/seattlerb/call_args_assoc_trailing_comma.txt b/test/prism/snapshots/seattlerb/call_args_assoc_trailing_comma.txt new file mode 100644 index 0000000000..7af70d5832 --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_args_assoc_trailing_comma.txt @@ -0,0 +1,29 @@ +@ ProgramNode (location: (1,0)-(1,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,11)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,11)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: (1,1)-(1,2) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,9)) + │ └── arguments: (length: 2) + │ ├── @ IntegerNode (location: (1,2)-(1,3)) + │ │ └── flags: decimal + │ └── @ KeywordHashNode (location: (1,5)-(1,9)) + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (1,5)-(1,9)) + │ ├── key: + │ │ @ IntegerNode (location: (1,5)-(1,6)) + │ │ └── flags: decimal + │ ├── value: + │ │ @ IntegerNode (location: (1,8)-(1,9)) + │ │ └── flags: decimal + │ └── operator_loc: (1,6)-(1,8) = "=>" + ├── closing_loc: (1,10)-(1,11) = ")" + ├── block: ∅ + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/call_args_command.txt b/test/prism/snapshots/seattlerb/call_args_command.txt new file mode 100644 index 0000000000..dfd0e60fbd --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_args_command.txt @@ -0,0 +1,51 @@ +@ ProgramNode (location: (1,0)-(1,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,9)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,9)) + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "a" + ├── call_operator_loc: (1,1)-(1,2) = "." + ├── message_loc: (1,2)-(1,3) = "b" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,4)-(1,9)) + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (1,4)-(1,9)) + │ ├── receiver: + │ │ @ CallNode (location: (1,4)-(1,5)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,4)-(1,5) = "c" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "c" + │ ├── call_operator_loc: (1,5)-(1,6) = "." + │ ├── message_loc: (1,6)-(1,7) = "d" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,8)-(1,9)) + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (1,8)-(1,9)) + │ │ └── flags: decimal + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "d" + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "b" diff --git a/test/prism/snapshots/seattlerb/call_array_arg.txt b/test/prism/snapshots/seattlerb/call_array_arg.txt new file mode 100644 index 0000000000..f0bc196cf3 --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_array_arg.txt @@ -0,0 +1,33 @@ +@ ProgramNode (location: (1,0)-(1,13)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,13)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,13)) + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ └── flags: decimal + ├── call_operator_loc: ∅ + ├── message_loc: (1,2)-(1,4) = "==" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,5)-(1,13)) + │ └── arguments: (length: 1) + │ └── @ ArrayNode (location: (1,5)-(1,13)) + │ ├── elements: (length: 2) + │ │ ├── @ SymbolNode (location: (1,6)-(1,8)) + │ │ │ ├── opening_loc: (1,6)-(1,7) = ":" + │ │ │ ├── value_loc: (1,7)-(1,8) = "b" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "b" + │ │ └── @ SymbolNode (location: (1,10)-(1,12)) + │ │ ├── opening_loc: (1,10)-(1,11) = ":" + │ │ ├── value_loc: (1,11)-(1,12) = "c" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "c" + │ ├── opening_loc: (1,5)-(1,6) = "[" + │ └── closing_loc: (1,12)-(1,13) = "]" + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "==" diff --git a/test/prism/snapshots/seattlerb/call_array_block_call.txt b/test/prism/snapshots/seattlerb/call_array_block_call.txt new file mode 100644 index 0000000000..6c78b7f52c --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_array_block_call.txt @@ -0,0 +1,38 @@ +@ ProgramNode (location: (1,0)-(1,19)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,19)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,19)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,19)) + │ └── arguments: (length: 1) + │ └── @ ArrayNode (location: (1,2)-(1,19)) + │ ├── elements: (length: 2) + │ │ ├── @ NilNode (location: (1,4)-(1,7)) + │ │ └── @ CallNode (location: (1,9)-(1,17)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,9)-(1,10) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: + │ │ │ @ BlockNode (location: (1,11)-(1,17)) + │ │ │ ├── locals: [] + │ │ │ ├── parameters: ∅ + │ │ │ ├── body: ∅ + │ │ │ ├── opening_loc: (1,11)-(1,13) = "do" + │ │ │ └── closing_loc: (1,14)-(1,17) = "end" + │ │ ├── flags: ∅ + │ │ └── name: "b" + │ ├── opening_loc: (1,2)-(1,3) = "[" + │ └── closing_loc: (1,18)-(1,19) = "]" + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "a" diff --git a/test/prism/snapshots/seattlerb/call_array_lambda_block_call.txt b/test/prism/snapshots/seattlerb/call_array_lambda_block_call.txt new file mode 100644 index 0000000000..7b25a64419 --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_array_lambda_block_call.txt @@ -0,0 +1,39 @@ +@ ProgramNode (location: (1,0)-(2,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,3)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(2,3)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,11)) + │ └── arguments: (length: 1) + │ └── @ ArrayNode (location: (1,2)-(1,11)) + │ ├── elements: (length: 1) + │ │ └── @ LambdaNode (location: (1,3)-(1,10)) + │ │ ├── locals: [] + │ │ ├── operator_loc: (1,3)-(1,5) = "->" + │ │ ├── opening_loc: (1,8)-(1,9) = "{" + │ │ ├── closing_loc: (1,9)-(1,10) = "}" + │ │ ├── parameters: + │ │ │ @ BlockParametersNode (location: (1,5)-(1,7)) + │ │ │ ├── parameters: ∅ + │ │ │ ├── locals: (length: 0) + │ │ │ ├── opening_loc: (1,5)-(1,6) = "(" + │ │ │ └── closing_loc: (1,6)-(1,7) = ")" + │ │ └── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "[" + │ └── closing_loc: (1,10)-(1,11) = "]" + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,12)-(2,3)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── opening_loc: (1,12)-(1,14) = "do" + │ └── closing_loc: (2,0)-(2,3) = "end" + ├── flags: ∅ + └── name: "a" diff --git a/test/prism/snapshots/seattlerb/call_array_lit_inline_hash.txt b/test/prism/snapshots/seattlerb/call_array_lit_inline_hash.txt new file mode 100644 index 0000000000..6ce4c98d5f --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_array_lit_inline_hash.txt @@ -0,0 +1,39 @@ +@ ProgramNode (location: (1,0)-(1,16)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,16)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,16)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: (1,1)-(1,2) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,15)) + │ └── arguments: (length: 1) + │ └── @ ArrayNode (location: (1,2)-(1,15)) + │ ├── elements: (length: 2) + │ │ ├── @ SymbolNode (location: (1,3)-(1,5)) + │ │ │ ├── opening_loc: (1,3)-(1,4) = ":" + │ │ │ ├── value_loc: (1,4)-(1,5) = "b" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "b" + │ │ └── @ KeywordHashNode (location: (1,7)-(1,14)) + │ │ └── elements: (length: 1) + │ │ └── @ AssocNode (location: (1,7)-(1,14)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (1,7)-(1,9)) + │ │ │ ├── opening_loc: (1,7)-(1,8) = ":" + │ │ │ ├── value_loc: (1,8)-(1,9) = "c" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "c" + │ │ ├── value: + │ │ │ @ IntegerNode (location: (1,13)-(1,14)) + │ │ │ └── flags: decimal + │ │ └── operator_loc: (1,10)-(1,12) = "=>" + │ ├── opening_loc: (1,2)-(1,3) = "[" + │ └── closing_loc: (1,14)-(1,15) = "]" + ├── closing_loc: (1,15)-(1,16) = ")" + ├── block: ∅ + ├── flags: ∅ + └── name: "a" diff --git a/test/prism/snapshots/seattlerb/call_assoc.txt b/test/prism/snapshots/seattlerb/call_assoc.txt new file mode 100644 index 0000000000..59ede3254e --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_assoc.txt @@ -0,0 +1,27 @@ +@ ProgramNode (location: (1,0)-(1,7)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,7)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,7)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: (1,1)-(1,2) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,6)) + │ └── arguments: (length: 1) + │ └── @ KeywordHashNode (location: (1,2)-(1,6)) + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (1,2)-(1,6)) + │ ├── key: + │ │ @ IntegerNode (location: (1,2)-(1,3)) + │ │ └── flags: decimal + │ ├── value: + │ │ @ IntegerNode (location: (1,5)-(1,6)) + │ │ └── flags: decimal + │ └── operator_loc: (1,3)-(1,5) = "=>" + ├── closing_loc: (1,6)-(1,7) = ")" + ├── block: ∅ + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/call_assoc_new.txt b/test/prism/snapshots/seattlerb/call_assoc_new.txt new file mode 100644 index 0000000000..d1121c377f --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_assoc_new.txt @@ -0,0 +1,30 @@ +@ ProgramNode (location: (1,0)-(1,6)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,6)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,6)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: (1,1)-(1,2) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,5)) + │ └── arguments: (length: 1) + │ └── @ KeywordHashNode (location: (1,2)-(1,5)) + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (1,2)-(1,5)) + │ ├── key: + │ │ @ SymbolNode (location: (1,2)-(1,4)) + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (1,2)-(1,3) = "a" + │ │ ├── closing_loc: (1,3)-(1,4) = ":" + │ │ └── unescaped: "a" + │ ├── value: + │ │ @ IntegerNode (location: (1,4)-(1,5)) + │ │ └── flags: decimal + │ └── operator_loc: ∅ + ├── closing_loc: (1,5)-(1,6) = ")" + ├── block: ∅ + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/call_assoc_new_if_multiline.txt b/test/prism/snapshots/seattlerb/call_assoc_new_if_multiline.txt new file mode 100644 index 0000000000..c7ea9767c7 --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_assoc_new_if_multiline.txt @@ -0,0 +1,51 @@ +@ ProgramNode (location: (1,0)-(5,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(5,4)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(5,4)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: (1,1)-(1,2) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(5,3)) + │ └── arguments: (length: 1) + │ └── @ KeywordHashNode (location: (1,2)-(5,3)) + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (1,2)-(5,3)) + │ ├── key: + │ │ @ SymbolNode (location: (1,2)-(1,4)) + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (1,2)-(1,3) = "b" + │ │ ├── closing_loc: (1,3)-(1,4) = ":" + │ │ └── unescaped: "b" + │ ├── value: + │ │ @ IfNode (location: (1,5)-(5,3)) + │ │ ├── if_keyword_loc: (1,5)-(1,7) = "if" + │ │ ├── predicate: + │ │ │ @ SymbolNode (location: (1,8)-(1,10)) + │ │ │ ├── opening_loc: (1,8)-(1,9) = ":" + │ │ │ ├── value_loc: (1,9)-(1,10) = "c" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "c" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (2,0)-(2,1)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ IntegerNode (location: (2,0)-(2,1)) + │ │ │ └── flags: decimal + │ │ ├── consequent: + │ │ │ @ ElseNode (location: (3,0)-(5,3)) + │ │ │ ├── else_keyword_loc: (3,0)-(3,4) = "else" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (4,0)-(4,1)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (4,0)-(4,1)) + │ │ │ │ └── flags: decimal + │ │ │ └── end_keyword_loc: (5,0)-(5,3) = "end" + │ │ └── end_keyword_loc: (5,0)-(5,3) = "end" + │ └── operator_loc: ∅ + ├── closing_loc: (5,3)-(5,4) = ")" + ├── block: ∅ + ├── flags: ∅ + └── name: "a" diff --git a/test/prism/snapshots/seattlerb/call_assoc_trailing_comma.txt b/test/prism/snapshots/seattlerb/call_assoc_trailing_comma.txt new file mode 100644 index 0000000000..bf0cce6956 --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_assoc_trailing_comma.txt @@ -0,0 +1,27 @@ +@ ProgramNode (location: (1,0)-(1,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,8)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,8)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: (1,1)-(1,2) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,6)) + │ └── arguments: (length: 1) + │ └── @ KeywordHashNode (location: (1,2)-(1,6)) + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (1,2)-(1,6)) + │ ├── key: + │ │ @ IntegerNode (location: (1,2)-(1,3)) + │ │ └── flags: decimal + │ ├── value: + │ │ @ IntegerNode (location: (1,5)-(1,6)) + │ │ └── flags: decimal + │ └── operator_loc: (1,3)-(1,5) = "=>" + ├── closing_loc: (1,7)-(1,8) = ")" + ├── block: ∅ + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/call_bang_command_call.txt b/test/prism/snapshots/seattlerb/call_bang_command_call.txt new file mode 100644 index 0000000000..b38ffe085b --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_bang_command_call.txt @@ -0,0 +1,39 @@ +@ ProgramNode (location: (1,0)-(1,7)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,7)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,7)) + ├── receiver: + │ @ CallNode (location: (1,2)-(1,7)) + │ ├── receiver: + │ │ @ CallNode (location: (1,2)-(1,3)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,2)-(1,3) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "a" + │ ├── call_operator_loc: (1,3)-(1,4) = "." + │ ├── message_loc: (1,4)-(1,5) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,6)-(1,7)) + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (1,6)-(1,7)) + │ │ └── flags: decimal + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "b" + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "!" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "!" diff --git a/test/prism/snapshots/seattlerb/call_bang_squiggle.txt b/test/prism/snapshots/seattlerb/call_bang_squiggle.txt new file mode 100644 index 0000000000..2bc2d0a9bd --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_bang_squiggle.txt @@ -0,0 +1,21 @@ +@ ProgramNode (location: (1,0)-(1,6)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,6)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,6)) + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ └── flags: decimal + ├── call_operator_loc: ∅ + ├── message_loc: (1,2)-(1,4) = "!~" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,5)-(1,6)) + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,5)-(1,6)) + │ └── flags: decimal + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "!~" diff --git a/test/prism/snapshots/seattlerb/call_begin_call_block_call.txt b/test/prism/snapshots/seattlerb/call_begin_call_block_call.txt new file mode 100644 index 0000000000..f43f9a0bd9 --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_begin_call_block_call.txt @@ -0,0 +1,52 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(3,3)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(3,3)) + │ └── arguments: (length: 1) + │ └── @ BeginNode (location: (1,2)-(3,3)) + │ ├── begin_keyword_loc: (1,2)-(1,7) = "begin" + │ ├── statements: + │ │ @ StatementsNode (location: (2,0)-(2,10)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (2,0)-(2,10)) + │ │ ├── receiver: + │ │ │ @ CallNode (location: (2,0)-(2,1)) + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── message_loc: (2,0)-(2,1) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── block: ∅ + │ │ │ ├── flags: variable_call + │ │ │ └── name: "b" + │ │ ├── call_operator_loc: (2,1)-(2,2) = "." + │ │ ├── message_loc: (2,2)-(2,3) = "c" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: + │ │ │ @ BlockNode (location: (2,4)-(2,10)) + │ │ │ ├── locals: [] + │ │ │ ├── parameters: ∅ + │ │ │ ├── body: ∅ + │ │ │ ├── opening_loc: (2,4)-(2,6) = "do" + │ │ │ └── closing_loc: (2,7)-(2,10) = "end" + │ │ ├── flags: ∅ + │ │ └── name: "c" + │ ├── rescue_clause: ∅ + │ ├── else_clause: ∅ + │ ├── ensure_clause: ∅ + │ └── end_keyword_loc: (3,0)-(3,3) = "end" + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "a" diff --git a/test/prism/snapshots/seattlerb/call_block_arg_named.txt b/test/prism/snapshots/seattlerb/call_block_arg_named.txt new file mode 100644 index 0000000000..deb1433cab --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_block_arg_named.txt @@ -0,0 +1,28 @@ +@ ProgramNode (location: (1,0)-(1,6)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,6)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,6)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "x" + ├── opening_loc: (1,1)-(1,2) = "(" + ├── arguments: ∅ + ├── closing_loc: (1,6)-(1,7) = ")" + ├── block: + │ @ BlockArgumentNode (location: (1,2)-(1,6)) + │ ├── expression: + │ │ @ CallNode (location: (1,3)-(1,6)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,3)-(1,6) = "blk" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "blk" + │ └── operator_loc: (1,2)-(1,3) = "&" + ├── flags: ∅ + └── name: "x" diff --git a/test/prism/snapshots/seattlerb/call_carat.txt b/test/prism/snapshots/seattlerb/call_carat.txt new file mode 100644 index 0000000000..6bf95e2a5a --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_carat.txt @@ -0,0 +1,21 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,5)) + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ └── flags: decimal + ├── call_operator_loc: ∅ + ├── message_loc: (1,2)-(1,3) = "^" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,4)-(1,5)) + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,4)-(1,5)) + │ └── flags: decimal + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "^" diff --git a/test/prism/snapshots/seattlerb/call_colon2.txt b/test/prism/snapshots/seattlerb/call_colon2.txt new file mode 100644 index 0000000000..42206b4f08 --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_colon2.txt @@ -0,0 +1,17 @@ +@ ProgramNode (location: (1,0)-(1,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,4)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,4)) + ├── receiver: + │ @ ConstantReadNode (location: (1,0)-(1,1)) + │ └── name: :A + ├── call_operator_loc: (1,1)-(1,3) = "::" + ├── message_loc: (1,3)-(1,4) = "b" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "b" diff --git a/test/prism/snapshots/seattlerb/call_colon_parens.txt b/test/prism/snapshots/seattlerb/call_colon_parens.txt new file mode 100644 index 0000000000..f1327adac3 --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_colon_parens.txt @@ -0,0 +1,17 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,5)) + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ └── flags: decimal + ├── call_operator_loc: (1,1)-(1,3) = "::" + ├── message_loc: ∅ + ├── opening_loc: (1,3)-(1,4) = "(" + ├── arguments: ∅ + ├── closing_loc: (1,4)-(1,5) = ")" + ├── block: ∅ + ├── flags: ∅ + └── name: "call" diff --git a/test/prism/snapshots/seattlerb/call_div.txt b/test/prism/snapshots/seattlerb/call_div.txt new file mode 100644 index 0000000000..4a9961847b --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_div.txt @@ -0,0 +1,21 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,5)) + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ └── flags: decimal + ├── call_operator_loc: ∅ + ├── message_loc: (1,2)-(1,3) = "/" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,4)-(1,5)) + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,4)-(1,5)) + │ └── flags: decimal + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "/" diff --git a/test/prism/snapshots/seattlerb/call_dot_parens.txt b/test/prism/snapshots/seattlerb/call_dot_parens.txt new file mode 100644 index 0000000000..a473a2258a --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_dot_parens.txt @@ -0,0 +1,17 @@ +@ ProgramNode (location: (1,0)-(1,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,4)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,4)) + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ └── flags: decimal + ├── call_operator_loc: (1,1)-(1,2) = "." + ├── message_loc: ∅ + ├── opening_loc: (1,2)-(1,3) = "(" + ├── arguments: ∅ + ├── closing_loc: (1,3)-(1,4) = ")" + ├── block: ∅ + ├── flags: ∅ + └── name: "call" diff --git a/test/prism/snapshots/seattlerb/call_env.txt b/test/prism/snapshots/seattlerb/call_env.txt new file mode 100644 index 0000000000..f2996f3a21 --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_env.txt @@ -0,0 +1,25 @@ +@ ProgramNode (location: (1,0)-(1,7)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,7)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,7)) + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "a" + ├── call_operator_loc: (1,1)-(1,2) = "." + ├── message_loc: (1,2)-(1,7) = "happy" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "happy" diff --git a/test/prism/snapshots/seattlerb/call_eq3.txt b/test/prism/snapshots/seattlerb/call_eq3.txt new file mode 100644 index 0000000000..146aa7993a --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_eq3.txt @@ -0,0 +1,21 @@ +@ ProgramNode (location: (1,0)-(1,7)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,7)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,7)) + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ └── flags: decimal + ├── call_operator_loc: ∅ + ├── message_loc: (1,2)-(1,5) = "===" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,6)-(1,7)) + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,6)-(1,7)) + │ └── flags: decimal + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "===" diff --git a/test/prism/snapshots/seattlerb/call_gt.txt b/test/prism/snapshots/seattlerb/call_gt.txt new file mode 100644 index 0000000000..8cb2772a90 --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_gt.txt @@ -0,0 +1,21 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,5)) + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ └── flags: decimal + ├── call_operator_loc: ∅ + ├── message_loc: (1,2)-(1,3) = ">" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,4)-(1,5)) + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,4)-(1,5)) + │ └── flags: decimal + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: ">" diff --git a/test/prism/snapshots/seattlerb/call_kwsplat.txt b/test/prism/snapshots/seattlerb/call_kwsplat.txt new file mode 100644 index 0000000000..d750ea21e9 --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_kwsplat.txt @@ -0,0 +1,24 @@ +@ ProgramNode (location: (1,0)-(1,6)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,6)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,6)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: (1,1)-(1,2) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,5)) + │ └── arguments: (length: 1) + │ └── @ KeywordHashNode (location: (1,2)-(1,5)) + │ └── elements: (length: 1) + │ └── @ AssocSplatNode (location: (1,2)-(1,5)) + │ ├── value: + │ │ @ IntegerNode (location: (1,4)-(1,5)) + │ │ └── flags: decimal + │ └── operator_loc: (1,2)-(1,4) = "**" + ├── closing_loc: (1,5)-(1,6) = ")" + ├── block: ∅ + ├── flags: ∅ + └── name: "a" diff --git a/test/prism/snapshots/seattlerb/call_leading_dots.txt b/test/prism/snapshots/seattlerb/call_leading_dots.txt new file mode 100644 index 0000000000..a8fad7a4aa --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_leading_dots.txt @@ -0,0 +1,35 @@ +@ ProgramNode (location: (1,0)-(3,2)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,2)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(3,2)) + ├── receiver: + │ @ CallNode (location: (1,0)-(2,2)) + │ ├── receiver: + │ │ @ CallNode (location: (1,0)-(1,1)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,0)-(1,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "a" + │ ├── call_operator_loc: (2,0)-(2,1) = "." + │ ├── message_loc: (2,1)-(2,2) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "b" + ├── call_operator_loc: (3,0)-(3,1) = "." + ├── message_loc: (3,1)-(3,2) = "c" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "c" diff --git a/test/prism/snapshots/seattlerb/call_leading_dots_comment.txt b/test/prism/snapshots/seattlerb/call_leading_dots_comment.txt new file mode 100644 index 0000000000..b21a68b542 --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_leading_dots_comment.txt @@ -0,0 +1,35 @@ +@ ProgramNode (location: (1,0)-(4,2)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,2)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(4,2)) + ├── receiver: + │ @ CallNode (location: (1,0)-(2,2)) + │ ├── receiver: + │ │ @ CallNode (location: (1,0)-(1,1)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,0)-(1,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "a" + │ ├── call_operator_loc: (2,0)-(2,1) = "." + │ ├── message_loc: (2,1)-(2,2) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "b" + ├── call_operator_loc: (4,0)-(4,1) = "." + ├── message_loc: (4,1)-(4,2) = "d" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "d" diff --git a/test/prism/snapshots/seattlerb/call_lt.txt b/test/prism/snapshots/seattlerb/call_lt.txt new file mode 100644 index 0000000000..dcdfbb3420 --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_lt.txt @@ -0,0 +1,21 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,5)) + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ └── flags: decimal + ├── call_operator_loc: ∅ + ├── message_loc: (1,2)-(1,3) = "<" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,4)-(1,5)) + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,4)-(1,5)) + │ └── flags: decimal + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "<" diff --git a/test/prism/snapshots/seattlerb/call_lte.txt b/test/prism/snapshots/seattlerb/call_lte.txt new file mode 100644 index 0000000000..32f886fa3c --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_lte.txt @@ -0,0 +1,21 @@ +@ ProgramNode (location: (1,0)-(1,6)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,6)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,6)) + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ └── flags: decimal + ├── call_operator_loc: ∅ + ├── message_loc: (1,2)-(1,4) = "<=" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,5)-(1,6)) + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,5)-(1,6)) + │ └── flags: decimal + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "<=" diff --git a/test/prism/snapshots/seattlerb/call_not.txt b/test/prism/snapshots/seattlerb/call_not.txt new file mode 100644 index 0000000000..6c2f2d5f52 --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_not.txt @@ -0,0 +1,17 @@ +@ ProgramNode (location: (1,0)-(1,6)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,6)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,6)) + ├── receiver: + │ @ IntegerNode (location: (1,4)-(1,6)) + │ └── flags: decimal + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,3) = "not" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "!" diff --git a/test/prism/snapshots/seattlerb/call_pipe.txt b/test/prism/snapshots/seattlerb/call_pipe.txt new file mode 100644 index 0000000000..4981718ce9 --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_pipe.txt @@ -0,0 +1,21 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,5)) + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ └── flags: decimal + ├── call_operator_loc: ∅ + ├── message_loc: (1,2)-(1,3) = "|" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,4)-(1,5)) + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,4)-(1,5)) + │ └── flags: decimal + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "|" diff --git a/test/prism/snapshots/seattlerb/call_rshift.txt b/test/prism/snapshots/seattlerb/call_rshift.txt new file mode 100644 index 0000000000..dd50e3e336 --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_rshift.txt @@ -0,0 +1,21 @@ +@ ProgramNode (location: (1,0)-(1,6)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,6)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,6)) + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ └── flags: decimal + ├── call_operator_loc: ∅ + ├── message_loc: (1,2)-(1,4) = ">>" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,5)-(1,6)) + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,5)-(1,6)) + │ └── flags: decimal + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: ">>" diff --git a/test/prism/snapshots/seattlerb/call_self_brackets.txt b/test/prism/snapshots/seattlerb/call_self_brackets.txt new file mode 100644 index 0000000000..0fb7d677d8 --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_self_brackets.txt @@ -0,0 +1,20 @@ +@ ProgramNode (location: (1,0)-(1,7)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,7)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,7)) + ├── receiver: + │ @ SelfNode (location: (1,0)-(1,4)) + ├── call_operator_loc: ∅ + ├── message_loc: (1,4)-(1,7) = "[1]" + ├── opening_loc: (1,4)-(1,5) = "[" + ├── arguments: + │ @ ArgumentsNode (location: (1,5)-(1,6)) + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,5)-(1,6)) + │ └── flags: decimal + ├── closing_loc: (1,6)-(1,7) = "]" + ├── block: ∅ + ├── flags: ∅ + └── name: "[]" diff --git a/test/prism/snapshots/seattlerb/call_spaceship.txt b/test/prism/snapshots/seattlerb/call_spaceship.txt new file mode 100644 index 0000000000..388b8dc427 --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_spaceship.txt @@ -0,0 +1,21 @@ +@ ProgramNode (location: (1,0)-(1,7)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,7)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,7)) + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ └── flags: decimal + ├── call_operator_loc: ∅ + ├── message_loc: (1,2)-(1,5) = "<=>" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,6)-(1,7)) + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,6)-(1,7)) + │ └── flags: decimal + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "<=>" diff --git a/test/prism/snapshots/seattlerb/call_stabby_do_end_with_block.txt b/test/prism/snapshots/seattlerb/call_stabby_do_end_with_block.txt new file mode 100644 index 0000000000..576e1a49b0 --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_stabby_do_end_with_block.txt @@ -0,0 +1,38 @@ +@ ProgramNode (location: (1,0)-(1,22)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,22)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,22)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,13)) + │ └── arguments: (length: 1) + │ └── @ LambdaNode (location: (1,2)-(1,13)) + │ ├── locals: [] + │ ├── operator_loc: (1,2)-(1,4) = "->" + │ ├── opening_loc: (1,5)-(1,7) = "do" + │ ├── closing_loc: (1,10)-(1,13) = "end" + │ ├── parameters: ∅ + │ └── body: + │ @ StatementsNode (location: (1,8)-(1,9)) + │ └── body: (length: 1) + │ └── @ IntegerNode (location: (1,8)-(1,9)) + │ └── flags: decimal + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,14)-(1,22)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (1,17)-(1,18)) + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (1,17)-(1,18)) + │ │ └── flags: decimal + │ ├── opening_loc: (1,14)-(1,16) = "do" + │ └── closing_loc: (1,19)-(1,22) = "end" + ├── flags: ∅ + └── name: "a" diff --git a/test/prism/snapshots/seattlerb/call_stabby_with_braces_block.txt b/test/prism/snapshots/seattlerb/call_stabby_with_braces_block.txt new file mode 100644 index 0000000000..0dc00fd90d --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_stabby_with_braces_block.txt @@ -0,0 +1,38 @@ +@ ProgramNode (location: (1,0)-(1,19)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,19)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,19)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,10)) + │ └── arguments: (length: 1) + │ └── @ LambdaNode (location: (1,2)-(1,10)) + │ ├── locals: [] + │ ├── operator_loc: (1,2)-(1,4) = "->" + │ ├── opening_loc: (1,5)-(1,6) = "{" + │ ├── closing_loc: (1,9)-(1,10) = "}" + │ ├── parameters: ∅ + │ └── body: + │ @ StatementsNode (location: (1,7)-(1,8)) + │ └── body: (length: 1) + │ └── @ IntegerNode (location: (1,7)-(1,8)) + │ └── flags: decimal + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,11)-(1,19)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (1,14)-(1,15)) + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (1,14)-(1,15)) + │ │ └── flags: decimal + │ ├── opening_loc: (1,11)-(1,13) = "do" + │ └── closing_loc: (1,16)-(1,19) = "end" + ├── flags: ∅ + └── name: "a" diff --git a/test/prism/snapshots/seattlerb/call_star.txt b/test/prism/snapshots/seattlerb/call_star.txt new file mode 100644 index 0000000000..bf3fa53b44 --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_star.txt @@ -0,0 +1,21 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,5)) + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ └── flags: decimal + ├── call_operator_loc: ∅ + ├── message_loc: (1,2)-(1,3) = "*" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,4)-(1,5)) + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,4)-(1,5)) + │ └── flags: decimal + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "*" diff --git a/test/prism/snapshots/seattlerb/call_star2.txt b/test/prism/snapshots/seattlerb/call_star2.txt new file mode 100644 index 0000000000..960f676135 --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_star2.txt @@ -0,0 +1,21 @@ +@ ProgramNode (location: (1,0)-(1,6)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,6)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,6)) + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ └── flags: decimal + ├── call_operator_loc: ∅ + ├── message_loc: (1,2)-(1,4) = "**" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,5)-(1,6)) + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,5)-(1,6)) + │ └── flags: decimal + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "**" diff --git a/test/prism/snapshots/seattlerb/call_trailing_comma.txt b/test/prism/snapshots/seattlerb/call_trailing_comma.txt new file mode 100644 index 0000000000..91ffc098bf --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_trailing_comma.txt @@ -0,0 +1,19 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,5)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: (1,1)-(1,2) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,3)) + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,2)-(1,3)) + │ └── flags: decimal + ├── closing_loc: (1,4)-(1,5) = ")" + ├── block: ∅ + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/call_trailing_dots.txt b/test/prism/snapshots/seattlerb/call_trailing_dots.txt new file mode 100644 index 0000000000..828db0ce3b --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_trailing_dots.txt @@ -0,0 +1,35 @@ +@ ProgramNode (location: (1,0)-(3,1)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,1)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(3,1)) + ├── receiver: + │ @ CallNode (location: (1,0)-(2,1)) + │ ├── receiver: + │ │ @ CallNode (location: (1,0)-(1,1)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,0)-(1,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "a" + │ ├── call_operator_loc: (1,1)-(1,2) = "." + │ ├── message_loc: (2,0)-(2,1) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "b" + ├── call_operator_loc: (2,1)-(2,2) = "." + ├── message_loc: (3,0)-(3,1) = "c" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "c" diff --git a/test/prism/snapshots/seattlerb/call_unary_bang.txt b/test/prism/snapshots/seattlerb/call_unary_bang.txt new file mode 100644 index 0000000000..a3dc0368a5 --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_unary_bang.txt @@ -0,0 +1,17 @@ +@ ProgramNode (location: (1,0)-(1,2)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,2)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,2)) + ├── receiver: + │ @ IntegerNode (location: (1,1)-(1,2)) + │ └── flags: decimal + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "!" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "!" diff --git a/test/prism/snapshots/seattlerb/case_in.txt b/test/prism/snapshots/seattlerb/case_in.txt new file mode 100644 index 0000000000..94556ddecb --- /dev/null +++ b/test/prism/snapshots/seattlerb/case_in.txt @@ -0,0 +1,892 @@ +@ ProgramNode (location: (1,0)-(111,3)) +├── locals: [:b, :_, :lhs, :x, :rhs, :c, :e] +└── statements: + @ StatementsNode (location: (1,0)-(111,3)) + └── body: (length: 28) + ├── @ CaseNode (location: (1,0)-(3,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (1,5)-(1,7)) + │ │ ├── opening_loc: (1,5)-(1,6) = ":" + │ │ ├── value_loc: (1,6)-(1,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (2,0)-(2,8)) + │ │ ├── pattern: + │ │ │ @ HashPatternNode (location: (2,4)-(2,8)) + │ │ │ ├── constant: ∅ + │ │ │ ├── assocs: (length: 1) + │ │ │ │ └── @ AssocNode (location: (2,4)-(2,8)) + │ │ │ │ ├── key: + │ │ │ │ │ @ SymbolNode (location: (2,4)-(2,8)) + │ │ │ │ │ ├── opening_loc: (2,4)-(2,5) = "\"" + │ │ │ │ │ ├── value_loc: (2,5)-(2,6) = "b" + │ │ │ │ │ ├── closing_loc: (2,6)-(2,8) = "\":" + │ │ │ │ │ └── unescaped: "b" + │ │ │ │ ├── value: ∅ + │ │ │ │ └── operator_loc: ∅ + │ │ │ ├── kwrest: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ └── closing_loc: ∅ + │ │ ├── statements: ∅ + │ │ ├── in_loc: (2,0)-(2,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (1,0)-(1,4) = "case" + │ └── end_keyword_loc: (3,0)-(3,3) = "end" + ├── @ CaseNode (location: (5,0)-(7,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (5,5)-(5,7)) + │ │ ├── opening_loc: (5,5)-(5,6) = ":" + │ │ ├── value_loc: (5,6)-(5,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (6,0)-(6,10)) + │ │ ├── pattern: + │ │ │ @ ArrayNode (location: (6,3)-(6,10)) + │ │ │ ├── elements: (length: 2) + │ │ │ │ ├── @ SymbolNode (location: (6,6)-(6,7)) + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── value_loc: (6,6)-(6,7) = "a" + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── unescaped: "a" + │ │ │ │ └── @ SymbolNode (location: (6,8)-(6,9)) + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (6,8)-(6,9) = "b" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "b" + │ │ │ ├── opening_loc: (6,3)-(6,6) = "%I[" + │ │ │ └── closing_loc: (6,9)-(6,10) = "]" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (6,0)-(6,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (5,0)-(5,4) = "case" + │ └── end_keyword_loc: (7,0)-(7,3) = "end" + ├── @ CaseNode (location: (9,0)-(11,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (9,5)-(9,7)) + │ │ ├── opening_loc: (9,5)-(9,6) = ":" + │ │ ├── value_loc: (9,6)-(9,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (10,0)-(10,10)) + │ │ ├── pattern: + │ │ │ @ ArrayNode (location: (10,3)-(10,10)) + │ │ │ ├── elements: (length: 2) + │ │ │ │ ├── @ StringNode (location: (10,6)-(10,7)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── content_loc: (10,6)-(10,7) = "a" + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── unescaped: "a" + │ │ │ │ └── @ StringNode (location: (10,8)-(10,9)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── content_loc: (10,8)-(10,9) = "b" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "b" + │ │ │ ├── opening_loc: (10,3)-(10,6) = "%W[" + │ │ │ └── closing_loc: (10,9)-(10,10) = "]" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (10,0)-(10,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (9,0)-(9,4) = "case" + │ └── end_keyword_loc: (11,0)-(11,3) = "end" + ├── @ CaseNode (location: (13,0)-(15,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (13,5)-(13,7)) + │ │ ├── opening_loc: (13,5)-(13,6) = ":" + │ │ ├── value_loc: (13,6)-(13,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (14,0)-(14,10)) + │ │ ├── pattern: + │ │ │ @ ArrayNode (location: (14,3)-(14,10)) + │ │ │ ├── elements: (length: 2) + │ │ │ │ ├── @ SymbolNode (location: (14,6)-(14,7)) + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── value_loc: (14,6)-(14,7) = "a" + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── unescaped: "a" + │ │ │ │ └── @ SymbolNode (location: (14,8)-(14,9)) + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (14,8)-(14,9) = "b" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "b" + │ │ │ ├── opening_loc: (14,3)-(14,6) = "%i[" + │ │ │ └── closing_loc: (14,9)-(14,10) = "]" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (14,0)-(14,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (13,0)-(13,4) = "case" + │ └── end_keyword_loc: (15,0)-(15,3) = "end" + ├── @ CaseNode (location: (17,0)-(19,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (17,5)-(17,7)) + │ │ ├── opening_loc: (17,5)-(17,6) = ":" + │ │ ├── value_loc: (17,6)-(17,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (18,0)-(18,10)) + │ │ ├── pattern: + │ │ │ @ ArrayNode (location: (18,3)-(18,10)) + │ │ │ ├── elements: (length: 2) + │ │ │ │ ├── @ StringNode (location: (18,6)-(18,7)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── content_loc: (18,6)-(18,7) = "a" + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── unescaped: "a" + │ │ │ │ └── @ StringNode (location: (18,8)-(18,9)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── content_loc: (18,8)-(18,9) = "b" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "b" + │ │ │ ├── opening_loc: (18,3)-(18,6) = "%w[" + │ │ │ └── closing_loc: (18,9)-(18,10) = "]" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (18,0)-(18,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (17,0)-(17,4) = "case" + │ └── end_keyword_loc: (19,0)-(19,3) = "end" + ├── @ CaseNode (location: (21,0)-(23,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (21,5)-(21,7)) + │ │ ├── opening_loc: (21,5)-(21,6) = ":" + │ │ ├── value_loc: (21,6)-(21,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (22,0)-(22,9)) + │ │ ├── pattern: + │ │ │ @ RangeNode (location: (22,4)-(22,9)) + │ │ │ ├── left: ∅ + │ │ │ ├── right: + │ │ │ │ @ IntegerNode (location: (22,7)-(22,9)) + │ │ │ │ └── flags: decimal + │ │ │ ├── operator_loc: (22,4)-(22,7) = "..." + │ │ │ └── flags: exclude_end + │ │ ├── statements: ∅ + │ │ ├── in_loc: (22,0)-(22,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (21,0)-(21,4) = "case" + │ └── end_keyword_loc: (23,0)-(23,3) = "end" + ├── @ CaseNode (location: (25,0)-(27,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (25,5)-(25,7)) + │ │ ├── opening_loc: (25,5)-(25,6) = ":" + │ │ ├── value_loc: (25,6)-(25,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (26,0)-(26,8)) + │ │ ├── pattern: + │ │ │ @ RangeNode (location: (26,4)-(26,8)) + │ │ │ ├── left: ∅ + │ │ │ ├── right: + │ │ │ │ @ IntegerNode (location: (26,6)-(26,8)) + │ │ │ │ └── flags: decimal + │ │ │ ├── operator_loc: (26,4)-(26,6) = ".." + │ │ │ └── flags: ∅ + │ │ ├── statements: ∅ + │ │ ├── in_loc: (26,0)-(26,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (25,0)-(25,4) = "case" + │ └── end_keyword_loc: (27,0)-(27,3) = "end" + ├── @ CaseNode (location: (29,0)-(31,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (29,5)-(29,7)) + │ │ ├── opening_loc: (29,5)-(29,6) = ":" + │ │ ├── value_loc: (29,6)-(29,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (30,0)-(30,8)) + │ │ ├── pattern: + │ │ │ @ RangeNode (location: (30,4)-(30,8)) + │ │ │ ├── left: + │ │ │ │ @ IntegerNode (location: (30,4)-(30,5)) + │ │ │ │ └── flags: decimal + │ │ │ ├── right: ∅ + │ │ │ ├── operator_loc: (30,5)-(30,8) = "..." + │ │ │ └── flags: exclude_end + │ │ ├── statements: ∅ + │ │ ├── in_loc: (30,0)-(30,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (29,0)-(29,4) = "case" + │ └── end_keyword_loc: (31,0)-(31,3) = "end" + ├── @ CaseNode (location: (33,0)-(35,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (33,5)-(33,7)) + │ │ ├── opening_loc: (33,5)-(33,6) = ":" + │ │ ├── value_loc: (33,6)-(33,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (34,0)-(34,9)) + │ │ ├── pattern: + │ │ │ @ RangeNode (location: (34,4)-(34,9)) + │ │ │ ├── left: + │ │ │ │ @ IntegerNode (location: (34,4)-(34,5)) + │ │ │ │ └── flags: decimal + │ │ │ ├── right: + │ │ │ │ @ IntegerNode (location: (34,8)-(34,9)) + │ │ │ │ └── flags: decimal + │ │ │ ├── operator_loc: (34,5)-(34,8) = "..." + │ │ │ └── flags: exclude_end + │ │ ├── statements: ∅ + │ │ ├── in_loc: (34,0)-(34,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (33,0)-(33,4) = "case" + │ └── end_keyword_loc: (35,0)-(35,3) = "end" + ├── @ CaseNode (location: (37,0)-(39,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (37,5)-(37,7)) + │ │ ├── opening_loc: (37,5)-(37,6) = ":" + │ │ ├── value_loc: (37,6)-(37,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (38,0)-(38,6)) + │ │ ├── pattern: + │ │ │ @ IntegerNode (location: (38,4)-(38,6)) + │ │ │ └── flags: decimal + │ │ ├── statements: ∅ + │ │ ├── in_loc: (38,0)-(38,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (37,0)-(37,4) = "case" + │ └── end_keyword_loc: (39,0)-(39,3) = "end" + ├── @ CaseNode (location: (41,0)-(43,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (41,5)-(41,7)) + │ │ ├── opening_loc: (41,5)-(41,6) = ":" + │ │ ├── value_loc: (41,6)-(41,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (42,0)-(42,8)) + │ │ ├── pattern: + │ │ │ @ HashPatternNode (location: (42,3)-(42,8)) + │ │ │ ├── constant: ∅ + │ │ │ ├── assocs: (length: 1) + │ │ │ │ └── @ NoKeywordsParameterNode (location: (42,3)-(42,8)) + │ │ │ │ ├── operator_loc: (42,3)-(42,5) = "**" + │ │ │ │ └── keyword_loc: (42,5)-(42,8) = "nil" + │ │ │ ├── kwrest: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ └── closing_loc: ∅ + │ │ ├── statements: ∅ + │ │ ├── in_loc: (42,0)-(42,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (41,0)-(41,4) = "case" + │ └── end_keyword_loc: (43,0)-(43,3) = "end" + ├── @ CaseNode (location: (45,0)-(47,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (45,5)-(45,7)) + │ │ ├── opening_loc: (45,5)-(45,6) = ":" + │ │ ├── value_loc: (45,6)-(45,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (46,0)-(46,11)) + │ │ ├── pattern: + │ │ │ @ RegularExpressionNode (location: (46,3)-(46,11)) + │ │ │ ├── opening_loc: (46,3)-(46,4) = "/" + │ │ │ ├── content_loc: (46,4)-(46,10) = "regexp" + │ │ │ ├── closing_loc: (46,10)-(46,11) = "/" + │ │ │ ├── unescaped: "regexp" + │ │ │ └── flags: ∅ + │ │ ├── statements: ∅ + │ │ ├── in_loc: (46,0)-(46,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (45,0)-(45,4) = "case" + │ └── end_keyword_loc: (47,0)-(47,3) = "end" + ├── @ CaseNode (location: (49,0)-(51,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (49,5)-(49,7)) + │ │ ├── opening_loc: (49,5)-(49,6) = ":" + │ │ ├── value_loc: (49,6)-(49,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (50,0)-(50,13)) + │ │ ├── pattern: + │ │ │ @ ArrayPatternNode (location: (50,3)-(50,13)) + │ │ │ ├── constant: ∅ + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ SymbolNode (location: (50,3)-(50,5)) + │ │ │ │ ├── opening_loc: (50,3)-(50,4) = ":" + │ │ │ │ ├── value_loc: (50,4)-(50,5) = "b" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "b" + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (50,7)-(50,9)) + │ │ │ │ ├── operator_loc: (50,7)-(50,8) = "*" + │ │ │ │ └── expression: + │ │ │ │ @ LocalVariableTargetNode (location: (50,8)-(50,9)) + │ │ │ │ ├── name: :_ + │ │ │ │ └── depth: 0 + │ │ │ ├── posts: (length: 1) + │ │ │ │ └── @ SymbolNode (location: (50,11)-(50,13)) + │ │ │ │ ├── opening_loc: (50,11)-(50,12) = ":" + │ │ │ │ ├── value_loc: (50,12)-(50,13) = "c" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "c" + │ │ │ ├── opening_loc: ∅ + │ │ │ └── closing_loc: ∅ + │ │ ├── statements: ∅ + │ │ ├── in_loc: (50,0)-(50,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (49,0)-(49,4) = "case" + │ └── end_keyword_loc: (51,0)-(51,3) = "end" + ├── @ CaseNode (location: (53,0)-(55,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (53,5)-(53,7)) + │ │ ├── opening_loc: (53,5)-(53,6) = ":" + │ │ ├── value_loc: (53,6)-(53,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (54,0)-(54,11)) + │ │ ├── pattern: + │ │ │ @ ArrayPatternNode (location: (54,3)-(54,11)) + │ │ │ ├── constant: ∅ + │ │ │ ├── requireds: (length: 2) + │ │ │ │ ├── @ SymbolNode (location: (54,3)-(54,5)) + │ │ │ │ │ ├── opening_loc: (54,3)-(54,4) = ":" + │ │ │ │ │ ├── value_loc: (54,4)-(54,5) = "b" + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── unescaped: "b" + │ │ │ │ └── @ ArrayPatternNode (location: (54,7)-(54,11)) + │ │ │ │ ├── constant: ∅ + │ │ │ │ ├── requireds: (length: 1) + │ │ │ │ │ └── @ SymbolNode (location: (54,8)-(54,10)) + │ │ │ │ │ ├── opening_loc: (54,8)-(54,9) = ":" + │ │ │ │ │ ├── value_loc: (54,9)-(54,10) = "c" + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── unescaped: "c" + │ │ │ │ ├── rest: ∅ + │ │ │ │ ├── posts: (length: 0) + │ │ │ │ ├── opening_loc: (54,7)-(54,8) = "[" + │ │ │ │ └── closing_loc: (54,10)-(54,11) = "]" + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── opening_loc: ∅ + │ │ │ └── closing_loc: ∅ + │ │ ├── statements: ∅ + │ │ ├── in_loc: (54,0)-(54,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (53,0)-(53,4) = "case" + │ └── end_keyword_loc: (55,0)-(55,3) = "end" + ├── @ CaseNode (location: (57,0)-(59,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (57,5)-(57,7)) + │ │ ├── opening_loc: (57,5)-(57,6) = ":" + │ │ ├── value_loc: (57,6)-(57,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (58,0)-(58,11)) + │ │ ├── pattern: + │ │ │ @ ArrayPatternNode (location: (58,3)-(58,11)) + │ │ │ ├── constant: + │ │ │ │ @ ConstantReadNode (location: (58,3)-(58,9)) + │ │ │ │ └── name: :Symbol + │ │ │ ├── requireds: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── opening_loc: (58,9)-(58,10) = "(" + │ │ │ └── closing_loc: (58,10)-(58,11) = ")" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (58,0)-(58,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (57,0)-(57,4) = "case" + │ └── end_keyword_loc: (59,0)-(59,3) = "end" + ├── @ CaseNode (location: (61,0)-(63,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (61,5)-(61,7)) + │ │ ├── opening_loc: (61,5)-(61,6) = ":" + │ │ ├── value_loc: (61,6)-(61,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (62,0)-(62,24)) + │ │ ├── pattern: + │ │ │ @ FindPatternNode (location: (62,3)-(62,24)) + │ │ │ ├── constant: + │ │ │ │ @ ConstantReadNode (location: (62,3)-(62,9)) + │ │ │ │ └── name: :Symbol + │ │ │ ├── left: + │ │ │ │ @ SplatNode (location: (62,10)-(62,14)) + │ │ │ │ ├── operator_loc: (62,10)-(62,11) = "*" + │ │ │ │ └── expression: + │ │ │ │ @ LocalVariableTargetNode (location: (62,11)-(62,14)) + │ │ │ │ ├── name: :lhs + │ │ │ │ └── depth: 0 + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ LocalVariableTargetNode (location: (62,16)-(62,17)) + │ │ │ │ ├── name: :x + │ │ │ │ └── depth: 0 + │ │ │ ├── right: + │ │ │ │ @ SplatNode (location: (62,19)-(62,23)) + │ │ │ │ ├── operator_loc: (62,19)-(62,20) = "*" + │ │ │ │ └── expression: + │ │ │ │ @ LocalVariableTargetNode (location: (62,20)-(62,23)) + │ │ │ │ ├── name: :rhs + │ │ │ │ └── depth: 0 + │ │ │ ├── opening_loc: (62,9)-(62,10) = "(" + │ │ │ └── closing_loc: (62,23)-(62,24) = ")" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (62,0)-(62,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (61,0)-(61,4) = "case" + │ └── end_keyword_loc: (63,0)-(63,3) = "end" + ├── @ CaseNode (location: (65,0)-(67,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (65,5)-(65,7)) + │ │ ├── opening_loc: (65,5)-(65,6) = ":" + │ │ ├── value_loc: (65,6)-(65,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (66,0)-(66,24)) + │ │ ├── pattern: + │ │ │ @ FindPatternNode (location: (66,3)-(66,24)) + │ │ │ ├── constant: + │ │ │ │ @ ConstantReadNode (location: (66,3)-(66,9)) + │ │ │ │ └── name: :Symbol + │ │ │ ├── left: + │ │ │ │ @ SplatNode (location: (66,10)-(66,14)) + │ │ │ │ ├── operator_loc: (66,10)-(66,11) = "*" + │ │ │ │ └── expression: + │ │ │ │ @ LocalVariableTargetNode (location: (66,11)-(66,14)) + │ │ │ │ ├── name: :lhs + │ │ │ │ └── depth: 0 + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ LocalVariableTargetNode (location: (66,16)-(66,17)) + │ │ │ │ ├── name: :x + │ │ │ │ └── depth: 0 + │ │ │ ├── right: + │ │ │ │ @ SplatNode (location: (66,19)-(66,23)) + │ │ │ │ ├── operator_loc: (66,19)-(66,20) = "*" + │ │ │ │ └── expression: + │ │ │ │ @ LocalVariableTargetNode (location: (66,20)-(66,23)) + │ │ │ │ ├── name: :rhs + │ │ │ │ └── depth: 0 + │ │ │ ├── opening_loc: (66,9)-(66,10) = "[" + │ │ │ └── closing_loc: (66,23)-(66,24) = "]" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (66,0)-(66,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (65,0)-(65,4) = "case" + │ └── end_keyword_loc: (67,0)-(67,3) = "end" + ├── @ CaseNode (location: (69,0)-(71,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (69,5)-(69,7)) + │ │ ├── opening_loc: (69,5)-(69,6) = ":" + │ │ ├── value_loc: (69,6)-(69,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (70,0)-(70,22)) + │ │ ├── pattern: + │ │ │ @ ArrayPatternNode (location: (70,3)-(70,22)) + │ │ │ ├── constant: ∅ + │ │ │ ├── requireds: (length: 2) + │ │ │ │ ├── @ LambdaNode (location: (70,4)-(70,18)) + │ │ │ │ │ ├── locals: [:b] + │ │ │ │ │ ├── operator_loc: (70,4)-(70,6) = "->" + │ │ │ │ │ ├── opening_loc: (70,10)-(70,11) = "{" + │ │ │ │ │ ├── closing_loc: (70,17)-(70,18) = "}" + │ │ │ │ │ ├── parameters: + │ │ │ │ │ │ @ BlockParametersNode (location: (70,6)-(70,9)) + │ │ │ │ │ │ ├── parameters: + │ │ │ │ │ │ │ @ ParametersNode (location: (70,7)-(70,8)) + │ │ │ │ │ │ │ ├── requireds: (length: 1) + │ │ │ │ │ │ │ │ └── @ RequiredParameterNode (location: (70,7)-(70,8)) + │ │ │ │ │ │ │ │ └── name: :b + │ │ │ │ │ │ │ ├── optionals: (length: 0) + │ │ │ │ │ │ │ ├── rest: ∅ + │ │ │ │ │ │ │ ├── posts: (length: 0) + │ │ │ │ │ │ │ ├── keywords: (length: 0) + │ │ │ │ │ │ │ ├── keyword_rest: ∅ + │ │ │ │ │ │ │ └── block: ∅ + │ │ │ │ │ │ ├── locals: (length: 0) + │ │ │ │ │ │ ├── opening_loc: (70,6)-(70,7) = "(" + │ │ │ │ │ │ └── closing_loc: (70,8)-(70,9) = ")" + │ │ │ │ │ └── body: + │ │ │ │ │ @ StatementsNode (location: (70,12)-(70,16)) + │ │ │ │ │ └── body: (length: 1) + │ │ │ │ │ └── @ TrueNode (location: (70,12)-(70,16)) + │ │ │ │ └── @ LocalVariableTargetNode (location: (70,20)-(70,21)) + │ │ │ │ ├── name: :c + │ │ │ │ └── depth: 0 + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── opening_loc: (70,3)-(70,4) = "[" + │ │ │ └── closing_loc: (70,21)-(70,22) = "]" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (70,0)-(70,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (69,0)-(69,4) = "case" + │ └── end_keyword_loc: (71,0)-(71,3) = "end" + ├── @ CaseNode (location: (73,0)-(75,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (73,5)-(73,7)) + │ │ ├── opening_loc: (73,5)-(73,6) = ":" + │ │ ├── value_loc: (73,6)-(73,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (74,0)-(74,28)) + │ │ ├── pattern: + │ │ │ @ ArrayPatternNode (location: (74,3)-(74,28)) + │ │ │ ├── constant: ∅ + │ │ │ ├── requireds: (length: 4) + │ │ │ │ ├── @ SymbolNode (location: (74,4)-(74,6)) + │ │ │ │ │ ├── opening_loc: (74,4)-(74,5) = ":" + │ │ │ │ │ ├── value_loc: (74,5)-(74,6) = "a" + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── unescaped: "a" + │ │ │ │ ├── @ LocalVariableTargetNode (location: (74,8)-(74,9)) + │ │ │ │ │ ├── name: :b + │ │ │ │ │ └── depth: 0 + │ │ │ │ ├── @ LocalVariableTargetNode (location: (74,11)-(74,12)) + │ │ │ │ │ ├── name: :c + │ │ │ │ │ └── depth: 0 + │ │ │ │ └── @ ArrayPatternNode (location: (74,14)-(74,27)) + │ │ │ │ ├── constant: ∅ + │ │ │ │ ├── requireds: (length: 1) + │ │ │ │ │ └── @ SymbolNode (location: (74,15)-(74,17)) + │ │ │ │ │ ├── opening_loc: (74,15)-(74,16) = ":" + │ │ │ │ │ ├── value_loc: (74,16)-(74,17) = "d" + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── unescaped: "d" + │ │ │ │ ├── rest: + │ │ │ │ │ @ SplatNode (location: (74,19)-(74,21)) + │ │ │ │ │ ├── operator_loc: (74,19)-(74,20) = "*" + │ │ │ │ │ └── expression: + │ │ │ │ │ @ LocalVariableTargetNode (location: (74,20)-(74,21)) + │ │ │ │ │ ├── name: :e + │ │ │ │ │ └── depth: 0 + │ │ │ │ ├── posts: (length: 1) + │ │ │ │ │ └── @ NilNode (location: (74,23)-(74,26)) + │ │ │ │ ├── opening_loc: (74,14)-(74,15) = "[" + │ │ │ │ └── closing_loc: (74,26)-(74,27) = "]" + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── opening_loc: (74,3)-(74,4) = "[" + │ │ │ └── closing_loc: (74,27)-(74,28) = "]" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (74,0)-(74,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (73,0)-(73,4) = "case" + │ └── end_keyword_loc: (75,0)-(75,3) = "end" + ├── @ CaseNode (location: (77,0)-(79,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (77,5)-(77,7)) + │ │ ├── opening_loc: (77,5)-(77,6) = ":" + │ │ ├── value_loc: (77,6)-(77,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (78,0)-(78,12)) + │ │ ├── pattern: + │ │ │ @ ArrayPatternNode (location: (78,3)-(78,12)) + │ │ │ ├── constant: ∅ + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ ConstantReadNode (location: (78,4)-(78,5)) + │ │ │ │ └── name: :A + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (78,7)-(78,8)) + │ │ │ │ ├── operator_loc: (78,7)-(78,8) = "*" + │ │ │ │ └── expression: ∅ + │ │ │ ├── posts: (length: 1) + │ │ │ │ └── @ ConstantReadNode (location: (78,10)-(78,11)) + │ │ │ │ └── name: :B + │ │ │ ├── opening_loc: (78,3)-(78,4) = "[" + │ │ │ └── closing_loc: (78,11)-(78,12) = "]" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (78,0)-(78,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (77,0)-(77,4) = "case" + │ └── end_keyword_loc: (79,0)-(79,3) = "end" + ├── @ CaseNode (location: (81,0)-(83,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (81,5)-(81,7)) + │ │ ├── opening_loc: (81,5)-(81,6) = ":" + │ │ ├── value_loc: (81,6)-(81,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (82,0)-(82,22)) + │ │ ├── pattern: + │ │ │ @ ArrayPatternNode (location: (82,3)-(82,22)) + │ │ │ ├── constant: ∅ + │ │ │ ├── requireds: (length: 2) + │ │ │ │ ├── @ ArrayPatternNode (location: (82,4)-(82,11)) + │ │ │ │ │ ├── constant: ∅ + │ │ │ │ │ ├── requireds: (length: 2) + │ │ │ │ │ │ ├── @ SymbolNode (location: (82,5)-(82,7)) + │ │ │ │ │ │ │ ├── opening_loc: (82,5)-(82,6) = ":" + │ │ │ │ │ │ │ ├── value_loc: (82,6)-(82,7) = "b" + │ │ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ │ │ └── unescaped: "b" + │ │ │ │ │ │ └── @ LocalVariableTargetNode (location: (82,9)-(82,10)) + │ │ │ │ │ │ ├── name: :c + │ │ │ │ │ │ └── depth: 0 + │ │ │ │ │ ├── rest: ∅ + │ │ │ │ │ ├── posts: (length: 0) + │ │ │ │ │ ├── opening_loc: (82,4)-(82,5) = "[" + │ │ │ │ │ └── closing_loc: (82,10)-(82,11) = "]" + │ │ │ │ └── @ ArrayPatternNode (location: (82,13)-(82,21)) + │ │ │ │ ├── constant: ∅ + │ │ │ │ ├── requireds: (length: 2) + │ │ │ │ │ ├── @ SymbolNode (location: (82,14)-(82,16)) + │ │ │ │ │ │ ├── opening_loc: (82,14)-(82,15) = ":" + │ │ │ │ │ │ ├── value_loc: (82,15)-(82,16) = "d" + │ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ │ └── unescaped: "d" + │ │ │ │ │ └── @ PinnedVariableNode (location: (82,18)-(82,20)) + │ │ │ │ │ ├── variable: + │ │ │ │ │ │ @ LocalVariableReadNode (location: (82,19)-(82,20)) + │ │ │ │ │ │ ├── name: :e + │ │ │ │ │ │ └── depth: 0 + │ │ │ │ │ └── operator_loc: (82,18)-(82,19) = "^" + │ │ │ │ ├── rest: ∅ + │ │ │ │ ├── posts: (length: 0) + │ │ │ │ ├── opening_loc: (82,13)-(82,14) = "[" + │ │ │ │ └── closing_loc: (82,20)-(82,21) = "]" + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── opening_loc: (82,3)-(82,4) = "[" + │ │ │ └── closing_loc: (82,21)-(82,22) = "]" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (82,0)-(82,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (81,0)-(81,4) = "case" + │ └── end_keyword_loc: (83,0)-(83,3) = "end" + ├── @ CaseNode (location: (85,0)-(87,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (85,5)-(85,7)) + │ │ ├── opening_loc: (85,5)-(85,6) = ":" + │ │ ├── value_loc: (85,6)-(85,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (86,0)-(86,5)) + │ │ ├── pattern: + │ │ │ @ ArrayPatternNode (location: (86,3)-(86,5)) + │ │ │ ├── constant: ∅ + │ │ │ ├── requireds: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── opening_loc: (86,3)-(86,4) = "[" + │ │ │ └── closing_loc: (86,4)-(86,5) = "]" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (86,0)-(86,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (85,0)-(85,4) = "case" + │ └── end_keyword_loc: (87,0)-(87,3) = "end" + ├── @ CaseNode (location: (89,0)-(91,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (89,5)-(89,7)) + │ │ ├── opening_loc: (89,5)-(89,6) = ":" + │ │ ├── value_loc: (89,6)-(89,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (90,0)-(90,9)) + │ │ ├── pattern: + │ │ │ @ ArrayPatternNode (location: (90,3)-(90,9)) + │ │ │ ├── constant: ∅ + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ PinnedExpressionNode (location: (90,4)-(90,8)) + │ │ │ │ ├── expression: + │ │ │ │ │ @ CallNode (location: (90,6)-(90,7)) + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── message_loc: (90,6)-(90,7) = "a" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── block: ∅ + │ │ │ │ │ ├── flags: variable_call + │ │ │ │ │ └── name: "a" + │ │ │ │ ├── operator_loc: (90,4)-(90,5) = "^" + │ │ │ │ ├── lparen_loc: (90,5)-(90,6) = "(" + │ │ │ │ └── rparen_loc: (90,7)-(90,8) = ")" + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── opening_loc: (90,3)-(90,4) = "[" + │ │ │ └── closing_loc: (90,8)-(90,9) = "]" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (90,0)-(90,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (89,0)-(89,4) = "case" + │ └── end_keyword_loc: (91,0)-(91,3) = "end" + ├── @ CaseNode (location: (93,0)-(95,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (93,5)-(93,7)) + │ │ ├── opening_loc: (93,5)-(93,6) = ":" + │ │ ├── value_loc: (93,6)-(93,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (94,0)-(94,19)) + │ │ ├── pattern: + │ │ │ @ ArrayPatternNode (location: (94,3)-(94,19)) + │ │ │ ├── constant: ∅ + │ │ │ ├── requireds: (length: 3) + │ │ │ │ ├── @ PinnedVariableNode (location: (94,4)-(94,7)) + │ │ │ │ │ ├── variable: + │ │ │ │ │ │ @ InstanceVariableReadNode (location: (94,5)-(94,7)) + │ │ │ │ │ │ └── name: :@a + │ │ │ │ │ └── operator_loc: (94,4)-(94,5) = "^" + │ │ │ │ ├── @ PinnedVariableNode (location: (94,9)-(94,12)) + │ │ │ │ │ ├── variable: + │ │ │ │ │ │ @ GlobalVariableReadNode (location: (94,10)-(94,12)) + │ │ │ │ │ │ └── name: :$b + │ │ │ │ │ └── operator_loc: (94,9)-(94,10) = "^" + │ │ │ │ └── @ PinnedVariableNode (location: (94,14)-(94,18)) + │ │ │ │ ├── variable: + │ │ │ │ │ @ ClassVariableReadNode (location: (94,15)-(94,18)) + │ │ │ │ │ └── name: :@@c + │ │ │ │ └── operator_loc: (94,14)-(94,15) = "^" + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── opening_loc: (94,3)-(94,4) = "[" + │ │ │ └── closing_loc: (94,18)-(94,19) = "]" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (94,0)-(94,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (93,0)-(93,4) = "case" + │ └── end_keyword_loc: (95,0)-(95,3) = "end" + ├── @ CaseNode (location: (97,0)-(99,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (97,5)-(97,7)) + │ │ ├── opening_loc: (97,5)-(97,6) = ":" + │ │ ├── value_loc: (97,6)-(97,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (98,0)-(98,12)) + │ │ ├── pattern: + │ │ │ @ XStringNode (location: (98,3)-(98,12)) + │ │ │ ├── opening_loc: (98,3)-(98,4) = "`" + │ │ │ ├── content_loc: (98,4)-(98,11) = "echo hi" + │ │ │ ├── closing_loc: (98,11)-(98,12) = "`" + │ │ │ └── unescaped: "echo hi" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (98,0)-(98,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (97,0)-(97,4) = "case" + │ └── end_keyword_loc: (99,0)-(99,3) = "end" + ├── @ CaseNode (location: (101,0)-(103,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (101,5)-(101,7)) + │ │ ├── opening_loc: (101,5)-(101,6) = ":" + │ │ ├── value_loc: (101,6)-(101,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (102,0)-(102,16)) + │ │ ├── pattern: + │ │ │ @ ArrayPatternNode (location: (102,3)-(102,16)) + │ │ │ ├── constant: ∅ + │ │ │ ├── requireds: (length: 3) + │ │ │ │ ├── @ NilNode (location: (102,3)-(102,6)) + │ │ │ │ ├── @ NilNode (location: (102,8)-(102,11)) + │ │ │ │ └── @ NilNode (location: (102,13)-(102,16)) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── opening_loc: ∅ + │ │ │ └── closing_loc: ∅ + │ │ ├── statements: ∅ + │ │ ├── in_loc: (102,0)-(102,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (101,0)-(101,4) = "case" + │ └── end_keyword_loc: (103,0)-(103,3) = "end" + ├── @ CaseNode (location: (105,0)-(107,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (105,5)-(105,7)) + │ │ ├── opening_loc: (105,5)-(105,6) = ":" + │ │ ├── value_loc: (105,6)-(105,7) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (106,0)-(106,11)) + │ │ ├── pattern: + │ │ │ @ HashPatternNode (location: (106,3)-(106,11)) + │ │ │ ├── constant: ∅ + │ │ │ ├── assocs: (length: 1) + │ │ │ │ └── @ AssocNode (location: (106,5)-(106,9)) + │ │ │ │ ├── key: + │ │ │ │ │ @ SymbolNode (location: (106,5)-(106,9)) + │ │ │ │ │ ├── opening_loc: (106,5)-(106,6) = "\"" + │ │ │ │ │ ├── value_loc: (106,6)-(106,7) = "b" + │ │ │ │ │ ├── closing_loc: (106,7)-(106,9) = "\":" + │ │ │ │ │ └── unescaped: "b" + │ │ │ │ ├── value: ∅ + │ │ │ │ └── operator_loc: ∅ + │ │ │ ├── kwrest: ∅ + │ │ │ ├── opening_loc: (106,3)-(106,4) = "{" + │ │ │ └── closing_loc: (106,10)-(106,11) = "}" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (106,0)-(106,2) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (105,0)-(105,4) = "case" + │ └── end_keyword_loc: (107,0)-(107,3) = "end" + └── @ CaseNode (location: (109,0)-(111,3)) + ├── predicate: + │ @ SymbolNode (location: (109,5)-(109,7)) + │ ├── opening_loc: (109,5)-(109,6) = ":" + │ ├── value_loc: (109,6)-(109,7) = "a" + │ ├── closing_loc: ∅ + │ └── unescaped: "a" + ├── conditions: (length: 1) + │ └── @ InNode (location: (110,0)-(110,5)) + │ ├── pattern: + │ │ @ HashPatternNode (location: (110,3)-(110,5)) + │ │ ├── constant: ∅ + │ │ ├── assocs: (length: 0) + │ │ ├── kwrest: ∅ + │ │ ├── opening_loc: (110,3)-(110,4) = "{" + │ │ └── closing_loc: (110,4)-(110,5) = "}" + │ ├── statements: ∅ + │ ├── in_loc: (110,0)-(110,2) = "in" + │ └── then_loc: ∅ + ├── consequent: ∅ + ├── case_keyword_loc: (109,0)-(109,4) = "case" + └── end_keyword_loc: (111,0)-(111,3) = "end" diff --git a/test/prism/snapshots/seattlerb/case_in_31.txt b/test/prism/snapshots/seattlerb/case_in_31.txt new file mode 100644 index 0000000000..e753c3ccff --- /dev/null +++ b/test/prism/snapshots/seattlerb/case_in_31.txt @@ -0,0 +1,46 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [:c] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CaseNode (location: (1,0)-(4,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── opening_loc: (1,5)-(1,6) = ":" + │ ├── value_loc: (1,6)-(1,7) = "a" + │ ├── closing_loc: ∅ + │ └── unescaped: "a" + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,0)-(3,4)) + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (2,3)-(2,11)) + │ │ ├── constant: ∅ + │ │ ├── requireds: (length: 1) + │ │ │ └── @ SymbolNode (location: (2,4)-(2,6)) + │ │ │ ├── opening_loc: (2,4)-(2,5) = ":" + │ │ │ ├── value_loc: (2,5)-(2,6) = "b" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "b" + │ │ ├── rest: + │ │ │ @ SplatNode (location: (2,8)-(2,10)) + │ │ │ ├── operator_loc: (2,8)-(2,9) = "*" + │ │ │ └── expression: + │ │ │ @ LocalVariableTargetNode (location: (2,9)-(2,10)) + │ │ │ ├── name: :c + │ │ │ └── depth: 0 + │ │ ├── posts: (length: 0) + │ │ ├── opening_loc: (2,3)-(2,4) = "[" + │ │ └── closing_loc: (2,10)-(2,11) = "]" + │ ├── statements: + │ │ @ StatementsNode (location: (3,2)-(3,4)) + │ │ └── body: (length: 1) + │ │ └── @ SymbolNode (location: (3,2)-(3,4)) + │ │ ├── opening_loc: (3,2)-(3,3) = ":" + │ │ ├── value_loc: (3,3)-(3,4) = "d" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "d" + │ ├── in_loc: (2,0)-(2,2) = "in" + │ └── then_loc: ∅ + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (4,0)-(4,3) = "end" diff --git a/test/prism/snapshots/seattlerb/case_in_37.txt b/test/prism/snapshots/seattlerb/case_in_37.txt new file mode 100644 index 0000000000..46bdcf40b6 --- /dev/null +++ b/test/prism/snapshots/seattlerb/case_in_37.txt @@ -0,0 +1,55 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CaseNode (location: (1,0)-(4,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── opening_loc: (1,5)-(1,6) = ":" + │ ├── value_loc: (1,6)-(1,7) = "a" + │ ├── closing_loc: ∅ + │ └── unescaped: "a" + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,0)-(3,4)) + │ ├── pattern: + │ │ @ HashPatternNode (location: (2,3)-(2,19)) + │ │ ├── constant: ∅ + │ │ ├── assocs: (length: 1) + │ │ │ └── @ AssocNode (location: (2,5)-(2,17)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (2,5)-(2,7)) + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (2,5)-(2,6) = "b" + │ │ │ │ ├── closing_loc: (2,6)-(2,7) = ":" + │ │ │ │ └── unescaped: "b" + │ │ │ ├── value: + │ │ │ │ @ ArrayPatternNode (location: (2,8)-(2,17)) + │ │ │ │ ├── constant: ∅ + │ │ │ │ ├── requireds: (length: 1) + │ │ │ │ │ └── @ ConstantReadNode (location: (2,9)-(2,13)) + │ │ │ │ │ └── name: :Hash + │ │ │ │ ├── rest: + │ │ │ │ │ @ SplatNode (location: (2,15)-(2,16)) + │ │ │ │ │ ├── operator_loc: (2,15)-(2,16) = "*" + │ │ │ │ │ └── expression: ∅ + │ │ │ │ ├── posts: (length: 0) + │ │ │ │ ├── opening_loc: (2,8)-(2,9) = "[" + │ │ │ │ └── closing_loc: (2,16)-(2,17) = "]" + │ │ │ └── operator_loc: ∅ + │ │ ├── kwrest: ∅ + │ │ ├── opening_loc: (2,3)-(2,4) = "{" + │ │ └── closing_loc: (2,18)-(2,19) = "}" + │ ├── statements: + │ │ @ StatementsNode (location: (3,2)-(3,4)) + │ │ └── body: (length: 1) + │ │ └── @ SymbolNode (location: (3,2)-(3,4)) + │ │ ├── opening_loc: (3,2)-(3,3) = ":" + │ │ ├── value_loc: (3,3)-(3,4) = "c" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "c" + │ ├── in_loc: (2,0)-(2,2) = "in" + │ └── then_loc: ∅ + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (4,0)-(4,3) = "end" diff --git a/test/prism/snapshots/seattlerb/case_in_42.txt b/test/prism/snapshots/seattlerb/case_in_42.txt new file mode 100644 index 0000000000..fe69a9e3d3 --- /dev/null +++ b/test/prism/snapshots/seattlerb/case_in_42.txt @@ -0,0 +1,42 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [:_] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ CaseNode (location: (1,0)-(3,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── opening_loc: (1,5)-(1,6) = ":" + │ ├── value_loc: (1,6)-(1,7) = "a" + │ ├── closing_loc: ∅ + │ └── unescaped: "a" + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,0)-(2,18)) + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (2,3)-(2,9)) + │ │ ├── constant: ∅ + │ │ ├── requireds: (length: 1) + │ │ │ └── @ SymbolNode (location: (2,3)-(2,5)) + │ │ │ ├── opening_loc: (2,3)-(2,4) = ":" + │ │ │ ├── value_loc: (2,4)-(2,5) = "b" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "b" + │ │ ├── rest: + │ │ │ @ SplatNode (location: (2,7)-(2,9)) + │ │ │ ├── operator_loc: (2,7)-(2,8) = "*" + │ │ │ └── expression: + │ │ │ @ LocalVariableTargetNode (location: (2,8)-(2,9)) + │ │ │ ├── name: :_ + │ │ │ └── depth: 0 + │ │ ├── posts: (length: 0) + │ │ ├── opening_loc: ∅ + │ │ └── closing_loc: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (2,15)-(2,18)) + │ │ └── body: (length: 1) + │ │ └── @ NilNode (location: (2,15)-(2,18)) + │ ├── in_loc: (2,0)-(2,2) = "in" + │ └── then_loc: (2,10)-(2,14) = "then" + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (3,0)-(3,3) = "end" diff --git a/test/prism/snapshots/seattlerb/case_in_42_2.txt b/test/prism/snapshots/seattlerb/case_in_42_2.txt new file mode 100644 index 0000000000..f4e6806d35 --- /dev/null +++ b/test/prism/snapshots/seattlerb/case_in_42_2.txt @@ -0,0 +1,39 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [:list] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ CaseNode (location: (1,0)-(3,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── opening_loc: (1,5)-(1,6) = ":" + │ ├── value_loc: (1,6)-(1,7) = "a" + │ ├── closing_loc: ∅ + │ └── unescaped: "a" + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,0)-(2,20)) + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (2,3)-(2,11)) + │ │ ├── constant: + │ │ │ @ ConstantReadNode (location: (2,3)-(2,4)) + │ │ │ └── name: :A + │ │ ├── requireds: (length: 0) + │ │ ├── rest: + │ │ │ @ SplatNode (location: (2,5)-(2,10)) + │ │ │ ├── operator_loc: (2,5)-(2,6) = "*" + │ │ │ └── expression: + │ │ │ @ LocalVariableTargetNode (location: (2,6)-(2,10)) + │ │ │ ├── name: :list + │ │ │ └── depth: 0 + │ │ ├── posts: (length: 0) + │ │ ├── opening_loc: (2,4)-(2,5) = "(" + │ │ └── closing_loc: (2,10)-(2,11) = ")" + │ ├── statements: + │ │ @ StatementsNode (location: (2,17)-(2,20)) + │ │ └── body: (length: 1) + │ │ └── @ NilNode (location: (2,17)-(2,20)) + │ ├── in_loc: (2,0)-(2,2) = "in" + │ └── then_loc: (2,12)-(2,16) = "then" + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (3,0)-(3,3) = "end" diff --git a/test/prism/snapshots/seattlerb/case_in_47.txt b/test/prism/snapshots/seattlerb/case_in_47.txt new file mode 100644 index 0000000000..32b24fc98d --- /dev/null +++ b/test/prism/snapshots/seattlerb/case_in_47.txt @@ -0,0 +1,48 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CaseNode (location: (1,0)-(4,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── opening_loc: (1,5)-(1,6) = ":" + │ ├── value_loc: (1,6)-(1,7) = "a" + │ ├── closing_loc: ∅ + │ └── unescaped: "a" + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,0)-(3,4)) + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (2,3)-(2,14)) + │ │ ├── constant: ∅ + │ │ ├── requireds: (length: 0) + │ │ ├── rest: + │ │ │ @ SplatNode (location: (2,4)-(2,5)) + │ │ │ ├── operator_loc: (2,4)-(2,5) = "*" + │ │ │ └── expression: ∅ + │ │ ├── posts: (length: 2) + │ │ │ ├── @ SymbolNode (location: (2,7)-(2,9)) + │ │ │ │ ├── opening_loc: (2,7)-(2,8) = ":" + │ │ │ │ ├── value_loc: (2,8)-(2,9) = "b" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "b" + │ │ │ └── @ SymbolNode (location: (2,11)-(2,13)) + │ │ │ ├── opening_loc: (2,11)-(2,12) = ":" + │ │ │ ├── value_loc: (2,12)-(2,13) = "c" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "c" + │ │ ├── opening_loc: (2,3)-(2,4) = "[" + │ │ └── closing_loc: (2,13)-(2,14) = "]" + │ ├── statements: + │ │ @ StatementsNode (location: (3,2)-(3,4)) + │ │ └── body: (length: 1) + │ │ └── @ SymbolNode (location: (3,2)-(3,4)) + │ │ ├── opening_loc: (3,2)-(3,3) = ":" + │ │ ├── value_loc: (3,3)-(3,4) = "d" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "d" + │ ├── in_loc: (2,0)-(2,2) = "in" + │ └── then_loc: ∅ + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (4,0)-(4,3) = "end" diff --git a/test/prism/snapshots/seattlerb/case_in_67.txt b/test/prism/snapshots/seattlerb/case_in_67.txt new file mode 100644 index 0000000000..73649059f0 --- /dev/null +++ b/test/prism/snapshots/seattlerb/case_in_67.txt @@ -0,0 +1,31 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ CaseNode (location: (1,0)-(3,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── opening_loc: (1,5)-(1,6) = ":" + │ ├── value_loc: (1,6)-(1,7) = "a" + │ ├── closing_loc: ∅ + │ └── unescaped: "a" + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,0)-(2,15)) + │ ├── pattern: + │ │ @ RangeNode (location: (2,3)-(2,6)) + │ │ ├── left: + │ │ │ @ IntegerNode (location: (2,3)-(2,4)) + │ │ │ └── flags: decimal + │ │ ├── right: ∅ + │ │ ├── operator_loc: (2,4)-(2,6) = ".." + │ │ └── flags: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (2,12)-(2,15)) + │ │ └── body: (length: 1) + │ │ └── @ NilNode (location: (2,12)-(2,15)) + │ ├── in_loc: (2,0)-(2,2) = "in" + │ └── then_loc: (2,7)-(2,11) = "then" + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (3,0)-(3,3) = "end" diff --git a/test/prism/snapshots/seattlerb/case_in_86.txt b/test/prism/snapshots/seattlerb/case_in_86.txt new file mode 100644 index 0000000000..7197e77bc0 --- /dev/null +++ b/test/prism/snapshots/seattlerb/case_in_86.txt @@ -0,0 +1,49 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ CaseNode (location: (1,0)-(3,3)) + ├── predicate: + │ @ ArrayNode (location: (1,5)-(1,13)) + │ ├── elements: (length: 2) + │ │ ├── @ SymbolNode (location: (1,6)-(1,8)) + │ │ │ ├── opening_loc: (1,6)-(1,7) = ":" + │ │ │ ├── value_loc: (1,7)-(1,8) = "a" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a" + │ │ └── @ SymbolNode (location: (1,10)-(1,12)) + │ │ ├── opening_loc: (1,10)-(1,11) = ":" + │ │ ├── value_loc: (1,11)-(1,12) = "b" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "b" + │ ├── opening_loc: (1,5)-(1,6) = "[" + │ └── closing_loc: (1,12)-(1,13) = "]" + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,0)-(2,25)) + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (2,3)-(2,16)) + │ │ ├── constant: ∅ + │ │ ├── requireds: (length: 1) + │ │ │ └── @ ConstantPathNode (location: (2,3)-(2,13)) + │ │ │ ├── parent: ∅ + │ │ │ ├── child: + │ │ │ │ @ ConstantReadNode (location: (2,5)-(2,13)) + │ │ │ │ └── name: :NilClass + │ │ │ └── delimiter_loc: (2,3)-(2,5) = "::" + │ │ ├── rest: + │ │ │ @ SplatNode (location: (2,15)-(2,16)) + │ │ │ ├── operator_loc: (2,15)-(2,16) = "*" + │ │ │ └── expression: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── opening_loc: ∅ + │ │ └── closing_loc: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (2,22)-(2,25)) + │ │ └── body: (length: 1) + │ │ └── @ NilNode (location: (2,22)-(2,25)) + │ ├── in_loc: (2,0)-(2,2) = "in" + │ └── then_loc: (2,17)-(2,21) = "then" + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (3,0)-(3,3) = "end" diff --git a/test/prism/snapshots/seattlerb/case_in_86_2.txt b/test/prism/snapshots/seattlerb/case_in_86_2.txt new file mode 100644 index 0000000000..9d3abbb31d --- /dev/null +++ b/test/prism/snapshots/seattlerb/case_in_86_2.txt @@ -0,0 +1,49 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ CaseNode (location: (1,0)-(3,3)) + ├── predicate: + │ @ ArrayNode (location: (1,5)-(1,13)) + │ ├── elements: (length: 2) + │ │ ├── @ SymbolNode (location: (1,6)-(1,8)) + │ │ │ ├── opening_loc: (1,6)-(1,7) = ":" + │ │ │ ├── value_loc: (1,7)-(1,8) = "a" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a" + │ │ └── @ SymbolNode (location: (1,10)-(1,12)) + │ │ ├── opening_loc: (1,10)-(1,11) = ":" + │ │ ├── value_loc: (1,11)-(1,12) = "b" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "b" + │ ├── opening_loc: (1,5)-(1,6) = "[" + │ └── closing_loc: (1,12)-(1,13) = "]" + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,0)-(2,25)) + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (2,3)-(2,16)) + │ │ ├── constant: ∅ + │ │ ├── requireds: (length: 0) + │ │ ├── rest: + │ │ │ @ SplatNode (location: (2,3)-(2,4)) + │ │ │ ├── operator_loc: (2,3)-(2,4) = "*" + │ │ │ └── expression: ∅ + │ │ ├── posts: (length: 1) + │ │ │ └── @ ConstantPathNode (location: (2,6)-(2,16)) + │ │ │ ├── parent: ∅ + │ │ │ ├── child: + │ │ │ │ @ ConstantReadNode (location: (2,8)-(2,16)) + │ │ │ │ └── name: :NilClass + │ │ │ └── delimiter_loc: (2,6)-(2,8) = "::" + │ │ ├── opening_loc: ∅ + │ │ └── closing_loc: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (2,22)-(2,25)) + │ │ └── body: (length: 1) + │ │ └── @ NilNode (location: (2,22)-(2,25)) + │ ├── in_loc: (2,0)-(2,2) = "in" + │ └── then_loc: (2,17)-(2,21) = "then" + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (3,0)-(3,3) = "end" diff --git a/test/prism/snapshots/seattlerb/case_in_array_pat_const.txt b/test/prism/snapshots/seattlerb/case_in_array_pat_const.txt new file mode 100644 index 0000000000..8316c51f2e --- /dev/null +++ b/test/prism/snapshots/seattlerb/case_in_array_pat_const.txt @@ -0,0 +1,40 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [:c] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CaseNode (location: (1,0)-(4,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── opening_loc: (1,5)-(1,6) = ":" + │ ├── value_loc: (1,6)-(1,7) = "a" + │ ├── closing_loc: ∅ + │ └── unescaped: "a" + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,0)-(3,4)) + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (2,3)-(2,7)) + │ │ ├── constant: + │ │ │ @ ConstantReadNode (location: (2,3)-(2,4)) + │ │ │ └── name: :B + │ │ ├── requireds: (length: 1) + │ │ │ └── @ LocalVariableTargetNode (location: (2,5)-(2,6)) + │ │ │ ├── name: :c + │ │ │ └── depth: 0 + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── opening_loc: (2,4)-(2,5) = "[" + │ │ └── closing_loc: (2,6)-(2,7) = "]" + │ ├── statements: + │ │ @ StatementsNode (location: (3,2)-(3,4)) + │ │ └── body: (length: 1) + │ │ └── @ SymbolNode (location: (3,2)-(3,4)) + │ │ ├── opening_loc: (3,2)-(3,3) = ":" + │ │ ├── value_loc: (3,3)-(3,4) = "d" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "d" + │ ├── in_loc: (2,0)-(2,2) = "in" + │ └── then_loc: ∅ + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (4,0)-(4,3) = "end" diff --git a/test/prism/snapshots/seattlerb/case_in_array_pat_const2.txt b/test/prism/snapshots/seattlerb/case_in_array_pat_const2.txt new file mode 100644 index 0000000000..9f54b921ac --- /dev/null +++ b/test/prism/snapshots/seattlerb/case_in_array_pat_const2.txt @@ -0,0 +1,46 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [:d] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CaseNode (location: (1,0)-(4,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── opening_loc: (1,5)-(1,6) = ":" + │ ├── value_loc: (1,6)-(1,7) = "a" + │ ├── closing_loc: ∅ + │ └── unescaped: "a" + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,0)-(3,4)) + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (2,3)-(2,10)) + │ │ ├── constant: + │ │ │ @ ConstantPathNode (location: (2,3)-(2,7)) + │ │ │ ├── parent: + │ │ │ │ @ ConstantReadNode (location: (2,3)-(2,4)) + │ │ │ │ └── name: :B + │ │ │ ├── child: + │ │ │ │ @ ConstantReadNode (location: (2,6)-(2,7)) + │ │ │ │ └── name: :C + │ │ │ └── delimiter_loc: (2,4)-(2,6) = "::" + │ │ ├── requireds: (length: 1) + │ │ │ └── @ LocalVariableTargetNode (location: (2,8)-(2,9)) + │ │ │ ├── name: :d + │ │ │ └── depth: 0 + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── opening_loc: (2,7)-(2,8) = "[" + │ │ └── closing_loc: (2,9)-(2,10) = "]" + │ ├── statements: + │ │ @ StatementsNode (location: (3,2)-(3,4)) + │ │ └── body: (length: 1) + │ │ └── @ SymbolNode (location: (3,2)-(3,4)) + │ │ ├── opening_loc: (3,2)-(3,3) = ":" + │ │ ├── value_loc: (3,3)-(3,4) = "e" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "e" + │ ├── in_loc: (2,0)-(2,2) = "in" + │ └── then_loc: ∅ + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (4,0)-(4,3) = "end" diff --git a/test/prism/snapshots/seattlerb/case_in_array_pat_paren_assign.txt b/test/prism/snapshots/seattlerb/case_in_array_pat_paren_assign.txt new file mode 100644 index 0000000000..0b903e8d91 --- /dev/null +++ b/test/prism/snapshots/seattlerb/case_in_array_pat_paren_assign.txt @@ -0,0 +1,46 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [:d] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CaseNode (location: (1,0)-(4,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── opening_loc: (1,5)-(1,6) = ":" + │ ├── value_loc: (1,6)-(1,7) = "a" + │ ├── closing_loc: ∅ + │ └── unescaped: "a" + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,0)-(3,4)) + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (2,3)-(2,12)) + │ │ ├── constant: + │ │ │ @ ConstantReadNode (location: (2,3)-(2,4)) + │ │ │ └── name: :B + │ │ ├── requireds: (length: 1) + │ │ │ └── @ CapturePatternNode (location: (2,5)-(2,11)) + │ │ │ ├── value: + │ │ │ │ @ ConstantReadNode (location: (2,5)-(2,6)) + │ │ │ │ └── name: :C + │ │ │ ├── target: + │ │ │ │ @ LocalVariableTargetNode (location: (2,10)-(2,11)) + │ │ │ │ ├── name: :d + │ │ │ │ └── depth: 0 + │ │ │ └── operator_loc: (2,7)-(2,9) = "=>" + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── opening_loc: (2,4)-(2,5) = "(" + │ │ └── closing_loc: (2,11)-(2,12) = ")" + │ ├── statements: + │ │ @ StatementsNode (location: (3,2)-(3,4)) + │ │ └── body: (length: 1) + │ │ └── @ SymbolNode (location: (3,2)-(3,4)) + │ │ ├── opening_loc: (3,2)-(3,3) = ":" + │ │ ├── value_loc: (3,3)-(3,4) = "d" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "d" + │ ├── in_loc: (2,0)-(2,2) = "in" + │ └── then_loc: ∅ + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (4,0)-(4,3) = "end" diff --git a/test/prism/snapshots/seattlerb/case_in_const.txt b/test/prism/snapshots/seattlerb/case_in_const.txt new file mode 100644 index 0000000000..59880bc2a7 --- /dev/null +++ b/test/prism/snapshots/seattlerb/case_in_const.txt @@ -0,0 +1,27 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CaseNode (location: (1,0)-(4,3)) + ├── predicate: + │ @ ConstantReadNode (location: (1,5)-(1,10)) + │ └── name: :Array + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,0)-(3,4)) + │ ├── pattern: + │ │ @ ConstantReadNode (location: (2,3)-(2,8)) + │ │ └── name: :Class + │ ├── statements: + │ │ @ StatementsNode (location: (3,2)-(3,4)) + │ │ └── body: (length: 1) + │ │ └── @ SymbolNode (location: (3,2)-(3,4)) + │ │ ├── opening_loc: (3,2)-(3,3) = ":" + │ │ ├── value_loc: (3,3)-(3,4) = "b" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "b" + │ ├── in_loc: (2,0)-(2,2) = "in" + │ └── then_loc: ∅ + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (4,0)-(4,3) = "end" diff --git a/test/prism/snapshots/seattlerb/case_in_else.txt b/test/prism/snapshots/seattlerb/case_in_else.txt new file mode 100644 index 0000000000..c132443cc8 --- /dev/null +++ b/test/prism/snapshots/seattlerb/case_in_else.txt @@ -0,0 +1,38 @@ +@ ProgramNode (location: (1,0)-(6,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(6,3)) + └── body: (length: 1) + └── @ CaseNode (location: (1,0)-(6,3)) + ├── predicate: + │ @ ConstantReadNode (location: (1,5)-(1,10)) + │ └── name: :Array + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,0)-(3,4)) + │ ├── pattern: + │ │ @ ConstantReadNode (location: (2,3)-(2,8)) + │ │ └── name: :Class + │ ├── statements: + │ │ @ StatementsNode (location: (3,2)-(3,4)) + │ │ └── body: (length: 1) + │ │ └── @ SymbolNode (location: (3,2)-(3,4)) + │ │ ├── opening_loc: (3,2)-(3,3) = ":" + │ │ ├── value_loc: (3,3)-(3,4) = "b" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "b" + │ ├── in_loc: (2,0)-(2,2) = "in" + │ └── then_loc: ∅ + ├── consequent: + │ @ ElseNode (location: (4,0)-(6,3)) + │ ├── else_keyword_loc: (4,0)-(4,4) = "else" + │ ├── statements: + │ │ @ StatementsNode (location: (5,2)-(5,4)) + │ │ └── body: (length: 1) + │ │ └── @ SymbolNode (location: (5,2)-(5,4)) + │ │ ├── opening_loc: (5,2)-(5,3) = ":" + │ │ ├── value_loc: (5,3)-(5,4) = "c" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "c" + │ └── end_keyword_loc: (6,0)-(6,3) = "end" + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (6,0)-(6,3) = "end" diff --git a/test/prism/snapshots/seattlerb/case_in_find.txt b/test/prism/snapshots/seattlerb/case_in_find.txt new file mode 100644 index 0000000000..191dee3a04 --- /dev/null +++ b/test/prism/snapshots/seattlerb/case_in_find.txt @@ -0,0 +1,45 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [:a, :b] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ CaseNode (location: (1,0)-(3,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── opening_loc: (1,5)-(1,6) = ":" + │ ├── value_loc: (1,6)-(1,7) = "a" + │ ├── closing_loc: ∅ + │ └── unescaped: "a" + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,2)-(2,15)) + │ ├── pattern: + │ │ @ FindPatternNode (location: (2,5)-(2,15)) + │ │ ├── constant: ∅ + │ │ ├── left: + │ │ │ @ SplatNode (location: (2,5)-(2,7)) + │ │ │ ├── operator_loc: (2,5)-(2,6) = "*" + │ │ │ └── expression: + │ │ │ @ LocalVariableTargetNode (location: (2,6)-(2,7)) + │ │ │ ├── name: :a + │ │ │ └── depth: 0 + │ │ ├── requireds: (length: 1) + │ │ │ └── @ SymbolNode (location: (2,9)-(2,11)) + │ │ │ ├── opening_loc: (2,9)-(2,10) = ":" + │ │ │ ├── value_loc: (2,10)-(2,11) = "+" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "+" + │ │ ├── right: + │ │ │ @ SplatNode (location: (2,13)-(2,15)) + │ │ │ ├── operator_loc: (2,13)-(2,14) = "*" + │ │ │ └── expression: + │ │ │ @ LocalVariableTargetNode (location: (2,14)-(2,15)) + │ │ │ ├── name: :b + │ │ │ └── depth: 0 + │ │ ├── opening_loc: ∅ + │ │ └── closing_loc: ∅ + │ ├── statements: ∅ + │ ├── in_loc: (2,2)-(2,4) = "in" + │ └── then_loc: ∅ + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (3,0)-(3,3) = "end" diff --git a/test/prism/snapshots/seattlerb/case_in_find_array.txt b/test/prism/snapshots/seattlerb/case_in_find_array.txt new file mode 100644 index 0000000000..df764a4b07 --- /dev/null +++ b/test/prism/snapshots/seattlerb/case_in_find_array.txt @@ -0,0 +1,42 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [:c] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ CaseNode (location: (1,0)-(3,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── opening_loc: (1,5)-(1,6) = ":" + │ ├── value_loc: (1,6)-(1,7) = "a" + │ ├── closing_loc: ∅ + │ └── unescaped: "a" + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,0)-(2,16)) + │ ├── pattern: + │ │ @ FindPatternNode (location: (2,3)-(2,16)) + │ │ ├── constant: ∅ + │ │ ├── left: + │ │ │ @ SplatNode (location: (2,4)-(2,5)) + │ │ │ ├── operator_loc: (2,4)-(2,5) = "*" + │ │ │ └── expression: ∅ + │ │ ├── requireds: (length: 2) + │ │ │ ├── @ SymbolNode (location: (2,7)-(2,9)) + │ │ │ │ ├── opening_loc: (2,7)-(2,8) = ":" + │ │ │ │ ├── value_loc: (2,8)-(2,9) = "b" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "b" + │ │ │ └── @ LocalVariableTargetNode (location: (2,11)-(2,12)) + │ │ │ ├── name: :c + │ │ │ └── depth: 0 + │ │ ├── right: + │ │ │ @ SplatNode (location: (2,14)-(2,15)) + │ │ │ ├── operator_loc: (2,14)-(2,15) = "*" + │ │ │ └── expression: ∅ + │ │ ├── opening_loc: (2,3)-(2,4) = "[" + │ │ └── closing_loc: (2,15)-(2,16) = "]" + │ ├── statements: ∅ + │ ├── in_loc: (2,0)-(2,2) = "in" + │ └── then_loc: ∅ + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (3,0)-(3,3) = "end" diff --git a/test/prism/snapshots/seattlerb/case_in_hash_pat.txt b/test/prism/snapshots/seattlerb/case_in_hash_pat.txt new file mode 100644 index 0000000000..e039140241 --- /dev/null +++ b/test/prism/snapshots/seattlerb/case_in_hash_pat.txt @@ -0,0 +1,64 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CaseNode (location: (1,0)-(4,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── opening_loc: (1,5)-(1,6) = ":" + │ ├── value_loc: (1,6)-(1,7) = "a" + │ ├── closing_loc: ∅ + │ └── unescaped: "a" + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,0)-(3,4)) + │ ├── pattern: + │ │ @ HashPatternNode (location: (2,3)-(2,21)) + │ │ ├── constant: ∅ + │ │ ├── assocs: (length: 2) + │ │ │ ├── @ AssocNode (location: (2,5)-(2,11)) + │ │ │ │ ├── key: + │ │ │ │ │ @ SymbolNode (location: (2,5)-(2,7)) + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── value_loc: (2,5)-(2,6) = "b" + │ │ │ │ │ ├── closing_loc: (2,6)-(2,7) = ":" + │ │ │ │ │ └── unescaped: "b" + │ │ │ │ ├── value: + │ │ │ │ │ @ StringNode (location: (2,8)-(2,11)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ ├── opening_loc: (2,8)-(2,9) = "'" + │ │ │ │ │ ├── content_loc: (2,9)-(2,10) = "c" + │ │ │ │ │ ├── closing_loc: (2,10)-(2,11) = "'" + │ │ │ │ │ └── unescaped: "c" + │ │ │ │ └── operator_loc: ∅ + │ │ │ └── @ AssocNode (location: (2,13)-(2,19)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (2,13)-(2,15)) + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (2,13)-(2,14) = "d" + │ │ │ │ ├── closing_loc: (2,14)-(2,15) = ":" + │ │ │ │ └── unescaped: "d" + │ │ │ ├── value: + │ │ │ │ @ StringNode (location: (2,16)-(2,19)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: (2,16)-(2,17) = "\"" + │ │ │ │ ├── content_loc: (2,17)-(2,18) = "e" + │ │ │ │ ├── closing_loc: (2,18)-(2,19) = "\"" + │ │ │ │ └── unescaped: "e" + │ │ │ └── operator_loc: ∅ + │ │ ├── kwrest: ∅ + │ │ ├── opening_loc: (2,3)-(2,4) = "{" + │ │ └── closing_loc: (2,20)-(2,21) = "}" + │ ├── statements: + │ │ @ StatementsNode (location: (3,2)-(3,4)) + │ │ └── body: (length: 1) + │ │ └── @ SymbolNode (location: (3,2)-(3,4)) + │ │ ├── opening_loc: (3,2)-(3,3) = ":" + │ │ ├── value_loc: (3,3)-(3,4) = "f" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "f" + │ ├── in_loc: (2,0)-(2,2) = "in" + │ └── then_loc: (2,22)-(2,26) = "then" + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (4,0)-(4,3) = "end" diff --git a/test/prism/snapshots/seattlerb/case_in_hash_pat_assign.txt b/test/prism/snapshots/seattlerb/case_in_hash_pat_assign.txt new file mode 100644 index 0000000000..b24718b1ee --- /dev/null +++ b/test/prism/snapshots/seattlerb/case_in_hash_pat_assign.txt @@ -0,0 +1,76 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [:x, :f] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CaseNode (location: (1,0)-(4,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── opening_loc: (1,5)-(1,6) = ":" + │ ├── value_loc: (1,6)-(1,7) = "a" + │ ├── closing_loc: ∅ + │ └── unescaped: "a" + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,0)-(3,4)) + │ ├── pattern: + │ │ @ HashPatternNode (location: (2,3)-(2,34)) + │ │ ├── constant: ∅ + │ │ ├── assocs: (length: 3) + │ │ │ ├── @ AssocNode (location: (2,5)-(2,20)) + │ │ │ │ ├── key: + │ │ │ │ │ @ SymbolNode (location: (2,5)-(2,7)) + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── value_loc: (2,5)-(2,6) = "b" + │ │ │ │ │ ├── closing_loc: (2,6)-(2,7) = ":" + │ │ │ │ │ └── unescaped: "b" + │ │ │ │ ├── value: + │ │ │ │ │ @ CapturePatternNode (location: (2,8)-(2,20)) + │ │ │ │ │ ├── value: + │ │ │ │ │ │ @ ConstantReadNode (location: (2,8)-(2,15)) + │ │ │ │ │ │ └── name: :Integer + │ │ │ │ │ ├── target: + │ │ │ │ │ │ @ LocalVariableTargetNode (location: (2,19)-(2,20)) + │ │ │ │ │ │ ├── name: :x + │ │ │ │ │ │ └── depth: 0 + │ │ │ │ │ └── operator_loc: (2,16)-(2,18) = "=>" + │ │ │ │ └── operator_loc: ∅ + │ │ │ ├── @ AssocNode (location: (2,22)-(2,28)) + │ │ │ │ ├── key: + │ │ │ │ │ @ SymbolNode (location: (2,22)-(2,24)) + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── value_loc: (2,22)-(2,23) = "d" + │ │ │ │ │ ├── closing_loc: (2,23)-(2,24) = ":" + │ │ │ │ │ └── unescaped: "d" + │ │ │ │ ├── value: + │ │ │ │ │ @ StringNode (location: (2,25)-(2,28)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ ├── opening_loc: (2,25)-(2,26) = "\"" + │ │ │ │ │ ├── content_loc: (2,26)-(2,27) = "e" + │ │ │ │ │ ├── closing_loc: (2,27)-(2,28) = "\"" + │ │ │ │ │ └── unescaped: "e" + │ │ │ │ └── operator_loc: ∅ + │ │ │ └── @ AssocNode (location: (2,30)-(2,32)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (2,30)-(2,32)) + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (2,30)-(2,31) = "f" + │ │ │ │ ├── closing_loc: (2,31)-(2,32) = ":" + │ │ │ │ └── unescaped: "f" + │ │ │ ├── value: ∅ + │ │ │ └── operator_loc: ∅ + │ │ ├── kwrest: ∅ + │ │ ├── opening_loc: (2,3)-(2,4) = "{" + │ │ └── closing_loc: (2,33)-(2,34) = "}" + │ ├── statements: + │ │ @ StatementsNode (location: (3,2)-(3,4)) + │ │ └── body: (length: 1) + │ │ └── @ SymbolNode (location: (3,2)-(3,4)) + │ │ ├── opening_loc: (3,2)-(3,3) = ":" + │ │ ├── value_loc: (3,3)-(3,4) = "g" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "g" + │ ├── in_loc: (2,0)-(2,2) = "in" + │ └── then_loc: (2,35)-(2,39) = "then" + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (4,0)-(4,3) = "end" diff --git a/test/prism/snapshots/seattlerb/case_in_hash_pat_paren_assign.txt b/test/prism/snapshots/seattlerb/case_in_hash_pat_paren_assign.txt new file mode 100644 index 0000000000..802c09438e --- /dev/null +++ b/test/prism/snapshots/seattlerb/case_in_hash_pat_paren_assign.txt @@ -0,0 +1,47 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CaseNode (location: (1,0)-(4,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── opening_loc: (1,5)-(1,6) = ":" + │ ├── value_loc: (1,6)-(1,7) = "a" + │ ├── closing_loc: ∅ + │ └── unescaped: "a" + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,0)-(3,4)) + │ ├── pattern: + │ │ @ HashPatternNode (location: (2,3)-(2,11)) + │ │ ├── constant: + │ │ │ @ ConstantReadNode (location: (2,3)-(2,4)) + │ │ │ └── name: :B + │ │ ├── assocs: (length: 1) + │ │ │ └── @ AssocNode (location: (2,5)-(2,10)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (2,5)-(2,7)) + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (2,5)-(2,6) = "a" + │ │ │ │ ├── closing_loc: (2,6)-(2,7) = ":" + │ │ │ │ └── unescaped: "a" + │ │ │ ├── value: + │ │ │ │ @ IntegerNode (location: (2,8)-(2,10)) + │ │ │ │ └── flags: decimal + │ │ │ └── operator_loc: ∅ + │ │ ├── kwrest: ∅ + │ │ ├── opening_loc: (2,4)-(2,5) = "(" + │ │ └── closing_loc: (2,10)-(2,11) = ")" + │ ├── statements: + │ │ @ StatementsNode (location: (3,2)-(3,4)) + │ │ └── body: (length: 1) + │ │ └── @ SymbolNode (location: (3,2)-(3,4)) + │ │ ├── opening_loc: (3,2)-(3,3) = ":" + │ │ ├── value_loc: (3,3)-(3,4) = "d" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "d" + │ ├── in_loc: (2,0)-(2,2) = "in" + │ └── then_loc: ∅ + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (4,0)-(4,3) = "end" diff --git a/test/prism/snapshots/seattlerb/case_in_hash_pat_paren_true.txt b/test/prism/snapshots/seattlerb/case_in_hash_pat_paren_true.txt new file mode 100644 index 0000000000..ca7fbcfd92 --- /dev/null +++ b/test/prism/snapshots/seattlerb/case_in_hash_pat_paren_true.txt @@ -0,0 +1,44 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CaseNode (location: (1,0)-(4,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── opening_loc: (1,5)-(1,6) = ":" + │ ├── value_loc: (1,6)-(1,7) = "a" + │ ├── closing_loc: ∅ + │ └── unescaped: "a" + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,0)-(3,4)) + │ ├── pattern: + │ │ @ HashPatternNode (location: (2,3)-(2,10)) + │ │ ├── constant: ∅ + │ │ ├── assocs: (length: 1) + │ │ │ └── @ AssocNode (location: (2,3)-(2,10)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (2,3)-(2,5)) + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (2,3)-(2,4) = "b" + │ │ │ │ ├── closing_loc: (2,4)-(2,5) = ":" + │ │ │ │ └── unescaped: "b" + │ │ │ ├── value: + │ │ │ │ @ TrueNode (location: (2,6)-(2,10)) + │ │ │ └── operator_loc: ∅ + │ │ ├── kwrest: ∅ + │ │ ├── opening_loc: ∅ + │ │ └── closing_loc: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (3,2)-(3,4)) + │ │ └── body: (length: 1) + │ │ └── @ SymbolNode (location: (3,2)-(3,4)) + │ │ ├── opening_loc: (3,2)-(3,3) = ":" + │ │ ├── value_loc: (3,3)-(3,4) = "c" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "c" + │ ├── in_loc: (2,0)-(2,2) = "in" + │ └── then_loc: (2,11)-(2,15) = "then" + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (4,0)-(4,3) = "end" diff --git a/test/prism/snapshots/seattlerb/case_in_hash_pat_rest.txt b/test/prism/snapshots/seattlerb/case_in_hash_pat_rest.txt new file mode 100644 index 0000000000..bbd4963008 --- /dev/null +++ b/test/prism/snapshots/seattlerb/case_in_hash_pat_rest.txt @@ -0,0 +1,52 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [:c, :rest] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ CaseNode (location: (1,0)-(3,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── opening_loc: (1,5)-(1,6) = ":" + │ ├── value_loc: (1,6)-(1,7) = "a" + │ ├── closing_loc: ∅ + │ └── unescaped: "a" + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,0)-(2,23)) + │ ├── pattern: + │ │ @ HashPatternNode (location: (2,3)-(2,15)) + │ │ ├── constant: ∅ + │ │ ├── assocs: (length: 2) + │ │ │ ├── @ AssocNode (location: (2,3)-(2,7)) + │ │ │ │ ├── key: + │ │ │ │ │ @ SymbolNode (location: (2,3)-(2,5)) + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── value_loc: (2,3)-(2,4) = "b" + │ │ │ │ │ ├── closing_loc: (2,4)-(2,5) = ":" + │ │ │ │ │ └── unescaped: "b" + │ │ │ │ ├── value: + │ │ │ │ │ @ LocalVariableTargetNode (location: (2,6)-(2,7)) + │ │ │ │ │ ├── name: :c + │ │ │ │ │ └── depth: 0 + │ │ │ │ └── operator_loc: ∅ + │ │ │ └── @ AssocSplatNode (location: (2,9)-(2,15)) + │ │ │ ├── value: + │ │ │ │ @ LocalVariableTargetNode (location: (2,11)-(2,15)) + │ │ │ │ ├── name: :rest + │ │ │ │ └── depth: 0 + │ │ │ └── operator_loc: (2,9)-(2,11) = "**" + │ │ ├── kwrest: ∅ + │ │ ├── opening_loc: ∅ + │ │ └── closing_loc: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (2,21)-(2,23)) + │ │ └── body: (length: 1) + │ │ └── @ SymbolNode (location: (2,21)-(2,23)) + │ │ ├── opening_loc: (2,21)-(2,22) = ":" + │ │ ├── value_loc: (2,22)-(2,23) = "d" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "d" + │ ├── in_loc: (2,0)-(2,2) = "in" + │ └── then_loc: (2,16)-(2,20) = "then" + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (3,0)-(3,3) = "end" diff --git a/test/prism/snapshots/seattlerb/case_in_hash_pat_rest_solo.txt b/test/prism/snapshots/seattlerb/case_in_hash_pat_rest_solo.txt new file mode 100644 index 0000000000..4a189bb590 --- /dev/null +++ b/test/prism/snapshots/seattlerb/case_in_hash_pat_rest_solo.txt @@ -0,0 +1,40 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [:rest] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ CaseNode (location: (1,0)-(3,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── opening_loc: (1,5)-(1,6) = ":" + │ ├── value_loc: (1,6)-(1,7) = "a" + │ ├── closing_loc: ∅ + │ └── unescaped: "a" + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,0)-(2,17)) + │ ├── pattern: + │ │ @ HashPatternNode (location: (2,3)-(2,9)) + │ │ ├── constant: ∅ + │ │ ├── assocs: (length: 1) + │ │ │ └── @ AssocSplatNode (location: (2,3)-(2,9)) + │ │ │ ├── value: + │ │ │ │ @ LocalVariableTargetNode (location: (2,5)-(2,9)) + │ │ │ │ ├── name: :rest + │ │ │ │ └── depth: 0 + │ │ │ └── operator_loc: (2,3)-(2,5) = "**" + │ │ ├── kwrest: ∅ + │ │ ├── opening_loc: ∅ + │ │ └── closing_loc: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (2,15)-(2,17)) + │ │ └── body: (length: 1) + │ │ └── @ SymbolNode (location: (2,15)-(2,17)) + │ │ ├── opening_loc: (2,15)-(2,16) = ":" + │ │ ├── value_loc: (2,16)-(2,17) = "d" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "d" + │ ├── in_loc: (2,0)-(2,2) = "in" + │ └── then_loc: (2,10)-(2,14) = "then" + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (3,0)-(3,3) = "end" diff --git a/test/prism/snapshots/seattlerb/case_in_if_unless_post_mod.txt b/test/prism/snapshots/seattlerb/case_in_if_unless_post_mod.txt new file mode 100644 index 0000000000..b058ee0285 --- /dev/null +++ b/test/prism/snapshots/seattlerb/case_in_if_unless_post_mod.txt @@ -0,0 +1,62 @@ +@ ProgramNode (location: (1,0)-(6,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(6,3)) + └── body: (length: 1) + └── @ CaseNode (location: (1,0)-(6,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── opening_loc: (1,5)-(1,6) = ":" + │ ├── value_loc: (1,6)-(1,7) = "a" + │ ├── closing_loc: ∅ + │ └── unescaped: "a" + ├── conditions: (length: 2) + │ ├── @ InNode (location: (2,0)-(3,4)) + │ │ ├── pattern: + │ │ │ @ IfNode (location: (2,3)-(2,12)) + │ │ │ ├── if_keyword_loc: (2,5)-(2,7) = "if" + │ │ │ ├── predicate: + │ │ │ │ @ TrueNode (location: (2,8)-(2,12)) + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (2,3)-(2,4)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ ConstantReadNode (location: (2,3)-(2,4)) + │ │ │ │ └── name: :A + │ │ │ ├── consequent: ∅ + │ │ │ └── end_keyword_loc: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (3,2)-(3,4)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ SymbolNode (location: (3,2)-(3,4)) + │ │ │ ├── opening_loc: (3,2)-(3,3) = ":" + │ │ │ ├── value_loc: (3,3)-(3,4) = "C" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "C" + │ │ ├── in_loc: (2,0)-(2,2) = "in" + │ │ └── then_loc: ∅ + │ └── @ InNode (location: (4,0)-(5,4)) + │ ├── pattern: + │ │ @ UnlessNode (location: (4,3)-(4,17)) + │ │ ├── keyword_loc: (4,5)-(4,11) = "unless" + │ │ ├── predicate: + │ │ │ @ FalseNode (location: (4,12)-(4,17)) + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (4,3)-(4,4)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ ConstantReadNode (location: (4,3)-(4,4)) + │ │ │ └── name: :D + │ │ ├── consequent: ∅ + │ │ └── end_keyword_loc: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (5,2)-(5,4)) + │ │ └── body: (length: 1) + │ │ └── @ SymbolNode (location: (5,2)-(5,4)) + │ │ ├── opening_loc: (5,2)-(5,3) = ":" + │ │ ├── value_loc: (5,3)-(5,4) = "E" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "E" + │ ├── in_loc: (4,0)-(4,2) = "in" + │ └── then_loc: ∅ + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (6,0)-(6,3) = "end" diff --git a/test/prism/snapshots/seattlerb/case_in_multiple.txt b/test/prism/snapshots/seattlerb/case_in_multiple.txt new file mode 100644 index 0000000000..046cb61838 --- /dev/null +++ b/test/prism/snapshots/seattlerb/case_in_multiple.txt @@ -0,0 +1,56 @@ +@ ProgramNode (location: (1,0)-(6,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(6,3)) + └── body: (length: 1) + └── @ CaseNode (location: (1,0)-(6,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── opening_loc: (1,5)-(1,6) = ":" + │ ├── value_loc: (1,6)-(1,7) = "a" + │ ├── closing_loc: ∅ + │ └── unescaped: "a" + ├── conditions: (length: 2) + │ ├── @ InNode (location: (2,0)-(3,4)) + │ │ ├── pattern: + │ │ │ @ ConstantPathNode (location: (2,3)-(2,7)) + │ │ │ ├── parent: + │ │ │ │ @ ConstantReadNode (location: (2,3)-(2,4)) + │ │ │ │ └── name: :A + │ │ │ ├── child: + │ │ │ │ @ ConstantReadNode (location: (2,6)-(2,7)) + │ │ │ │ └── name: :B + │ │ │ └── delimiter_loc: (2,4)-(2,6) = "::" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (3,2)-(3,4)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ SymbolNode (location: (3,2)-(3,4)) + │ │ │ ├── opening_loc: (3,2)-(3,3) = ":" + │ │ │ ├── value_loc: (3,3)-(3,4) = "C" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "C" + │ │ ├── in_loc: (2,0)-(2,2) = "in" + │ │ └── then_loc: ∅ + │ └── @ InNode (location: (4,0)-(5,4)) + │ ├── pattern: + │ │ @ ConstantPathNode (location: (4,3)-(4,7)) + │ │ ├── parent: + │ │ │ @ ConstantReadNode (location: (4,3)-(4,4)) + │ │ │ └── name: :D + │ │ ├── child: + │ │ │ @ ConstantReadNode (location: (4,6)-(4,7)) + │ │ │ └── name: :E + │ │ └── delimiter_loc: (4,4)-(4,6) = "::" + │ ├── statements: + │ │ @ StatementsNode (location: (5,2)-(5,4)) + │ │ └── body: (length: 1) + │ │ └── @ SymbolNode (location: (5,2)-(5,4)) + │ │ ├── opening_loc: (5,2)-(5,3) = ":" + │ │ ├── value_loc: (5,3)-(5,4) = "F" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "F" + │ ├── in_loc: (4,0)-(4,2) = "in" + │ └── then_loc: ∅ + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (6,0)-(6,3) = "end" diff --git a/test/prism/snapshots/seattlerb/case_in_or.txt b/test/prism/snapshots/seattlerb/case_in_or.txt new file mode 100644 index 0000000000..059ddcd32c --- /dev/null +++ b/test/prism/snapshots/seattlerb/case_in_or.txt @@ -0,0 +1,36 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CaseNode (location: (1,0)-(4,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── opening_loc: (1,5)-(1,6) = ":" + │ ├── value_loc: (1,6)-(1,7) = "a" + │ ├── closing_loc: ∅ + │ └── unescaped: "a" + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,0)-(3,4)) + │ ├── pattern: + │ │ @ AlternationPatternNode (location: (2,3)-(2,8)) + │ │ ├── left: + │ │ │ @ ConstantReadNode (location: (2,3)-(2,4)) + │ │ │ └── name: :B + │ │ ├── right: + │ │ │ @ ConstantReadNode (location: (2,7)-(2,8)) + │ │ │ └── name: :C + │ │ └── operator_loc: (2,5)-(2,6) = "|" + │ ├── statements: + │ │ @ StatementsNode (location: (3,2)-(3,4)) + │ │ └── body: (length: 1) + │ │ └── @ SymbolNode (location: (3,2)-(3,4)) + │ │ ├── opening_loc: (3,2)-(3,3) = ":" + │ │ ├── value_loc: (3,3)-(3,4) = "d" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "d" + │ ├── in_loc: (2,0)-(2,2) = "in" + │ └── then_loc: ∅ + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (4,0)-(4,3) = "end" diff --git a/test/prism/snapshots/seattlerb/class_comments.txt b/test/prism/snapshots/seattlerb/class_comments.txt new file mode 100644 index 0000000000..5ac05b6be6 --- /dev/null +++ b/test/prism/snapshots/seattlerb/class_comments.txt @@ -0,0 +1,31 @@ +@ ProgramNode (location: (4,0)-(9,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (4,0)-(9,3)) + └── body: (length: 1) + └── @ ClassNode (location: (4,0)-(9,3)) + ├── locals: [] + ├── class_keyword_loc: (4,0)-(4,5) = "class" + ├── constant_path: + │ @ ConstantReadNode (location: (4,6)-(4,7)) + │ └── name: :X + ├── inheritance_operator_loc: ∅ + ├── superclass: ∅ + ├── body: + │ @ StatementsNode (location: (6,2)-(8,5)) + │ └── body: (length: 1) + │ └── @ DefNode (location: (6,2)-(8,5)) + │ ├── name: :blah + │ ├── name_loc: (6,6)-(6,10) = "blah" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (6,2)-(6,5) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (8,2)-(8,5) = "end" + ├── end_keyword_loc: (9,0)-(9,3) = "end" + └── name: :X diff --git a/test/prism/snapshots/seattlerb/cond_unary_minus.txt b/test/prism/snapshots/seattlerb/cond_unary_minus.txt new file mode 100644 index 0000000000..28c354b85d --- /dev/null +++ b/test/prism/snapshots/seattlerb/cond_unary_minus.txt @@ -0,0 +1,13 @@ +@ ProgramNode (location: (1,0)-(1,10)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,10)) + └── body: (length: 1) + └── @ IfNode (location: (1,0)-(1,10)) + ├── if_keyword_loc: (1,0)-(1,2) = "if" + ├── predicate: + │ @ IntegerNode (location: (1,3)-(1,5)) + │ └── flags: decimal + ├── statements: ∅ + ├── consequent: ∅ + └── end_keyword_loc: (1,7)-(1,10) = "end" diff --git a/test/prism/snapshots/seattlerb/const_2_op_asgn_or2.txt b/test/prism/snapshots/seattlerb/const_2_op_asgn_or2.txt new file mode 100644 index 0000000000..332c7ff302 --- /dev/null +++ b/test/prism/snapshots/seattlerb/const_2_op_asgn_or2.txt @@ -0,0 +1,23 @@ +@ ProgramNode (location: (1,0)-(1,12)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,12)) + └── body: (length: 1) + └── @ ConstantPathOrWriteNode (location: (1,0)-(1,12)) + ├── target: + │ @ ConstantPathNode (location: (1,0)-(1,6)) + │ ├── parent: + │ │ @ ConstantPathNode (location: (1,0)-(1,3)) + │ │ ├── parent: ∅ + │ │ ├── child: + │ │ │ @ ConstantReadNode (location: (1,2)-(1,3)) + │ │ │ └── name: :X + │ │ └── delimiter_loc: (1,0)-(1,2) = "::" + │ ├── child: + │ │ @ ConstantReadNode (location: (1,5)-(1,6)) + │ │ └── name: :Y + │ └── delimiter_loc: (1,3)-(1,5) = "::" + ├── operator_loc: (1,7)-(1,10) = "||=" + └── value: + @ IntegerNode (location: (1,11)-(1,12)) + └── flags: decimal diff --git a/test/prism/snapshots/seattlerb/const_3_op_asgn_or.txt b/test/prism/snapshots/seattlerb/const_3_op_asgn_or.txt new file mode 100644 index 0000000000..e7130cc1b3 --- /dev/null +++ b/test/prism/snapshots/seattlerb/const_3_op_asgn_or.txt @@ -0,0 +1,17 @@ +@ ProgramNode (location: (1,0)-(1,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,9)) + └── body: (length: 1) + └── @ ConstantPathOrWriteNode (location: (1,0)-(1,9)) + ├── target: + │ @ ConstantPathNode (location: (1,0)-(1,3)) + │ ├── parent: ∅ + │ ├── child: + │ │ @ ConstantReadNode (location: (1,2)-(1,3)) + │ │ └── name: :X + │ └── delimiter_loc: (1,0)-(1,2) = "::" + ├── operator_loc: (1,4)-(1,7) = "||=" + └── value: + @ IntegerNode (location: (1,8)-(1,9)) + └── flags: decimal diff --git a/test/prism/snapshots/seattlerb/const_op_asgn_and1.txt b/test/prism/snapshots/seattlerb/const_op_asgn_and1.txt new file mode 100644 index 0000000000..c4c5534f92 --- /dev/null +++ b/test/prism/snapshots/seattlerb/const_op_asgn_and1.txt @@ -0,0 +1,18 @@ +@ ProgramNode (location: (1,0)-(1,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,8)) + └── body: (length: 1) + └── @ ConstantPathOperatorWriteNode (location: (1,0)-(1,8)) + ├── target: + │ @ ConstantPathNode (location: (1,0)-(1,3)) + │ ├── parent: ∅ + │ ├── child: + │ │ @ ConstantReadNode (location: (1,2)-(1,3)) + │ │ └── name: :X + │ └── delimiter_loc: (1,0)-(1,2) = "::" + ├── operator_loc: (1,4)-(1,6) = "&=" + ├── value: + │ @ IntegerNode (location: (1,7)-(1,8)) + │ └── flags: decimal + └── operator: :& diff --git a/test/prism/snapshots/seattlerb/const_op_asgn_and2.txt b/test/prism/snapshots/seattlerb/const_op_asgn_and2.txt new file mode 100644 index 0000000000..ef9ee358b9 --- /dev/null +++ b/test/prism/snapshots/seattlerb/const_op_asgn_and2.txt @@ -0,0 +1,17 @@ +@ ProgramNode (location: (1,0)-(1,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,9)) + └── body: (length: 1) + └── @ ConstantPathAndWriteNode (location: (1,0)-(1,9)) + ├── target: + │ @ ConstantPathNode (location: (1,0)-(1,3)) + │ ├── parent: ∅ + │ ├── child: + │ │ @ ConstantReadNode (location: (1,2)-(1,3)) + │ │ └── name: :X + │ └── delimiter_loc: (1,0)-(1,2) = "::" + ├── operator_loc: (1,4)-(1,7) = "&&=" + └── value: + @ IntegerNode (location: (1,8)-(1,9)) + └── flags: decimal diff --git a/test/prism/snapshots/seattlerb/const_op_asgn_or.txt b/test/prism/snapshots/seattlerb/const_op_asgn_or.txt new file mode 100644 index 0000000000..7afc8882e9 --- /dev/null +++ b/test/prism/snapshots/seattlerb/const_op_asgn_or.txt @@ -0,0 +1,19 @@ +@ ProgramNode (location: (1,0)-(1,10)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,10)) + └── body: (length: 1) + └── @ ConstantPathOrWriteNode (location: (1,0)-(1,10)) + ├── target: + │ @ ConstantPathNode (location: (1,0)-(1,4)) + │ ├── parent: + │ │ @ ConstantReadNode (location: (1,0)-(1,1)) + │ │ └── name: :X + │ ├── child: + │ │ @ ConstantReadNode (location: (1,3)-(1,4)) + │ │ └── name: :Y + │ └── delimiter_loc: (1,1)-(1,3) = "::" + ├── operator_loc: (1,5)-(1,8) = "||=" + └── value: + @ IntegerNode (location: (1,9)-(1,10)) + └── flags: decimal diff --git a/test/prism/snapshots/seattlerb/dasgn_icky2.txt b/test/prism/snapshots/seattlerb/dasgn_icky2.txt new file mode 100644 index 0000000000..16864d1e33 --- /dev/null +++ b/test/prism/snapshots/seattlerb/dasgn_icky2.txt @@ -0,0 +1,61 @@ +@ ProgramNode (location: (1,0)-(8,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(8,3)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(8,3)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(8,3)) + │ ├── locals: [:v] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (2,2)-(7,5)) + │ │ └── body: (length: 2) + │ │ ├── @ LocalVariableWriteNode (location: (2,2)-(2,9)) + │ │ │ ├── name: :v + │ │ │ ├── depth: 0 + │ │ │ ├── name_loc: (2,2)-(2,3) = "v" + │ │ │ ├── value: + │ │ │ │ @ NilNode (location: (2,6)-(2,9)) + │ │ │ └── operator_loc: (2,4)-(2,5) = "=" + │ │ └── @ BeginNode (location: (3,2)-(7,5)) + │ │ ├── begin_keyword_loc: (3,2)-(3,7) = "begin" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (4,4)-(4,9)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ YieldNode (location: (4,4)-(4,9)) + │ │ │ ├── keyword_loc: (4,4)-(4,9) = "yield" + │ │ │ ├── lparen_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ └── rparen_loc: ∅ + │ │ ├── rescue_clause: + │ │ │ @ RescueNode (location: (5,2)-(6,9)) + │ │ │ ├── keyword_loc: (5,2)-(5,8) = "rescue" + │ │ │ ├── exceptions: (length: 1) + │ │ │ │ └── @ ConstantReadNode (location: (5,9)-(5,18)) + │ │ │ │ └── name: :Exception + │ │ │ ├── operator_loc: (5,19)-(5,21) = "=>" + │ │ │ ├── reference: + │ │ │ │ @ LocalVariableTargetNode (location: (5,22)-(5,23)) + │ │ │ │ ├── name: :v + │ │ │ │ └── depth: 0 + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (6,4)-(6,9)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ BreakNode (location: (6,4)-(6,9)) + │ │ │ │ ├── arguments: ∅ + │ │ │ │ └── keyword_loc: (6,4)-(6,9) = "break" + │ │ │ └── consequent: ∅ + │ │ ├── else_clause: ∅ + │ │ ├── ensure_clause: ∅ + │ │ └── end_keyword_loc: (7,2)-(7,5) = "end" + │ ├── opening_loc: (1,2)-(1,4) = "do" + │ └── closing_loc: (8,0)-(8,3) = "end" + ├── flags: ∅ + └── name: "a" diff --git a/test/prism/snapshots/seattlerb/defined_eh_parens.txt b/test/prism/snapshots/seattlerb/defined_eh_parens.txt new file mode 100644 index 0000000000..b03666c7e4 --- /dev/null +++ b/test/prism/snapshots/seattlerb/defined_eh_parens.txt @@ -0,0 +1,12 @@ +@ ProgramNode (location: (1,0)-(1,12)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,12)) + └── body: (length: 1) + └── @ DefinedNode (location: (1,0)-(1,12)) + ├── lparen_loc: (1,8)-(1,9) = "(" + ├── value: + │ @ IntegerNode (location: (1,9)-(1,11)) + │ └── flags: decimal + ├── rparen_loc: (1,11)-(1,12) = ")" + └── keyword_loc: (1,0)-(1,8) = "defined?" diff --git a/test/prism/snapshots/seattlerb/defn_arg_asplat_arg.txt b/test/prism/snapshots/seattlerb/defn_arg_asplat_arg.txt new file mode 100644 index 0000000000..c5c169fc0e --- /dev/null +++ b/test/prism/snapshots/seattlerb/defn_arg_asplat_arg.txt @@ -0,0 +1,34 @@ +@ ProgramNode (location: (1,0)-(1,29)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,29)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,29)) + ├── name: :call + ├── name_loc: (1,4)-(1,8) = "call" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,9)-(1,24)) + │ ├── requireds: (length: 1) + │ │ └── @ RequiredParameterNode (location: (1,9)-(1,15)) + │ │ └── name: :interp + │ ├── optionals: (length: 0) + │ ├── rest: + │ │ @ RestParameterNode (location: (1,17)-(1,18)) + │ │ ├── name: nil + │ │ ├── name_loc: ∅ + │ │ └── operator_loc: (1,17)-(1,18) = "*" + │ ├── posts: (length: 1) + │ │ └── @ RequiredParameterNode (location: (1,20)-(1,24)) + │ │ └── name: :args + │ ├── keywords: (length: 0) + │ ├── keyword_rest: ∅ + │ └── block: ∅ + ├── body: ∅ + ├── locals: [:interp, :*, :args] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (1,8)-(1,9) = "(" + ├── rparen_loc: (1,24)-(1,25) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (1,26)-(1,29) = "end" diff --git a/test/prism/snapshots/seattlerb/defn_arg_forward_args.txt b/test/prism/snapshots/seattlerb/defn_arg_forward_args.txt new file mode 100644 index 0000000000..8b85009de0 --- /dev/null +++ b/test/prism/snapshots/seattlerb/defn_arg_forward_args.txt @@ -0,0 +1,47 @@ +@ ProgramNode (location: (1,0)-(1,29)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,29)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,29)) + ├── name: :a + ├── name_loc: (1,4)-(1,5) = "a" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,6)-(1,12)) + │ ├── requireds: (length: 1) + │ │ └── @ RequiredParameterNode (location: (1,6)-(1,7)) + │ │ └── name: :x + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 0) + │ ├── keyword_rest: + │ │ @ ForwardingParameterNode (location: (1,9)-(1,12)) + │ └── block: ∅ + ├── body: + │ @ StatementsNode (location: (1,15)-(1,24)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,15)-(1,24)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,15)-(1,16) = "b" + │ ├── opening_loc: (1,16)-(1,17) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,17)-(1,23)) + │ │ └── arguments: (length: 2) + │ │ ├── @ LocalVariableReadNode (location: (1,17)-(1,18)) + │ │ │ ├── name: :x + │ │ │ └── depth: 0 + │ │ └── @ ForwardingArgumentsNode (location: (1,20)-(1,23)) + │ ├── closing_loc: (1,23)-(1,24) = ")" + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "b" + ├── locals: [:x, :"..."] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (1,5)-(1,6) = "(" + ├── rparen_loc: (1,12)-(1,13) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (1,26)-(1,29) = "end" diff --git a/test/prism/snapshots/seattlerb/defn_args_forward_args.txt b/test/prism/snapshots/seattlerb/defn_args_forward_args.txt new file mode 100644 index 0000000000..2d033dd1f2 --- /dev/null +++ b/test/prism/snapshots/seattlerb/defn_args_forward_args.txt @@ -0,0 +1,56 @@ +@ ProgramNode (location: (1,0)-(1,41)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,41)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,41)) + ├── name: :a + ├── name_loc: (1,4)-(1,5) = "a" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,6)-(1,18)) + │ ├── requireds: (length: 3) + │ │ ├── @ RequiredParameterNode (location: (1,6)-(1,7)) + │ │ │ └── name: :x + │ │ ├── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ └── name: :y + │ │ └── @ RequiredParameterNode (location: (1,12)-(1,13)) + │ │ └── name: :z + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 0) + │ ├── keyword_rest: + │ │ @ ForwardingParameterNode (location: (1,15)-(1,18)) + │ └── block: ∅ + ├── body: + │ @ StatementsNode (location: (1,21)-(1,36)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,21)-(1,36)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,21)-(1,22) = "b" + │ ├── opening_loc: (1,22)-(1,23) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,23)-(1,35)) + │ │ └── arguments: (length: 3) + │ │ ├── @ SymbolNode (location: (1,23)-(1,27)) + │ │ │ ├── opening_loc: (1,23)-(1,24) = ":" + │ │ │ ├── value_loc: (1,24)-(1,27) = "get" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "get" + │ │ ├── @ LocalVariableReadNode (location: (1,29)-(1,30)) + │ │ │ ├── name: :z + │ │ │ └── depth: 0 + │ │ └── @ ForwardingArgumentsNode (location: (1,32)-(1,35)) + │ ├── closing_loc: (1,35)-(1,36) = ")" + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "b" + ├── locals: [:x, :y, :z, :"..."] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (1,5)-(1,6) = "(" + ├── rparen_loc: (1,18)-(1,19) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (1,38)-(1,41) = "end" diff --git a/test/prism/snapshots/seattlerb/defn_comments.txt b/test/prism/snapshots/seattlerb/defn_comments.txt new file mode 100644 index 0000000000..585aa65c9a --- /dev/null +++ b/test/prism/snapshots/seattlerb/defn_comments.txt @@ -0,0 +1,18 @@ +@ ProgramNode (location: (4,0)-(5,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (4,0)-(5,3)) + └── body: (length: 1) + └── @ DefNode (location: (4,0)-(5,3)) + ├── name: :blah + ├── name_loc: (4,4)-(4,8) = "blah" + ├── receiver: ∅ + ├── parameters: ∅ + ├── body: ∅ + ├── locals: [] + ├── def_keyword_loc: (4,0)-(4,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── equal_loc: ∅ + └── end_keyword_loc: (5,0)-(5,3) = "end" diff --git a/test/prism/snapshots/seattlerb/defn_endless_command.txt b/test/prism/snapshots/seattlerb/defn_endless_command.txt new file mode 100644 index 0000000000..90cfd1c888 --- /dev/null +++ b/test/prism/snapshots/seattlerb/defn_endless_command.txt @@ -0,0 +1,34 @@ +@ ProgramNode (location: (1,0)-(1,33)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,33)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,33)) + ├── name: :some_method + ├── name_loc: (1,4)-(1,15) = "some_method" + ├── receiver: ∅ + ├── parameters: ∅ + ├── body: + │ @ StatementsNode (location: (1,18)-(1,33)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,18)-(1,33)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,18)-(1,30) = "other_method" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,31)-(1,33)) + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (1,31)-(1,33)) + │ │ └── flags: decimal + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "other_method" + ├── locals: [] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── equal_loc: (1,16)-(1,17) = "=" + └── end_keyword_loc: ∅ diff --git a/test/prism/snapshots/seattlerb/defn_endless_command_rescue.txt b/test/prism/snapshots/seattlerb/defn_endless_command_rescue.txt new file mode 100644 index 0000000000..18e019d4f4 --- /dev/null +++ b/test/prism/snapshots/seattlerb/defn_endless_command_rescue.txt @@ -0,0 +1,40 @@ +@ ProgramNode (location: (1,0)-(1,43)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,43)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,43)) + ├── name: :some_method + ├── name_loc: (1,4)-(1,15) = "some_method" + ├── receiver: ∅ + ├── parameters: ∅ + ├── body: + │ @ StatementsNode (location: (1,18)-(1,43)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,18)-(1,43)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,18)-(1,30) = "other_method" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,31)-(1,43)) + │ │ └── arguments: (length: 1) + │ │ └── @ RescueModifierNode (location: (1,31)-(1,43)) + │ │ ├── expression: + │ │ │ @ IntegerNode (location: (1,31)-(1,33)) + │ │ │ └── flags: decimal + │ │ ├── keyword_loc: (1,34)-(1,40) = "rescue" + │ │ └── rescue_expression: + │ │ @ IntegerNode (location: (1,41)-(1,43)) + │ │ └── flags: decimal + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "other_method" + ├── locals: [] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── equal_loc: (1,16)-(1,17) = "=" + └── end_keyword_loc: ∅ diff --git a/test/prism/snapshots/seattlerb/defn_forward_args.txt b/test/prism/snapshots/seattlerb/defn_forward_args.txt new file mode 100644 index 0000000000..5eb2cf1d18 --- /dev/null +++ b/test/prism/snapshots/seattlerb/defn_forward_args.txt @@ -0,0 +1,42 @@ +@ ProgramNode (location: (1,0)-(1,23)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,23)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,23)) + ├── name: :a + ├── name_loc: (1,4)-(1,5) = "a" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,6)-(1,9)) + │ ├── requireds: (length: 0) + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 0) + │ ├── keyword_rest: + │ │ @ ForwardingParameterNode (location: (1,6)-(1,9)) + │ └── block: ∅ + ├── body: + │ @ StatementsNode (location: (1,12)-(1,18)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,12)-(1,18)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,12)-(1,13) = "b" + │ ├── opening_loc: (1,13)-(1,14) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,14)-(1,17)) + │ │ └── arguments: (length: 1) + │ │ └── @ ForwardingArgumentsNode (location: (1,14)-(1,17)) + │ ├── closing_loc: (1,17)-(1,18) = ")" + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "b" + ├── locals: [:"..."] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (1,5)-(1,6) = "(" + ├── rparen_loc: (1,9)-(1,10) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (1,20)-(1,23) = "end" diff --git a/test/prism/snapshots/seattlerb/defn_forward_args__no_parens.txt b/test/prism/snapshots/seattlerb/defn_forward_args__no_parens.txt new file mode 100644 index 0000000000..168fdbbb42 --- /dev/null +++ b/test/prism/snapshots/seattlerb/defn_forward_args__no_parens.txt @@ -0,0 +1,42 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(3,3)) + ├── name: :f + ├── name_loc: (1,4)-(1,5) = "f" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,6)-(1,9)) + │ ├── requireds: (length: 0) + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 0) + │ ├── keyword_rest: + │ │ @ ForwardingParameterNode (location: (1,6)-(1,9)) + │ └── block: ∅ + ├── body: + │ @ StatementsNode (location: (2,2)-(2,8)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (2,2)-(2,8)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (2,2)-(2,3) = "m" + │ ├── opening_loc: (2,3)-(2,4) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (2,4)-(2,7)) + │ │ └── arguments: (length: 1) + │ │ └── @ ForwardingArgumentsNode (location: (2,4)-(2,7)) + │ ├── closing_loc: (2,7)-(2,8) = ")" + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "m" + ├── locals: [:"..."] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── equal_loc: ∅ + └── end_keyword_loc: (3,0)-(3,3) = "end" diff --git a/test/prism/snapshots/seattlerb/defn_kwarg_env.txt b/test/prism/snapshots/seattlerb/defn_kwarg_env.txt new file mode 100644 index 0000000000..57b835d9d4 --- /dev/null +++ b/test/prism/snapshots/seattlerb/defn_kwarg_env.txt @@ -0,0 +1,52 @@ +@ ProgramNode (location: (1,0)-(1,45)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,45)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,45)) + ├── name: :test + ├── name_loc: (1,4)-(1,8) = "test" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,9)-(1,18)) + │ ├── requireds: (length: 0) + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 0) + │ ├── keyword_rest: + │ │ @ KeywordRestParameterNode (location: (1,9)-(1,18)) + │ │ ├── name: :testing + │ │ ├── name_loc: (1,11)-(1,18) = "testing" + │ │ └── operator_loc: (1,9)-(1,11) = "**" + │ └── block: ∅ + ├── body: + │ @ StatementsNode (location: (1,20)-(1,41)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,20)-(1,41)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,20)-(1,30) = "test_splat" + │ ├── opening_loc: (1,30)-(1,31) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,31)-(1,40)) + │ │ └── arguments: (length: 1) + │ │ └── @ KeywordHashNode (location: (1,31)-(1,40)) + │ │ └── elements: (length: 1) + │ │ └── @ AssocSplatNode (location: (1,31)-(1,40)) + │ │ ├── value: + │ │ │ @ LocalVariableReadNode (location: (1,33)-(1,40)) + │ │ │ ├── name: :testing + │ │ │ └── depth: 0 + │ │ └── operator_loc: (1,31)-(1,33) = "**" + │ ├── closing_loc: (1,40)-(1,41) = ")" + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "test_splat" + ├── locals: [:testing] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (1,8)-(1,9) = "(" + ├── rparen_loc: (1,18)-(1,19) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (1,42)-(1,45) = "end" diff --git a/test/prism/snapshots/seattlerb/defn_kwarg_kwarg.txt b/test/prism/snapshots/seattlerb/defn_kwarg_kwarg.txt new file mode 100644 index 0000000000..2d57ad3189 --- /dev/null +++ b/test/prism/snapshots/seattlerb/defn_kwarg_kwarg.txt @@ -0,0 +1,40 @@ +@ ProgramNode (location: (1,0)-(1,24)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,24)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,24)) + ├── name: :f + ├── name_loc: (1,4)-(1,5) = "f" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,6)-(1,19)) + │ ├── requireds: (length: 1) + │ │ └── @ RequiredParameterNode (location: (1,6)-(1,7)) + │ │ └── name: :a + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 2) + │ │ ├── @ KeywordParameterNode (location: (1,9)-(1,13)) + │ │ │ ├── name: :b + │ │ │ ├── name_loc: (1,9)-(1,11) = "b:" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (1,12)-(1,13)) + │ │ │ └── flags: decimal + │ │ └── @ KeywordParameterNode (location: (1,15)-(1,19)) + │ │ ├── name: :c + │ │ ├── name_loc: (1,15)-(1,17) = "c:" + │ │ └── value: + │ │ @ IntegerNode (location: (1,18)-(1,19)) + │ │ └── flags: decimal + │ ├── keyword_rest: ∅ + │ └── block: ∅ + ├── body: ∅ + ├── locals: [:a, :b, :c] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (1,5)-(1,6) = "(" + ├── rparen_loc: (1,19)-(1,20) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (1,21)-(1,24) = "end" diff --git a/test/prism/snapshots/seattlerb/defn_kwarg_kwsplat.txt b/test/prism/snapshots/seattlerb/defn_kwarg_kwsplat.txt new file mode 100644 index 0000000000..0d005c2057 --- /dev/null +++ b/test/prism/snapshots/seattlerb/defn_kwarg_kwsplat.txt @@ -0,0 +1,36 @@ +@ ProgramNode (location: (1,0)-(1,20)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,20)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,20)) + ├── name: :a + ├── name_loc: (1,4)-(1,5) = "a" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,6)-(1,15)) + │ ├── requireds: (length: 0) + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 1) + │ │ └── @ KeywordParameterNode (location: (1,6)-(1,10)) + │ │ ├── name: :b + │ │ ├── name_loc: (1,6)-(1,8) = "b:" + │ │ └── value: + │ │ @ IntegerNode (location: (1,9)-(1,10)) + │ │ └── flags: decimal + │ ├── keyword_rest: + │ │ @ KeywordRestParameterNode (location: (1,12)-(1,15)) + │ │ ├── name: :c + │ │ ├── name_loc: (1,14)-(1,15) = "c" + │ │ └── operator_loc: (1,12)-(1,14) = "**" + │ └── block: ∅ + ├── body: ∅ + ├── locals: [:b, :c] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (1,5)-(1,6) = "(" + ├── rparen_loc: (1,15)-(1,16) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (1,17)-(1,20) = "end" diff --git a/test/prism/snapshots/seattlerb/defn_kwarg_kwsplat_anon.txt b/test/prism/snapshots/seattlerb/defn_kwarg_kwsplat_anon.txt new file mode 100644 index 0000000000..60c8e7bcb8 --- /dev/null +++ b/test/prism/snapshots/seattlerb/defn_kwarg_kwsplat_anon.txt @@ -0,0 +1,36 @@ +@ ProgramNode (location: (1,0)-(1,19)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,19)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,19)) + ├── name: :a + ├── name_loc: (1,4)-(1,5) = "a" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,6)-(1,14)) + │ ├── requireds: (length: 0) + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 1) + │ │ └── @ KeywordParameterNode (location: (1,6)-(1,10)) + │ │ ├── name: :b + │ │ ├── name_loc: (1,6)-(1,8) = "b:" + │ │ └── value: + │ │ @ IntegerNode (location: (1,9)-(1,10)) + │ │ └── flags: decimal + │ ├── keyword_rest: + │ │ @ KeywordRestParameterNode (location: (1,12)-(1,14)) + │ │ ├── name: nil + │ │ ├── name_loc: ∅ + │ │ └── operator_loc: (1,12)-(1,14) = "**" + │ └── block: ∅ + ├── body: ∅ + ├── locals: [:b, :**] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (1,5)-(1,6) = "(" + ├── rparen_loc: (1,14)-(1,15) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (1,16)-(1,19) = "end" diff --git a/test/prism/snapshots/seattlerb/defn_kwarg_lvar.txt b/test/prism/snapshots/seattlerb/defn_kwarg_lvar.txt new file mode 100644 index 0000000000..6b46d9e2d4 --- /dev/null +++ b/test/prism/snapshots/seattlerb/defn_kwarg_lvar.txt @@ -0,0 +1,40 @@ +@ ProgramNode (location: (1,0)-(1,26)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,26)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,26)) + ├── name: :fun + ├── name_loc: (1,4)-(1,7) = "fun" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,8)-(1,16)) + │ ├── requireds: (length: 0) + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 1) + │ │ └── @ KeywordParameterNode (location: (1,8)-(1,16)) + │ │ ├── name: :kw + │ │ ├── name_loc: (1,8)-(1,11) = "kw:" + │ │ └── value: + │ │ @ SymbolNode (location: (1,12)-(1,16)) + │ │ ├── opening_loc: (1,12)-(1,13) = ":" + │ │ ├── value_loc: (1,13)-(1,16) = "val" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "val" + │ ├── keyword_rest: ∅ + │ └── block: ∅ + ├── body: + │ @ StatementsNode (location: (1,19)-(1,21)) + │ └── body: (length: 1) + │ └── @ LocalVariableReadNode (location: (1,19)-(1,21)) + │ ├── name: :kw + │ └── depth: 0 + ├── locals: [:kw] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (1,7)-(1,8) = "(" + ├── rparen_loc: (1,16)-(1,17) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (1,23)-(1,26) = "end" diff --git a/test/prism/snapshots/seattlerb/defn_kwarg_no_parens.txt b/test/prism/snapshots/seattlerb/defn_kwarg_no_parens.txt new file mode 100644 index 0000000000..ba0bd44324 --- /dev/null +++ b/test/prism/snapshots/seattlerb/defn_kwarg_no_parens.txt @@ -0,0 +1,32 @@ +@ ProgramNode (location: (1,0)-(2,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,3)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(2,3)) + ├── name: :f + ├── name_loc: (1,4)-(1,5) = "f" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,6)-(1,10)) + │ ├── requireds: (length: 0) + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 1) + │ │ └── @ KeywordParameterNode (location: (1,6)-(1,10)) + │ │ ├── name: :a + │ │ ├── name_loc: (1,6)-(1,8) = "a:" + │ │ └── value: + │ │ @ IntegerNode (location: (1,9)-(1,10)) + │ │ └── flags: decimal + │ ├── keyword_rest: ∅ + │ └── block: ∅ + ├── body: ∅ + ├── locals: [:a] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── equal_loc: ∅ + └── end_keyword_loc: (2,0)-(2,3) = "end" diff --git a/test/prism/snapshots/seattlerb/defn_kwarg_val.txt b/test/prism/snapshots/seattlerb/defn_kwarg_val.txt new file mode 100644 index 0000000000..5933c969db --- /dev/null +++ b/test/prism/snapshots/seattlerb/defn_kwarg_val.txt @@ -0,0 +1,34 @@ +@ ProgramNode (location: (1,0)-(1,17)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,17)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,17)) + ├── name: :f + ├── name_loc: (1,4)-(1,5) = "f" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,6)-(1,12)) + │ ├── requireds: (length: 1) + │ │ └── @ RequiredParameterNode (location: (1,6)-(1,7)) + │ │ └── name: :a + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 1) + │ │ └── @ KeywordParameterNode (location: (1,9)-(1,12)) + │ │ ├── name: :b + │ │ ├── name_loc: (1,9)-(1,11) = "b:" + │ │ └── value: + │ │ @ IntegerNode (location: (1,11)-(1,12)) + │ │ └── flags: decimal + │ ├── keyword_rest: ∅ + │ └── block: ∅ + ├── body: ∅ + ├── locals: [:a, :b] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (1,5)-(1,6) = "(" + ├── rparen_loc: (1,12)-(1,13) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (1,14)-(1,17) = "end" diff --git a/test/prism/snapshots/seattlerb/defn_no_kwargs.txt b/test/prism/snapshots/seattlerb/defn_no_kwargs.txt new file mode 100644 index 0000000000..0ef0634a53 --- /dev/null +++ b/test/prism/snapshots/seattlerb/defn_no_kwargs.txt @@ -0,0 +1,29 @@ +@ ProgramNode (location: (1,0)-(1,17)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,17)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,17)) + ├── name: :x + ├── name_loc: (1,4)-(1,5) = "x" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,6)-(1,11)) + │ ├── requireds: (length: 0) + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 0) + │ ├── keyword_rest: + │ │ @ NoKeywordsParameterNode (location: (1,6)-(1,11)) + │ │ ├── operator_loc: (1,6)-(1,8) = "**" + │ │ └── keyword_loc: (1,8)-(1,11) = "nil" + │ └── block: ∅ + ├── body: ∅ + ├── locals: [] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (1,5)-(1,6) = "(" + ├── rparen_loc: (1,11)-(1,12) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (1,14)-(1,17) = "end" diff --git a/test/prism/snapshots/seattlerb/defn_oneliner.txt b/test/prism/snapshots/seattlerb/defn_oneliner.txt new file mode 100644 index 0000000000..55227da074 --- /dev/null +++ b/test/prism/snapshots/seattlerb/defn_oneliner.txt @@ -0,0 +1,45 @@ +@ ProgramNode (location: (1,0)-(1,27)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,27)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,27)) + ├── name: :exec + ├── name_loc: (1,4)-(1,8) = "exec" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,9)-(1,12)) + │ ├── requireds: (length: 1) + │ │ └── @ RequiredParameterNode (location: (1,9)-(1,12)) + │ │ └── name: :cmd + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 0) + │ ├── keyword_rest: ∅ + │ └── block: ∅ + ├── body: + │ @ StatementsNode (location: (1,16)-(1,27)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,16)-(1,27)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,16)-(1,22) = "system" + │ ├── opening_loc: (1,22)-(1,23) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,23)-(1,26)) + │ │ └── arguments: (length: 1) + │ │ └── @ LocalVariableReadNode (location: (1,23)-(1,26)) + │ │ ├── name: :cmd + │ │ └── depth: 0 + │ ├── closing_loc: (1,26)-(1,27) = ")" + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "system" + ├── locals: [:cmd] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (1,8)-(1,9) = "(" + ├── rparen_loc: (1,12)-(1,13) = ")" + ├── equal_loc: (1,14)-(1,15) = "=" + └── end_keyword_loc: ∅ diff --git a/test/prism/snapshots/seattlerb/defn_oneliner_eq2.txt b/test/prism/snapshots/seattlerb/defn_oneliner_eq2.txt new file mode 100644 index 0000000000..359332adba --- /dev/null +++ b/test/prism/snapshots/seattlerb/defn_oneliner_eq2.txt @@ -0,0 +1,45 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ ClassNode (location: (1,0)-(3,3)) + ├── locals: [] + ├── class_keyword_loc: (1,0)-(1,5) = "class" + ├── constant_path: + │ @ ConstantReadNode (location: (1,6)-(1,7)) + │ └── name: :X + ├── inheritance_operator_loc: ∅ + ├── superclass: ∅ + ├── body: + │ @ StatementsNode (location: (2,2)-(2,16)) + │ └── body: (length: 1) + │ └── @ DefNode (location: (2,2)-(2,16)) + │ ├── name: :== + │ ├── name_loc: (2,6)-(2,8) = "==" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (2,9)-(2,10)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (2,9)-(2,10)) + │ │ │ └── name: :o + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (2,14)-(2,16)) + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (2,14)-(2,16)) + │ │ └── flags: decimal + │ ├── locals: [:o] + │ ├── def_keyword_loc: (2,2)-(2,5) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (2,8)-(2,9) = "(" + │ ├── rparen_loc: (2,10)-(2,11) = ")" + │ ├── equal_loc: (2,12)-(2,13) = "=" + │ └── end_keyword_loc: ∅ + ├── end_keyword_loc: (3,0)-(3,3) = "end" + └── name: :X diff --git a/test/prism/snapshots/seattlerb/defn_oneliner_noargs.txt b/test/prism/snapshots/seattlerb/defn_oneliner_noargs.txt new file mode 100644 index 0000000000..1159287905 --- /dev/null +++ b/test/prism/snapshots/seattlerb/defn_oneliner_noargs.txt @@ -0,0 +1,30 @@ +@ ProgramNode (location: (1,0)-(1,17)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,17)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,17)) + ├── name: :exec + ├── name_loc: (1,4)-(1,8) = "exec" + ├── receiver: ∅ + ├── parameters: ∅ + ├── body: + │ @ StatementsNode (location: (1,11)-(1,17)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,11)-(1,17)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,11)-(1,17) = "system" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "system" + ├── locals: [] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── equal_loc: (1,9)-(1,10) = "=" + └── end_keyword_loc: ∅ diff --git a/test/prism/snapshots/seattlerb/defn_oneliner_noargs_parentheses.txt b/test/prism/snapshots/seattlerb/defn_oneliner_noargs_parentheses.txt new file mode 100644 index 0000000000..6634a2c375 --- /dev/null +++ b/test/prism/snapshots/seattlerb/defn_oneliner_noargs_parentheses.txt @@ -0,0 +1,30 @@ +@ ProgramNode (location: (1,0)-(1,19)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,19)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,19)) + ├── name: :exec + ├── name_loc: (1,4)-(1,8) = "exec" + ├── receiver: ∅ + ├── parameters: ∅ + ├── body: + │ @ StatementsNode (location: (1,13)-(1,19)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,13)-(1,19)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,13)-(1,19) = "system" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "system" + ├── locals: [] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (1,8)-(1,9) = "(" + ├── rparen_loc: (1,9)-(1,10) = ")" + ├── equal_loc: (1,11)-(1,12) = "=" + └── end_keyword_loc: ∅ diff --git a/test/prism/snapshots/seattlerb/defn_oneliner_rescue.txt b/test/prism/snapshots/seattlerb/defn_oneliner_rescue.txt new file mode 100644 index 0000000000..5fe7779944 --- /dev/null +++ b/test/prism/snapshots/seattlerb/defn_oneliner_rescue.txt @@ -0,0 +1,152 @@ +@ ProgramNode (location: (1,0)-(13,38)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(13,38)) + └── body: (length: 3) + ├── @ DefNode (location: (1,0)-(5,3)) + │ ├── name: :exec + │ ├── name_loc: (1,4)-(1,8) = "exec" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (1,9)-(1,12)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,12)) + │ │ │ └── name: :cmd + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: + │ │ @ BeginNode (location: (2,2)-(5,3)) + │ │ ├── begin_keyword_loc: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (2,2)-(2,13)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (2,2)-(2,13)) + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── message_loc: (2,2)-(2,8) = "system" + │ │ │ ├── opening_loc: (2,8)-(2,9) = "(" + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (2,9)-(2,12)) + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ LocalVariableReadNode (location: (2,9)-(2,12)) + │ │ │ │ ├── name: :cmd + │ │ │ │ └── depth: 0 + │ │ │ ├── closing_loc: (2,12)-(2,13) = ")" + │ │ │ ├── block: ∅ + │ │ │ ├── flags: ∅ + │ │ │ └── name: "system" + │ │ ├── rescue_clause: + │ │ │ @ RescueNode (location: (3,0)-(4,5)) + │ │ │ ├── keyword_loc: (3,0)-(3,6) = "rescue" + │ │ │ ├── exceptions: (length: 0) + │ │ │ ├── operator_loc: ∅ + │ │ │ ├── reference: ∅ + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (4,2)-(4,5)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ NilNode (location: (4,2)-(4,5)) + │ │ │ └── consequent: ∅ + │ │ ├── else_clause: ∅ + │ │ ├── ensure_clause: ∅ + │ │ └── end_keyword_loc: (5,0)-(5,3) = "end" + │ ├── locals: [:cmd] + │ ├── def_keyword_loc: (1,0)-(1,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (1,8)-(1,9) = "(" + │ ├── rparen_loc: (1,12)-(1,13) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (5,0)-(5,3) = "end" + ├── @ DefNode (location: (8,0)-(10,3)) + │ ├── name: :exec + │ ├── name_loc: (8,4)-(8,8) = "exec" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (8,9)-(8,12)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (8,9)-(8,12)) + │ │ │ └── name: :cmd + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (9,2)-(9,24)) + │ │ └── body: (length: 1) + │ │ └── @ RescueModifierNode (location: (9,2)-(9,24)) + │ │ ├── expression: + │ │ │ @ CallNode (location: (9,2)-(9,13)) + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── message_loc: (9,2)-(9,8) = "system" + │ │ │ ├── opening_loc: (9,8)-(9,9) = "(" + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (9,9)-(9,12)) + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ LocalVariableReadNode (location: (9,9)-(9,12)) + │ │ │ │ ├── name: :cmd + │ │ │ │ └── depth: 0 + │ │ │ ├── closing_loc: (9,12)-(9,13) = ")" + │ │ │ ├── block: ∅ + │ │ │ ├── flags: ∅ + │ │ │ └── name: "system" + │ │ ├── keyword_loc: (9,14)-(9,20) = "rescue" + │ │ └── rescue_expression: + │ │ @ NilNode (location: (9,21)-(9,24)) + │ ├── locals: [:cmd] + │ ├── def_keyword_loc: (8,0)-(8,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (8,8)-(8,9) = "(" + │ ├── rparen_loc: (8,12)-(8,13) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (10,0)-(10,3) = "end" + └── @ DefNode (location: (13,0)-(13,38)) + ├── name: :exec + ├── name_loc: (13,4)-(13,8) = "exec" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (13,9)-(13,12)) + │ ├── requireds: (length: 1) + │ │ └── @ RequiredParameterNode (location: (13,9)-(13,12)) + │ │ └── name: :cmd + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 0) + │ ├── keyword_rest: ∅ + │ └── block: ∅ + ├── body: + │ @ StatementsNode (location: (13,16)-(13,38)) + │ └── body: (length: 1) + │ └── @ RescueModifierNode (location: (13,16)-(13,38)) + │ ├── expression: + │ │ @ CallNode (location: (13,16)-(13,27)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (13,16)-(13,22) = "system" + │ │ ├── opening_loc: (13,22)-(13,23) = "(" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (13,23)-(13,26)) + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ LocalVariableReadNode (location: (13,23)-(13,26)) + │ │ │ ├── name: :cmd + │ │ │ └── depth: 0 + │ │ ├── closing_loc: (13,26)-(13,27) = ")" + │ │ ├── block: ∅ + │ │ ├── flags: ∅ + │ │ └── name: "system" + │ ├── keyword_loc: (13,28)-(13,34) = "rescue" + │ └── rescue_expression: + │ @ NilNode (location: (13,35)-(13,38)) + ├── locals: [:cmd] + ├── def_keyword_loc: (13,0)-(13,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (13,8)-(13,9) = "(" + ├── rparen_loc: (13,12)-(13,13) = ")" + ├── equal_loc: (13,14)-(13,15) = "=" + └── end_keyword_loc: ∅ diff --git a/test/prism/snapshots/seattlerb/defn_opt_last_arg.txt b/test/prism/snapshots/seattlerb/defn_opt_last_arg.txt new file mode 100644 index 0000000000..e82a9c8091 --- /dev/null +++ b/test/prism/snapshots/seattlerb/defn_opt_last_arg.txt @@ -0,0 +1,32 @@ +@ ProgramNode (location: (1,0)-(2,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,3)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(2,3)) + ├── name: :m + ├── name_loc: (1,4)-(1,5) = "m" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,6)-(1,17)) + │ ├── requireds: (length: 0) + │ ├── optionals: (length: 1) + │ │ └── @ OptionalParameterNode (location: (1,6)-(1,17)) + │ │ ├── name: :arg + │ │ ├── name_loc: (1,6)-(1,9) = "arg" + │ │ ├── operator_loc: (1,10)-(1,11) = "=" + │ │ └── value: + │ │ @ FalseNode (location: (1,12)-(1,17)) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 0) + │ ├── keyword_rest: ∅ + │ └── block: ∅ + ├── body: ∅ + ├── locals: [:arg] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── equal_loc: ∅ + └── end_keyword_loc: (2,0)-(2,3) = "end" diff --git a/test/prism/snapshots/seattlerb/defn_opt_reg.txt b/test/prism/snapshots/seattlerb/defn_opt_reg.txt new file mode 100644 index 0000000000..437eaa7472 --- /dev/null +++ b/test/prism/snapshots/seattlerb/defn_opt_reg.txt @@ -0,0 +1,34 @@ +@ ProgramNode (location: (1,0)-(1,19)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,19)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,19)) + ├── name: :f + ├── name_loc: (1,4)-(1,5) = "f" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,6)-(1,14)) + │ ├── requireds: (length: 0) + │ ├── optionals: (length: 1) + │ │ └── @ OptionalParameterNode (location: (1,6)-(1,11)) + │ │ ├── name: :a + │ │ ├── name_loc: (1,6)-(1,7) = "a" + │ │ ├── operator_loc: (1,7)-(1,8) = "=" + │ │ └── value: + │ │ @ NilNode (location: (1,8)-(1,11)) + │ ├── rest: ∅ + │ ├── posts: (length: 1) + │ │ └── @ RequiredParameterNode (location: (1,13)-(1,14)) + │ │ └── name: :b + │ ├── keywords: (length: 0) + │ ├── keyword_rest: ∅ + │ └── block: ∅ + ├── body: ∅ + ├── locals: [:a, :b] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (1,5)-(1,6) = "(" + ├── rparen_loc: (1,14)-(1,15) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (1,16)-(1,19) = "end" diff --git a/test/prism/snapshots/seattlerb/defn_opt_splat_arg.txt b/test/prism/snapshots/seattlerb/defn_opt_splat_arg.txt new file mode 100644 index 0000000000..4ad2a5303e --- /dev/null +++ b/test/prism/snapshots/seattlerb/defn_opt_splat_arg.txt @@ -0,0 +1,39 @@ +@ ProgramNode (location: (1,0)-(1,24)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,24)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,24)) + ├── name: :f + ├── name_loc: (1,4)-(1,5) = "f" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,7)-(1,19)) + │ ├── requireds: (length: 0) + │ ├── optionals: (length: 1) + │ │ └── @ OptionalParameterNode (location: (1,7)-(1,12)) + │ │ ├── name: :a + │ │ ├── name_loc: (1,7)-(1,8) = "a" + │ │ ├── operator_loc: (1,9)-(1,10) = "=" + │ │ └── value: + │ │ @ IntegerNode (location: (1,11)-(1,12)) + │ │ └── flags: decimal + │ ├── rest: + │ │ @ RestParameterNode (location: (1,14)-(1,16)) + │ │ ├── name: :b + │ │ ├── name_loc: (1,15)-(1,16) = "b" + │ │ └── operator_loc: (1,14)-(1,15) = "*" + │ ├── posts: (length: 1) + │ │ └── @ RequiredParameterNode (location: (1,18)-(1,19)) + │ │ └── name: :c + │ ├── keywords: (length: 0) + │ ├── keyword_rest: ∅ + │ └── block: ∅ + ├── body: ∅ + ├── locals: [:a, :b, :c] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (1,6)-(1,7) = "(" + ├── rparen_loc: (1,19)-(1,20) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (1,21)-(1,24) = "end" diff --git a/test/prism/snapshots/seattlerb/defn_powarg.txt b/test/prism/snapshots/seattlerb/defn_powarg.txt new file mode 100644 index 0000000000..a903d1f741 --- /dev/null +++ b/test/prism/snapshots/seattlerb/defn_powarg.txt @@ -0,0 +1,30 @@ +@ ProgramNode (location: (1,0)-(1,17)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,17)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,17)) + ├── name: :f + ├── name_loc: (1,4)-(1,5) = "f" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,6)-(1,12)) + │ ├── requireds: (length: 0) + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 0) + │ ├── keyword_rest: + │ │ @ KeywordRestParameterNode (location: (1,6)-(1,12)) + │ │ ├── name: :opts + │ │ ├── name_loc: (1,8)-(1,12) = "opts" + │ │ └── operator_loc: (1,6)-(1,8) = "**" + │ └── block: ∅ + ├── body: ∅ + ├── locals: [:opts] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (1,5)-(1,6) = "(" + ├── rparen_loc: (1,12)-(1,13) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (1,14)-(1,17) = "end" diff --git a/test/prism/snapshots/seattlerb/defn_reg_opt_reg.txt b/test/prism/snapshots/seattlerb/defn_reg_opt_reg.txt new file mode 100644 index 0000000000..0b6614abbc --- /dev/null +++ b/test/prism/snapshots/seattlerb/defn_reg_opt_reg.txt @@ -0,0 +1,40 @@ +@ ProgramNode (location: (1,0)-(1,23)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,23)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,23)) + ├── name: :f + ├── name_loc: (1,4)-(1,5) = "f" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,6)-(1,18)) + │ ├── requireds: (length: 1) + │ │ └── @ RequiredParameterNode (location: (1,6)-(1,7)) + │ │ └── name: :a + │ ├── optionals: (length: 1) + │ │ └── @ OptionalParameterNode (location: (1,9)-(1,15)) + │ │ ├── name: :b + │ │ ├── name_loc: (1,9)-(1,10) = "b" + │ │ ├── operator_loc: (1,11)-(1,12) = "=" + │ │ └── value: + │ │ @ SymbolNode (location: (1,13)-(1,15)) + │ │ ├── opening_loc: (1,13)-(1,14) = ":" + │ │ ├── value_loc: (1,14)-(1,15) = "c" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "c" + │ ├── rest: ∅ + │ ├── posts: (length: 1) + │ │ └── @ RequiredParameterNode (location: (1,17)-(1,18)) + │ │ └── name: :d + │ ├── keywords: (length: 0) + │ ├── keyword_rest: ∅ + │ └── block: ∅ + ├── body: ∅ + ├── locals: [:a, :b, :d] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (1,5)-(1,6) = "(" + ├── rparen_loc: (1,18)-(1,19) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (1,20)-(1,23) = "end" diff --git a/test/prism/snapshots/seattlerb/defn_splat_arg.txt b/test/prism/snapshots/seattlerb/defn_splat_arg.txt new file mode 100644 index 0000000000..69b1c0749a --- /dev/null +++ b/test/prism/snapshots/seattlerb/defn_splat_arg.txt @@ -0,0 +1,32 @@ +@ ProgramNode (location: (1,0)-(1,15)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,15)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,15)) + ├── name: :f + ├── name_loc: (1,4)-(1,5) = "f" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,6)-(1,10)) + │ ├── requireds: (length: 0) + │ ├── optionals: (length: 0) + │ ├── rest: + │ │ @ RestParameterNode (location: (1,6)-(1,7)) + │ │ ├── name: nil + │ │ ├── name_loc: ∅ + │ │ └── operator_loc: (1,6)-(1,7) = "*" + │ ├── posts: (length: 1) + │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ └── name: :a + │ ├── keywords: (length: 0) + │ ├── keyword_rest: ∅ + │ └── block: ∅ + ├── body: ∅ + ├── locals: [:*, :a] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (1,5)-(1,6) = "(" + ├── rparen_loc: (1,10)-(1,11) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (1,12)-(1,15) = "end" diff --git a/test/prism/snapshots/seattlerb/defn_unary_not.txt b/test/prism/snapshots/seattlerb/defn_unary_not.txt new file mode 100644 index 0000000000..61afb79ad1 --- /dev/null +++ b/test/prism/snapshots/seattlerb/defn_unary_not.txt @@ -0,0 +1,21 @@ +@ ProgramNode (location: (1,0)-(1,17)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,17)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,17)) + ├── name: :"!@" + ├── name_loc: (1,4)-(1,6) = "!@" + ├── receiver: ∅ + ├── parameters: ∅ + ├── body: + │ @ StatementsNode (location: (1,8)-(1,12)) + │ └── body: (length: 1) + │ └── @ TrueNode (location: (1,8)-(1,12)) + ├── locals: [] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── equal_loc: ∅ + └── end_keyword_loc: (1,14)-(1,17) = "end" diff --git a/test/prism/snapshots/seattlerb/defns_reserved.txt b/test/prism/snapshots/seattlerb/defns_reserved.txt new file mode 100644 index 0000000000..96860b49ce --- /dev/null +++ b/test/prism/snapshots/seattlerb/defns_reserved.txt @@ -0,0 +1,19 @@ +@ ProgramNode (location: (1,0)-(1,20)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,20)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,20)) + ├── name: :return + ├── name_loc: (1,9)-(1,15) = "return" + ├── receiver: + │ @ SelfNode (location: (1,4)-(1,8)) + ├── parameters: ∅ + ├── body: ∅ + ├── locals: [] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: (1,8)-(1,9) = "." + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── equal_loc: ∅ + └── end_keyword_loc: (1,17)-(1,20) = "end" diff --git a/test/prism/snapshots/seattlerb/defs_as_arg_with_do_block_inside.txt b/test/prism/snapshots/seattlerb/defs_as_arg_with_do_block_inside.txt new file mode 100644 index 0000000000..8b2002ac39 --- /dev/null +++ b/test/prism/snapshots/seattlerb/defs_as_arg_with_do_block_inside.txt @@ -0,0 +1,59 @@ +@ ProgramNode (location: (1,0)-(1,30)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,30)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,30)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "p" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,30)) + │ └── arguments: (length: 1) + │ └── @ DefNode (location: (1,2)-(1,30)) + │ ├── name: :b + │ ├── name_loc: (1,11)-(1,12) = "b" + │ ├── receiver: + │ │ @ SelfNode (location: (1,6)-(1,10)) + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (1,14)-(1,25)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (1,14)-(1,25)) + │ │ ├── receiver: + │ │ │ @ CallNode (location: (1,14)-(1,15)) + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── message_loc: (1,14)-(1,15) = "x" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── block: ∅ + │ │ │ ├── flags: variable_call + │ │ │ └── name: "x" + │ │ ├── call_operator_loc: (1,15)-(1,16) = "." + │ │ ├── message_loc: (1,16)-(1,17) = "y" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: + │ │ │ @ BlockNode (location: (1,18)-(1,25)) + │ │ │ ├── locals: [] + │ │ │ ├── parameters: ∅ + │ │ │ ├── body: ∅ + │ │ │ ├── opening_loc: (1,18)-(1,20) = "do" + │ │ │ └── closing_loc: (1,22)-(1,25) = "end" + │ │ ├── flags: ∅ + │ │ └── name: "y" + │ ├── locals: [] + │ ├── def_keyword_loc: (1,2)-(1,5) = "def" + │ ├── operator_loc: (1,10)-(1,11) = "." + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (1,27)-(1,30) = "end" + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "p" diff --git a/test/prism/snapshots/seattlerb/defs_comments.txt b/test/prism/snapshots/seattlerb/defs_comments.txt new file mode 100644 index 0000000000..a2976e7ee2 --- /dev/null +++ b/test/prism/snapshots/seattlerb/defs_comments.txt @@ -0,0 +1,19 @@ +@ ProgramNode (location: (4,0)-(5,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (4,0)-(5,3)) + └── body: (length: 1) + └── @ DefNode (location: (4,0)-(5,3)) + ├── name: :blah + ├── name_loc: (4,9)-(4,13) = "blah" + ├── receiver: + │ @ SelfNode (location: (4,4)-(4,8)) + ├── parameters: ∅ + ├── body: ∅ + ├── locals: [] + ├── def_keyword_loc: (4,0)-(4,3) = "def" + ├── operator_loc: (4,8)-(4,9) = "." + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── equal_loc: ∅ + └── end_keyword_loc: (5,0)-(5,3) = "end" diff --git a/test/prism/snapshots/seattlerb/defs_endless_command.txt b/test/prism/snapshots/seattlerb/defs_endless_command.txt new file mode 100644 index 0000000000..257b632a3d --- /dev/null +++ b/test/prism/snapshots/seattlerb/defs_endless_command.txt @@ -0,0 +1,44 @@ +@ ProgramNode (location: (1,0)-(1,35)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,35)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,35)) + ├── name: :some_method + ├── name_loc: (1,6)-(1,17) = "some_method" + ├── receiver: + │ @ CallNode (location: (1,4)-(1,5)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,4)-(1,5) = "x" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "x" + ├── parameters: ∅ + ├── body: + │ @ StatementsNode (location: (1,20)-(1,35)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,20)-(1,35)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,20)-(1,32) = "other_method" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,33)-(1,35)) + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (1,33)-(1,35)) + │ │ └── flags: decimal + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "other_method" + ├── locals: [] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: (1,5)-(1,6) = "." + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── equal_loc: (1,18)-(1,19) = "=" + └── end_keyword_loc: ∅ diff --git a/test/prism/snapshots/seattlerb/defs_endless_command_rescue.txt b/test/prism/snapshots/seattlerb/defs_endless_command_rescue.txt new file mode 100644 index 0000000000..0b18829492 --- /dev/null +++ b/test/prism/snapshots/seattlerb/defs_endless_command_rescue.txt @@ -0,0 +1,50 @@ +@ ProgramNode (location: (1,0)-(1,45)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,45)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,45)) + ├── name: :some_method + ├── name_loc: (1,6)-(1,17) = "some_method" + ├── receiver: + │ @ CallNode (location: (1,4)-(1,5)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,4)-(1,5) = "x" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "x" + ├── parameters: ∅ + ├── body: + │ @ StatementsNode (location: (1,20)-(1,45)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,20)-(1,45)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,20)-(1,32) = "other_method" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,33)-(1,45)) + │ │ └── arguments: (length: 1) + │ │ └── @ RescueModifierNode (location: (1,33)-(1,45)) + │ │ ├── expression: + │ │ │ @ IntegerNode (location: (1,33)-(1,35)) + │ │ │ └── flags: decimal + │ │ ├── keyword_loc: (1,36)-(1,42) = "rescue" + │ │ └── rescue_expression: + │ │ @ IntegerNode (location: (1,43)-(1,45)) + │ │ └── flags: decimal + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "other_method" + ├── locals: [] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: (1,5)-(1,6) = "." + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── equal_loc: (1,18)-(1,19) = "=" + └── end_keyword_loc: ∅ diff --git a/test/prism/snapshots/seattlerb/defs_kwarg.txt b/test/prism/snapshots/seattlerb/defs_kwarg.txt new file mode 100644 index 0000000000..8343c1f178 --- /dev/null +++ b/test/prism/snapshots/seattlerb/defs_kwarg.txt @@ -0,0 +1,33 @@ +@ ProgramNode (location: (1,0)-(2,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,3)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(2,3)) + ├── name: :a + ├── name_loc: (1,9)-(1,10) = "a" + ├── receiver: + │ @ SelfNode (location: (1,4)-(1,8)) + ├── parameters: + │ @ ParametersNode (location: (1,11)-(1,15)) + │ ├── requireds: (length: 0) + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 1) + │ │ └── @ KeywordParameterNode (location: (1,11)-(1,15)) + │ │ ├── name: :b + │ │ ├── name_loc: (1,11)-(1,13) = "b:" + │ │ └── value: + │ │ @ IntegerNode (location: (1,14)-(1,15)) + │ │ └── flags: decimal + │ ├── keyword_rest: ∅ + │ └── block: ∅ + ├── body: ∅ + ├── locals: [:b] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: (1,8)-(1,9) = "." + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── equal_loc: ∅ + └── end_keyword_loc: (2,0)-(2,3) = "end" diff --git a/test/prism/snapshots/seattlerb/defs_oneliner.txt b/test/prism/snapshots/seattlerb/defs_oneliner.txt new file mode 100644 index 0000000000..629de9b138 --- /dev/null +++ b/test/prism/snapshots/seattlerb/defs_oneliner.txt @@ -0,0 +1,46 @@ +@ ProgramNode (location: (1,0)-(1,32)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,32)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,32)) + ├── name: :exec + ├── name_loc: (1,9)-(1,13) = "exec" + ├── receiver: + │ @ SelfNode (location: (1,4)-(1,8)) + ├── parameters: + │ @ ParametersNode (location: (1,14)-(1,17)) + │ ├── requireds: (length: 1) + │ │ └── @ RequiredParameterNode (location: (1,14)-(1,17)) + │ │ └── name: :cmd + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 0) + │ ├── keyword_rest: ∅ + │ └── block: ∅ + ├── body: + │ @ StatementsNode (location: (1,21)-(1,32)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,21)-(1,32)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,21)-(1,27) = "system" + │ ├── opening_loc: (1,27)-(1,28) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,28)-(1,31)) + │ │ └── arguments: (length: 1) + │ │ └── @ LocalVariableReadNode (location: (1,28)-(1,31)) + │ │ ├── name: :cmd + │ │ └── depth: 0 + │ ├── closing_loc: (1,31)-(1,32) = ")" + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "system" + ├── locals: [:cmd] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: (1,8)-(1,9) = "." + ├── lparen_loc: (1,13)-(1,14) = "(" + ├── rparen_loc: (1,17)-(1,18) = ")" + ├── equal_loc: (1,19)-(1,20) = "=" + └── end_keyword_loc: ∅ diff --git a/test/prism/snapshots/seattlerb/defs_oneliner_eq2.txt b/test/prism/snapshots/seattlerb/defs_oneliner_eq2.txt new file mode 100644 index 0000000000..45ae30ecea --- /dev/null +++ b/test/prism/snapshots/seattlerb/defs_oneliner_eq2.txt @@ -0,0 +1,46 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ ClassNode (location: (1,0)-(3,3)) + ├── locals: [] + ├── class_keyword_loc: (1,0)-(1,5) = "class" + ├── constant_path: + │ @ ConstantReadNode (location: (1,6)-(1,7)) + │ └── name: :X + ├── inheritance_operator_loc: ∅ + ├── superclass: ∅ + ├── body: + │ @ StatementsNode (location: (2,2)-(2,21)) + │ └── body: (length: 1) + │ └── @ DefNode (location: (2,2)-(2,21)) + │ ├── name: :== + │ ├── name_loc: (2,11)-(2,13) = "==" + │ ├── receiver: + │ │ @ SelfNode (location: (2,6)-(2,10)) + │ ├── parameters: + │ │ @ ParametersNode (location: (2,14)-(2,15)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (2,14)-(2,15)) + │ │ │ └── name: :o + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (2,19)-(2,21)) + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (2,19)-(2,21)) + │ │ └── flags: decimal + │ ├── locals: [:o] + │ ├── def_keyword_loc: (2,2)-(2,5) = "def" + │ ├── operator_loc: (2,10)-(2,11) = "." + │ ├── lparen_loc: (2,13)-(2,14) = "(" + │ ├── rparen_loc: (2,15)-(2,16) = ")" + │ ├── equal_loc: (2,17)-(2,18) = "=" + │ └── end_keyword_loc: ∅ + ├── end_keyword_loc: (3,0)-(3,3) = "end" + └── name: :X diff --git a/test/prism/snapshots/seattlerb/defs_oneliner_rescue.txt b/test/prism/snapshots/seattlerb/defs_oneliner_rescue.txt new file mode 100644 index 0000000000..9e1bea2d2c --- /dev/null +++ b/test/prism/snapshots/seattlerb/defs_oneliner_rescue.txt @@ -0,0 +1,155 @@ +@ ProgramNode (location: (1,0)-(13,43)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(13,43)) + └── body: (length: 3) + ├── @ DefNode (location: (1,0)-(5,3)) + │ ├── name: :exec + │ ├── name_loc: (1,9)-(1,13) = "exec" + │ ├── receiver: + │ │ @ SelfNode (location: (1,4)-(1,8)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,14)-(1,17)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,14)-(1,17)) + │ │ │ └── name: :cmd + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: + │ │ @ BeginNode (location: (2,2)-(5,3)) + │ │ ├── begin_keyword_loc: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (2,2)-(2,13)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (2,2)-(2,13)) + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── message_loc: (2,2)-(2,8) = "system" + │ │ │ ├── opening_loc: (2,8)-(2,9) = "(" + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (2,9)-(2,12)) + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ LocalVariableReadNode (location: (2,9)-(2,12)) + │ │ │ │ ├── name: :cmd + │ │ │ │ └── depth: 0 + │ │ │ ├── closing_loc: (2,12)-(2,13) = ")" + │ │ │ ├── block: ∅ + │ │ │ ├── flags: ∅ + │ │ │ └── name: "system" + │ │ ├── rescue_clause: + │ │ │ @ RescueNode (location: (3,0)-(4,5)) + │ │ │ ├── keyword_loc: (3,0)-(3,6) = "rescue" + │ │ │ ├── exceptions: (length: 0) + │ │ │ ├── operator_loc: ∅ + │ │ │ ├── reference: ∅ + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (4,2)-(4,5)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ NilNode (location: (4,2)-(4,5)) + │ │ │ └── consequent: ∅ + │ │ ├── else_clause: ∅ + │ │ ├── ensure_clause: ∅ + │ │ └── end_keyword_loc: (5,0)-(5,3) = "end" + │ ├── locals: [:cmd] + │ ├── def_keyword_loc: (1,0)-(1,3) = "def" + │ ├── operator_loc: (1,8)-(1,9) = "." + │ ├── lparen_loc: (1,13)-(1,14) = "(" + │ ├── rparen_loc: (1,17)-(1,18) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (5,0)-(5,3) = "end" + ├── @ DefNode (location: (8,0)-(10,3)) + │ ├── name: :exec + │ ├── name_loc: (8,9)-(8,13) = "exec" + │ ├── receiver: + │ │ @ SelfNode (location: (8,4)-(8,8)) + │ ├── parameters: + │ │ @ ParametersNode (location: (8,14)-(8,17)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (8,14)-(8,17)) + │ │ │ └── name: :cmd + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (9,2)-(9,24)) + │ │ └── body: (length: 1) + │ │ └── @ RescueModifierNode (location: (9,2)-(9,24)) + │ │ ├── expression: + │ │ │ @ CallNode (location: (9,2)-(9,13)) + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── message_loc: (9,2)-(9,8) = "system" + │ │ │ ├── opening_loc: (9,8)-(9,9) = "(" + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (9,9)-(9,12)) + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ LocalVariableReadNode (location: (9,9)-(9,12)) + │ │ │ │ ├── name: :cmd + │ │ │ │ └── depth: 0 + │ │ │ ├── closing_loc: (9,12)-(9,13) = ")" + │ │ │ ├── block: ∅ + │ │ │ ├── flags: ∅ + │ │ │ └── name: "system" + │ │ ├── keyword_loc: (9,14)-(9,20) = "rescue" + │ │ └── rescue_expression: + │ │ @ NilNode (location: (9,21)-(9,24)) + │ ├── locals: [:cmd] + │ ├── def_keyword_loc: (8,0)-(8,3) = "def" + │ ├── operator_loc: (8,8)-(8,9) = "." + │ ├── lparen_loc: (8,13)-(8,14) = "(" + │ ├── rparen_loc: (8,17)-(8,18) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (10,0)-(10,3) = "end" + └── @ DefNode (location: (13,0)-(13,43)) + ├── name: :exec + ├── name_loc: (13,9)-(13,13) = "exec" + ├── receiver: + │ @ SelfNode (location: (13,4)-(13,8)) + ├── parameters: + │ @ ParametersNode (location: (13,14)-(13,17)) + │ ├── requireds: (length: 1) + │ │ └── @ RequiredParameterNode (location: (13,14)-(13,17)) + │ │ └── name: :cmd + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 0) + │ ├── keyword_rest: ∅ + │ └── block: ∅ + ├── body: + │ @ StatementsNode (location: (13,21)-(13,43)) + │ └── body: (length: 1) + │ └── @ RescueModifierNode (location: (13,21)-(13,43)) + │ ├── expression: + │ │ @ CallNode (location: (13,21)-(13,32)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (13,21)-(13,27) = "system" + │ │ ├── opening_loc: (13,27)-(13,28) = "(" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (13,28)-(13,31)) + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ LocalVariableReadNode (location: (13,28)-(13,31)) + │ │ │ ├── name: :cmd + │ │ │ └── depth: 0 + │ │ ├── closing_loc: (13,31)-(13,32) = ")" + │ │ ├── block: ∅ + │ │ ├── flags: ∅ + │ │ └── name: "system" + │ ├── keyword_loc: (13,33)-(13,39) = "rescue" + │ └── rescue_expression: + │ @ NilNode (location: (13,40)-(13,43)) + ├── locals: [:cmd] + ├── def_keyword_loc: (13,0)-(13,3) = "def" + ├── operator_loc: (13,8)-(13,9) = "." + ├── lparen_loc: (13,13)-(13,14) = "(" + ├── rparen_loc: (13,17)-(13,18) = ")" + ├── equal_loc: (13,19)-(13,20) = "=" + └── end_keyword_loc: ∅ diff --git a/test/prism/snapshots/seattlerb/difficult0_.txt b/test/prism/snapshots/seattlerb/difficult0_.txt new file mode 100644 index 0000000000..f4f9b11560 --- /dev/null +++ b/test/prism/snapshots/seattlerb/difficult0_.txt @@ -0,0 +1,69 @@ +@ ProgramNode (location: (1,0)-(4,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,8)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(4,8)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "p" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(4,8)) + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (1,2)-(4,8)) + │ ├── receiver: + │ │ @ CallNode (location: (1,2)-(4,4)) + │ │ ├── receiver: + │ │ │ @ StringNode (location: (1,2)-(1,8)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (1,2)-(1,8) = "<<-END" + │ │ │ ├── content_loc: (2,0)-(2,0) = " a\n" + │ │ │ ├── closing_loc: (3,0)-(3,0) = " END\n" + │ │ │ └── unescaped: " a\n" + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,8)-(1,9) = "+" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (1,9)-(4,4)) + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ InterpolatedStringNode (location: (1,9)-(4,4)) + │ │ │ ├── opening_loc: (1,9)-(1,10) = "'" + │ │ │ ├── parts: (length: 2) + │ │ │ │ ├── @ StringNode (location: (1,10)-(1,0)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── content_loc: (1,10)-(1,0) = "b\n" + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── unescaped: "b\n" + │ │ │ │ └── @ StringNode (location: (4,0)-(4,3)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── content_loc: (4,0)-(4,3) = " c" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: " c" + │ │ │ └── closing_loc: (4,3)-(4,4) = "'" + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: ∅ + │ │ └── name: "+" + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (4,4)-(4,5) = "+" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (4,5)-(4,8)) + │ │ └── arguments: (length: 1) + │ │ └── @ StringNode (location: (4,5)-(4,8)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (4,5)-(4,6) = "'" + │ │ ├── content_loc: (4,6)-(4,7) = "d" + │ │ ├── closing_loc: (4,7)-(4,8) = "'" + │ │ └── unescaped: "d" + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "+" + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "p" diff --git a/test/prism/snapshots/seattlerb/difficult1_line_numbers.txt b/test/prism/snapshots/seattlerb/difficult1_line_numbers.txt new file mode 100644 index 0000000000..fd98c2a5ef --- /dev/null +++ b/test/prism/snapshots/seattlerb/difficult1_line_numbers.txt @@ -0,0 +1,242 @@ +@ ProgramNode (location: (1,0)-(12,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(12,3)) + └── body: (length: 1) + └── @ IfNode (location: (1,0)-(12,3)) + ├── if_keyword_loc: (1,0)-(1,2) = "if" + ├── predicate: + │ @ TrueNode (location: (1,3)-(1,7)) + ├── statements: + │ @ StatementsNode (location: (2,2)-(11,11)) + │ └── body: (length: 10) + │ ├── @ CallNode (location: (2,2)-(2,5)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (2,2)-(2,3) = "p" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (2,4)-(2,5)) + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (2,4)-(2,5)) + │ │ │ └── flags: decimal + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: ∅ + │ │ └── name: "p" + │ ├── @ CallNode (location: (3,2)-(3,7)) + │ │ ├── receiver: + │ │ │ @ CallNode (location: (3,2)-(3,3)) + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── message_loc: (3,2)-(3,3) = "a" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── block: ∅ + │ │ │ ├── flags: variable_call + │ │ │ └── name: "a" + │ │ ├── call_operator_loc: (3,3)-(3,4) = "." + │ │ ├── message_loc: (3,4)-(3,5) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (3,6)-(3,7)) + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (3,6)-(3,7)) + │ │ │ └── flags: decimal + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: ∅ + │ │ └── name: "b" + │ ├── @ CallNode (location: (4,2)-(4,10)) + │ │ ├── receiver: + │ │ │ @ CallNode (location: (4,2)-(4,3)) + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── message_loc: (4,2)-(4,3) = "c" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── block: ∅ + │ │ │ ├── flags: variable_call + │ │ │ └── name: "c" + │ │ ├── call_operator_loc: (4,3)-(4,4) = "." + │ │ ├── message_loc: (4,4)-(4,5) = "d" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (4,6)-(4,10)) + │ │ │ └── arguments: (length: 2) + │ │ │ ├── @ IntegerNode (location: (4,6)-(4,7)) + │ │ │ │ └── flags: decimal + │ │ │ └── @ IntegerNode (location: (4,9)-(4,10)) + │ │ │ └── flags: decimal + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: ∅ + │ │ └── name: "d" + │ ├── @ CallNode (location: (5,2)-(5,7)) + │ │ ├── receiver: + │ │ │ @ CallNode (location: (5,2)-(5,3)) + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── message_loc: (5,2)-(5,3) = "e" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── block: ∅ + │ │ │ ├── flags: variable_call + │ │ │ └── name: "e" + │ │ ├── call_operator_loc: (5,3)-(5,4) = "." + │ │ ├── message_loc: (5,4)-(5,5) = "f" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (5,6)-(5,7)) + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (5,6)-(5,7)) + │ │ │ └── flags: decimal + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: ∅ + │ │ └── name: "f" + │ ├── @ CallNode (location: (6,2)-(6,10)) + │ │ ├── receiver: + │ │ │ @ CallNode (location: (6,2)-(6,3)) + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── message_loc: (6,2)-(6,3) = "g" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── block: ∅ + │ │ │ ├── flags: variable_call + │ │ │ └── name: "g" + │ │ ├── call_operator_loc: (6,3)-(6,4) = "." + │ │ ├── message_loc: (6,4)-(6,5) = "h" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (6,6)-(6,10)) + │ │ │ └── arguments: (length: 2) + │ │ │ ├── @ IntegerNode (location: (6,6)-(6,7)) + │ │ │ │ └── flags: decimal + │ │ │ └── @ IntegerNode (location: (6,9)-(6,10)) + │ │ │ └── flags: decimal + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: ∅ + │ │ └── name: "h" + │ ├── @ CallNode (location: (7,2)-(7,6)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (7,2)-(7,3) = "p" + │ │ ├── opening_loc: (7,3)-(7,4) = "(" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (7,4)-(7,5)) + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (7,4)-(7,5)) + │ │ │ └── flags: decimal + │ │ ├── closing_loc: (7,5)-(7,6) = ")" + │ │ ├── block: ∅ + │ │ ├── flags: ∅ + │ │ └── name: "p" + │ ├── @ CallNode (location: (8,2)-(8,8)) + │ │ ├── receiver: + │ │ │ @ CallNode (location: (8,2)-(8,3)) + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── message_loc: (8,2)-(8,3) = "a" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── block: ∅ + │ │ │ ├── flags: variable_call + │ │ │ └── name: "a" + │ │ ├── call_operator_loc: (8,3)-(8,4) = "." + │ │ ├── message_loc: (8,4)-(8,5) = "b" + │ │ ├── opening_loc: (8,5)-(8,6) = "(" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (8,6)-(8,7)) + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (8,6)-(8,7)) + │ │ │ └── flags: decimal + │ │ ├── closing_loc: (8,7)-(8,8) = ")" + │ │ ├── block: ∅ + │ │ ├── flags: ∅ + │ │ └── name: "b" + │ ├── @ CallNode (location: (9,2)-(9,11)) + │ │ ├── receiver: + │ │ │ @ CallNode (location: (9,2)-(9,3)) + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── message_loc: (9,2)-(9,3) = "c" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── block: ∅ + │ │ │ ├── flags: variable_call + │ │ │ └── name: "c" + │ │ ├── call_operator_loc: (9,3)-(9,4) = "." + │ │ ├── message_loc: (9,4)-(9,5) = "d" + │ │ ├── opening_loc: (9,5)-(9,6) = "(" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (9,6)-(9,10)) + │ │ │ └── arguments: (length: 2) + │ │ │ ├── @ IntegerNode (location: (9,6)-(9,7)) + │ │ │ │ └── flags: decimal + │ │ │ └── @ IntegerNode (location: (9,9)-(9,10)) + │ │ │ └── flags: decimal + │ │ ├── closing_loc: (9,10)-(9,11) = ")" + │ │ ├── block: ∅ + │ │ ├── flags: ∅ + │ │ └── name: "d" + │ ├── @ CallNode (location: (10,2)-(10,8)) + │ │ ├── receiver: + │ │ │ @ CallNode (location: (10,2)-(10,3)) + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── message_loc: (10,2)-(10,3) = "e" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── block: ∅ + │ │ │ ├── flags: variable_call + │ │ │ └── name: "e" + │ │ ├── call_operator_loc: (10,3)-(10,4) = "." + │ │ ├── message_loc: (10,4)-(10,5) = "f" + │ │ ├── opening_loc: (10,5)-(10,6) = "(" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (10,6)-(10,7)) + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (10,6)-(10,7)) + │ │ │ └── flags: decimal + │ │ ├── closing_loc: (10,7)-(10,8) = ")" + │ │ ├── block: ∅ + │ │ ├── flags: ∅ + │ │ └── name: "f" + │ └── @ CallNode (location: (11,2)-(11,11)) + │ ├── receiver: + │ │ @ CallNode (location: (11,2)-(11,3)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (11,2)-(11,3) = "g" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "g" + │ ├── call_operator_loc: (11,3)-(11,4) = "." + │ ├── message_loc: (11,4)-(11,5) = "h" + │ ├── opening_loc: (11,5)-(11,6) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (11,6)-(11,10)) + │ │ └── arguments: (length: 2) + │ │ ├── @ IntegerNode (location: (11,6)-(11,7)) + │ │ │ └── flags: decimal + │ │ └── @ IntegerNode (location: (11,9)-(11,10)) + │ │ └── flags: decimal + │ ├── closing_loc: (11,10)-(11,11) = ")" + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "h" + ├── consequent: ∅ + └── end_keyword_loc: (12,0)-(12,3) = "end" diff --git a/test/prism/snapshots/seattlerb/difficult1_line_numbers2.txt b/test/prism/snapshots/seattlerb/difficult1_line_numbers2.txt new file mode 100644 index 0000000000..ab8857b6d3 --- /dev/null +++ b/test/prism/snapshots/seattlerb/difficult1_line_numbers2.txt @@ -0,0 +1,73 @@ +@ ProgramNode (location: (1,0)-(7,1)) +├── locals: [:b, :c] +└── statements: + @ StatementsNode (location: (1,0)-(7,1)) + └── body: (length: 2) + ├── @ IfNode (location: (1,0)-(6,3)) + │ ├── if_keyword_loc: (1,0)-(1,2) = "if" + │ ├── predicate: + │ │ @ TrueNode (location: (1,3)-(1,7)) + │ ├── statements: + │ │ @ StatementsNode (location: (2,2)-(5,6)) + │ │ └── body: (length: 4) + │ │ ├── @ CallNode (location: (2,2)-(2,8)) + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── message_loc: (2,2)-(2,3) = "p" + │ │ │ ├── opening_loc: (2,3)-(2,4) = "(" + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (2,4)-(2,7)) + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ StringNode (location: (2,4)-(2,7)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: (2,4)-(2,5) = "\"" + │ │ │ │ ├── content_loc: (2,5)-(2,6) = "a" + │ │ │ │ ├── closing_loc: (2,6)-(2,7) = "\"" + │ │ │ │ └── unescaped: "a" + │ │ │ ├── closing_loc: (2,7)-(2,8) = ")" + │ │ │ ├── block: ∅ + │ │ │ ├── flags: ∅ + │ │ │ └── name: "p" + │ │ ├── @ LocalVariableWriteNode (location: (3,2)-(3,7)) + │ │ │ ├── name: :b + │ │ │ ├── depth: 0 + │ │ │ ├── name_loc: (3,2)-(3,3) = "b" + │ │ │ ├── value: + │ │ │ │ @ IntegerNode (location: (3,6)-(3,7)) + │ │ │ │ └── flags: decimal + │ │ │ └── operator_loc: (3,4)-(3,5) = "=" + │ │ ├── @ CallNode (location: (4,2)-(4,5)) + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── message_loc: (4,2)-(4,3) = "p" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (4,4)-(4,5)) + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ LocalVariableReadNode (location: (4,4)-(4,5)) + │ │ │ │ ├── name: :b + │ │ │ │ └── depth: 0 + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── block: ∅ + │ │ │ ├── flags: ∅ + │ │ │ └── name: "p" + │ │ └── @ LocalVariableWriteNode (location: (5,2)-(5,6)) + │ │ ├── name: :c + │ │ ├── depth: 0 + │ │ ├── name_loc: (5,2)-(5,3) = "c" + │ │ ├── value: + │ │ │ @ IntegerNode (location: (5,5)-(5,6)) + │ │ │ └── flags: decimal + │ │ └── operator_loc: (5,4)-(5,5) = "=" + │ ├── consequent: ∅ + │ └── end_keyword_loc: (6,0)-(6,3) = "end" + └── @ CallNode (location: (7,0)-(7,1)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (7,0)-(7,1) = "a" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: variable_call + └── name: "a" diff --git a/test/prism/snapshots/seattlerb/difficult2_.txt b/test/prism/snapshots/seattlerb/difficult2_.txt new file mode 100644 index 0000000000..6bada8e1be --- /dev/null +++ b/test/prism/snapshots/seattlerb/difficult2_.txt @@ -0,0 +1,66 @@ +@ ProgramNode (location: (1,0)-(2,6)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,6)) + └── body: (length: 2) + ├── @ IfNode (location: (1,0)-(1,13)) + │ ├── if_keyword_loc: ∅ + │ ├── predicate: + │ │ @ IntegerNode (location: (1,0)-(1,1)) + │ │ └── flags: decimal + │ ├── statements: + │ │ @ StatementsNode (location: (1,4)-(1,9)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (1,4)-(1,9)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,4)-(1,5) = "b" + │ │ ├── opening_loc: (1,5)-(1,6) = "(" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (1,6)-(1,8)) + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ StringNode (location: (1,6)-(1,8)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (1,6)-(1,7) = "'" + │ │ │ ├── content_loc: (1,7)-(1,7) = "" + │ │ │ ├── closing_loc: (1,7)-(1,8) = "'" + │ │ │ └── unescaped: "" + │ │ ├── closing_loc: (1,8)-(1,9) = ")" + │ │ ├── block: ∅ + │ │ ├── flags: ∅ + │ │ └── name: "b" + │ ├── consequent: + │ │ @ ElseNode (location: (1,10)-(1,13)) + │ │ ├── else_keyword_loc: (1,10)-(1,11) = ":" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (1,12)-(1,13)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ IntegerNode (location: (1,12)-(1,13)) + │ │ │ └── flags: decimal + │ │ └── end_keyword_loc: ∅ + │ └── end_keyword_loc: ∅ + └── @ CallNode (location: (2,0)-(2,6)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (2,0)-(2,1) = "a" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (2,2)-(2,6)) + │ └── arguments: (length: 1) + │ └── @ KeywordHashNode (location: (2,2)-(2,6)) + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (2,2)-(2,6)) + │ ├── key: + │ │ @ SymbolNode (location: (2,2)-(2,4)) + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (2,2)-(2,3) = "d" + │ │ ├── closing_loc: (2,3)-(2,4) = ":" + │ │ └── unescaped: "d" + │ ├── value: + │ │ @ IntegerNode (location: (2,5)-(2,6)) + │ │ └── flags: decimal + │ └── operator_loc: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "a" diff --git a/test/prism/snapshots/seattlerb/difficult3_.txt b/test/prism/snapshots/seattlerb/difficult3_.txt new file mode 100644 index 0000000000..315602ea1e --- /dev/null +++ b/test/prism/snapshots/seattlerb/difficult3_.txt @@ -0,0 +1,47 @@ +@ ProgramNode (location: (1,0)-(1,18)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,18)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,18)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,18)) + │ ├── locals: [:a, :b, :c] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,16)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,15)) + │ │ │ ├── requireds: (length: 2) + │ │ │ │ ├── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ │ │ └── name: :a + │ │ │ │ └── @ RequiredDestructuredParameterNode (location: (1,8)-(1,15)) + │ │ │ │ ├── parameters: (length: 2) + │ │ │ │ │ ├── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ │ │ │ └── name: :b + │ │ │ │ │ └── @ SplatNode (location: (1,12)-(1,14)) + │ │ │ │ │ ├── operator_loc: (1,12)-(1,13) = "*" + │ │ │ │ │ └── expression: + │ │ │ │ │ @ RequiredParameterNode (location: (1,13)-(1,14)) + │ │ │ │ │ └── name: :c + │ │ │ │ ├── opening_loc: (1,8)-(1,9) = "(" + │ │ │ │ └── closing_loc: (1,14)-(1,15) = ")" + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,15)-(1,16) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,17)-(1,18) = "}" + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/difficult3_2.txt b/test/prism/snapshots/seattlerb/difficult3_2.txt new file mode 100644 index 0000000000..c1ebe5b4cf --- /dev/null +++ b/test/prism/snapshots/seattlerb/difficult3_2.txt @@ -0,0 +1,40 @@ +@ ProgramNode (location: (1,0)-(1,13)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,13)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,13)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,13)) + │ ├── locals: [:a, :b] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,11)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,10)) + │ │ │ ├── requireds: (length: 0) + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: + │ │ │ │ @ RestParameterNode (location: (1,5)-(1,7)) + │ │ │ │ ├── name: :a + │ │ │ │ ├── name_loc: (1,6)-(1,7) = "a" + │ │ │ │ └── operator_loc: (1,5)-(1,6) = "*" + │ │ │ ├── posts: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ │ └── name: :b + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,10)-(1,11) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,12)-(1,13) = "}" + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/difficult3_3.txt b/test/prism/snapshots/seattlerb/difficult3_3.txt new file mode 100644 index 0000000000..46160cc33c --- /dev/null +++ b/test/prism/snapshots/seattlerb/difficult3_3.txt @@ -0,0 +1,44 @@ +@ ProgramNode (location: (1,0)-(1,17)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,17)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,17)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,17)) + │ ├── locals: [:a, :b, :c] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,15)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,14)) + │ │ │ ├── requireds: (length: 0) + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: + │ │ │ │ @ RestParameterNode (location: (1,5)-(1,7)) + │ │ │ │ ├── name: :a + │ │ │ │ ├── name_loc: (1,6)-(1,7) = "a" + │ │ │ │ └── operator_loc: (1,5)-(1,6) = "*" + │ │ │ ├── posts: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ │ └── name: :b + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: + │ │ │ @ BlockParameterNode (location: (1,12)-(1,14)) + │ │ │ ├── name: :c + │ │ │ ├── name_loc: (1,13)-(1,14) = "c" + │ │ │ └── operator_loc: (1,12)-(1,13) = "&" + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,14)-(1,15) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,16)-(1,17) = "}" + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/difficult3_4.txt b/test/prism/snapshots/seattlerb/difficult3_4.txt new file mode 100644 index 0000000000..67fe5715a3 --- /dev/null +++ b/test/prism/snapshots/seattlerb/difficult3_4.txt @@ -0,0 +1,37 @@ +@ ProgramNode (location: (1,0)-(1,17)) +├── locals: [:a] +└── statements: + @ StatementsNode (location: (1,0)-(1,17)) + └── body: (length: 1) + └── @ LocalVariableWriteNode (location: (1,0)-(1,17)) + ├── name: :a + ├── depth: 0 + ├── name_loc: (1,0)-(1,1) = "a" + ├── value: + │ @ IfNode (location: (1,2)-(1,17)) + │ ├── if_keyword_loc: ∅ + │ ├── predicate: + │ │ @ CallNode (location: (1,2)-(1,3)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,2)-(1,3) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "b" + │ ├── statements: + │ │ @ StatementsNode (location: (1,6)-(1,10)) + │ │ └── body: (length: 1) + │ │ └── @ TrueNode (location: (1,6)-(1,10)) + │ ├── consequent: + │ │ @ ElseNode (location: (1,10)-(1,17)) + │ │ ├── else_keyword_loc: (1,10)-(1,11) = ":" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (1,12)-(1,17)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ FalseNode (location: (1,12)-(1,17)) + │ │ └── end_keyword_loc: ∅ + │ └── end_keyword_loc: ∅ + └── operator_loc: (1,1)-(1,2) = "=" diff --git a/test/prism/snapshots/seattlerb/difficult3_5.txt b/test/prism/snapshots/seattlerb/difficult3_5.txt new file mode 100644 index 0000000000..174557dc5e --- /dev/null +++ b/test/prism/snapshots/seattlerb/difficult3_5.txt @@ -0,0 +1,47 @@ +@ ProgramNode (location: (1,0)-(1,19)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,19)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,19)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,19)) + │ └── arguments: (length: 1) + │ └── @ LambdaNode (location: (1,2)-(1,19)) + │ ├── locals: [] + │ ├── operator_loc: (1,2)-(1,4) = "->" + │ ├── opening_loc: (1,7)-(1,8) = "{" + │ ├── closing_loc: (1,18)-(1,19) = "}" + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,6)) + │ │ ├── parameters: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "(" + │ │ └── closing_loc: (1,5)-(1,6) = ")" + │ └── body: + │ @ StatementsNode (location: (1,9)-(1,17)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,9)-(1,17)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,9)-(1,10) = "g" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: + │ │ @ BlockNode (location: (1,11)-(1,17)) + │ │ ├── locals: [] + │ │ ├── parameters: ∅ + │ │ ├── body: ∅ + │ │ ├── opening_loc: (1,11)-(1,13) = "do" + │ │ └── closing_loc: (1,14)-(1,17) = "end" + │ ├── flags: ∅ + │ └── name: "g" + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/difficult3__10.txt b/test/prism/snapshots/seattlerb/difficult3__10.txt new file mode 100644 index 0000000000..c70e73eb86 --- /dev/null +++ b/test/prism/snapshots/seattlerb/difficult3__10.txt @@ -0,0 +1,47 @@ +@ ProgramNode (location: (1,0)-(1,18)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,18)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,18)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,18)) + │ ├── locals: [:a, :b, :c] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,16)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,15)) + │ │ │ ├── requireds: (length: 2) + │ │ │ │ ├── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ │ │ └── name: :a + │ │ │ │ └── @ RequiredDestructuredParameterNode (location: (1,8)-(1,15)) + │ │ │ │ ├── parameters: (length: 2) + │ │ │ │ │ ├── @ SplatNode (location: (1,9)-(1,11)) + │ │ │ │ │ │ ├── operator_loc: (1,9)-(1,10) = "*" + │ │ │ │ │ │ └── expression: + │ │ │ │ │ │ @ RequiredParameterNode (location: (1,10)-(1,11)) + │ │ │ │ │ │ └── name: :b + │ │ │ │ │ └── @ RequiredParameterNode (location: (1,13)-(1,14)) + │ │ │ │ │ └── name: :c + │ │ │ │ ├── opening_loc: (1,8)-(1,9) = "(" + │ │ │ │ └── closing_loc: (1,14)-(1,15) = ")" + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,15)-(1,16) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,17)-(1,18) = "}" + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/difficult3__11.txt b/test/prism/snapshots/seattlerb/difficult3__11.txt new file mode 100644 index 0000000000..6dce592668 --- /dev/null +++ b/test/prism/snapshots/seattlerb/difficult3__11.txt @@ -0,0 +1,43 @@ +@ ProgramNode (location: (1,0)-(1,14)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,14)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,14)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,14)) + │ ├── locals: [:a] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,12)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,11)) + │ │ │ ├── requireds: (length: 2) + │ │ │ │ ├── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ │ │ └── name: :a + │ │ │ │ └── @ RequiredDestructuredParameterNode (location: (1,8)-(1,11)) + │ │ │ │ ├── parameters: (length: 1) + │ │ │ │ │ └── @ SplatNode (location: (1,9)-(1,10)) + │ │ │ │ │ ├── operator_loc: (1,9)-(1,10) = "*" + │ │ │ │ │ └── expression: ∅ + │ │ │ │ ├── opening_loc: (1,8)-(1,9) = "(" + │ │ │ │ └── closing_loc: (1,10)-(1,11) = ")" + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,11)-(1,12) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,13)-(1,14) = "}" + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/difficult3__12.txt b/test/prism/snapshots/seattlerb/difficult3__12.txt new file mode 100644 index 0000000000..67947d6301 --- /dev/null +++ b/test/prism/snapshots/seattlerb/difficult3__12.txt @@ -0,0 +1,45 @@ +@ ProgramNode (location: (1,0)-(1,17)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,17)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,17)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,17)) + │ ├── locals: [:a, :b] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,15)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,14)) + │ │ │ ├── requireds: (length: 2) + │ │ │ │ ├── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ │ │ └── name: :a + │ │ │ │ └── @ RequiredDestructuredParameterNode (location: (1,8)-(1,14)) + │ │ │ │ ├── parameters: (length: 2) + │ │ │ │ │ ├── @ SplatNode (location: (1,9)-(1,10)) + │ │ │ │ │ │ ├── operator_loc: (1,9)-(1,10) = "*" + │ │ │ │ │ │ └── expression: ∅ + │ │ │ │ │ └── @ RequiredParameterNode (location: (1,12)-(1,13)) + │ │ │ │ │ └── name: :b + │ │ │ │ ├── opening_loc: (1,8)-(1,9) = "(" + │ │ │ │ └── closing_loc: (1,13)-(1,14) = ")" + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,14)-(1,15) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,16)-(1,17) = "}" + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/difficult3__6.txt b/test/prism/snapshots/seattlerb/difficult3__6.txt new file mode 100644 index 0000000000..ea05a98bbd --- /dev/null +++ b/test/prism/snapshots/seattlerb/difficult3__6.txt @@ -0,0 +1,49 @@ +@ ProgramNode (location: (1,0)-(1,21)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,21)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,21)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,21)) + │ ├── locals: [:a, :b, :c, :d] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,19)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,18)) + │ │ │ ├── requireds: (length: 2) + │ │ │ │ ├── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ │ │ └── name: :a + │ │ │ │ └── @ RequiredDestructuredParameterNode (location: (1,8)-(1,18)) + │ │ │ │ ├── parameters: (length: 3) + │ │ │ │ │ ├── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ │ │ │ └── name: :b + │ │ │ │ │ ├── @ SplatNode (location: (1,12)-(1,14)) + │ │ │ │ │ │ ├── operator_loc: (1,12)-(1,13) = "*" + │ │ │ │ │ │ └── expression: + │ │ │ │ │ │ @ RequiredParameterNode (location: (1,13)-(1,14)) + │ │ │ │ │ │ └── name: :c + │ │ │ │ │ └── @ RequiredParameterNode (location: (1,16)-(1,17)) + │ │ │ │ │ └── name: :d + │ │ │ │ ├── opening_loc: (1,8)-(1,9) = "(" + │ │ │ │ └── closing_loc: (1,17)-(1,18) = ")" + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,18)-(1,19) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,20)-(1,21) = "}" + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/difficult3__7.txt b/test/prism/snapshots/seattlerb/difficult3__7.txt new file mode 100644 index 0000000000..8c0aa4cf1b --- /dev/null +++ b/test/prism/snapshots/seattlerb/difficult3__7.txt @@ -0,0 +1,45 @@ +@ ProgramNode (location: (1,0)-(1,17)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,17)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,17)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,17)) + │ ├── locals: [:a, :b] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,15)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,14)) + │ │ │ ├── requireds: (length: 2) + │ │ │ │ ├── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ │ │ └── name: :a + │ │ │ │ └── @ RequiredDestructuredParameterNode (location: (1,8)-(1,14)) + │ │ │ │ ├── parameters: (length: 2) + │ │ │ │ │ ├── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ │ │ │ └── name: :b + │ │ │ │ │ └── @ SplatNode (location: (1,12)-(1,13)) + │ │ │ │ │ ├── operator_loc: (1,12)-(1,13) = "*" + │ │ │ │ │ └── expression: ∅ + │ │ │ │ ├── opening_loc: (1,8)-(1,9) = "(" + │ │ │ │ └── closing_loc: (1,13)-(1,14) = ")" + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,14)-(1,15) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,16)-(1,17) = "}" + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/difficult3__8.txt b/test/prism/snapshots/seattlerb/difficult3__8.txt new file mode 100644 index 0000000000..c7e893600c --- /dev/null +++ b/test/prism/snapshots/seattlerb/difficult3__8.txt @@ -0,0 +1,47 @@ +@ ProgramNode (location: (1,0)-(1,20)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,20)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,20)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,20)) + │ ├── locals: [:a, :b, :c] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,18)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,17)) + │ │ │ ├── requireds: (length: 2) + │ │ │ │ ├── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ │ │ └── name: :a + │ │ │ │ └── @ RequiredDestructuredParameterNode (location: (1,8)-(1,17)) + │ │ │ │ ├── parameters: (length: 3) + │ │ │ │ │ ├── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ │ │ │ └── name: :b + │ │ │ │ │ ├── @ SplatNode (location: (1,12)-(1,13)) + │ │ │ │ │ │ ├── operator_loc: (1,12)-(1,13) = "*" + │ │ │ │ │ │ └── expression: ∅ + │ │ │ │ │ └── @ RequiredParameterNode (location: (1,15)-(1,16)) + │ │ │ │ │ └── name: :c + │ │ │ │ ├── opening_loc: (1,8)-(1,9) = "(" + │ │ │ │ └── closing_loc: (1,16)-(1,17) = ")" + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,17)-(1,18) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,19)-(1,20) = "}" + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/difficult3__9.txt b/test/prism/snapshots/seattlerb/difficult3__9.txt new file mode 100644 index 0000000000..5e1c6b1cab --- /dev/null +++ b/test/prism/snapshots/seattlerb/difficult3__9.txt @@ -0,0 +1,45 @@ +@ ProgramNode (location: (1,0)-(1,15)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,15)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,15)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,15)) + │ ├── locals: [:a, :b] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,13)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,12)) + │ │ │ ├── requireds: (length: 2) + │ │ │ │ ├── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ │ │ └── name: :a + │ │ │ │ └── @ RequiredDestructuredParameterNode (location: (1,8)-(1,12)) + │ │ │ │ ├── parameters: (length: 1) + │ │ │ │ │ └── @ SplatNode (location: (1,9)-(1,11)) + │ │ │ │ │ ├── operator_loc: (1,9)-(1,10) = "*" + │ │ │ │ │ └── expression: + │ │ │ │ │ @ RequiredParameterNode (location: (1,10)-(1,11)) + │ │ │ │ │ └── name: :b + │ │ │ │ ├── opening_loc: (1,8)-(1,9) = "(" + │ │ │ │ └── closing_loc: (1,11)-(1,12) = ")" + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,12)-(1,13) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,14)-(1,15) = "}" + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/difficult4__leading_dots.txt b/test/prism/snapshots/seattlerb/difficult4__leading_dots.txt new file mode 100644 index 0000000000..acdb72f84c --- /dev/null +++ b/test/prism/snapshots/seattlerb/difficult4__leading_dots.txt @@ -0,0 +1,25 @@ +@ ProgramNode (location: (1,0)-(2,2)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,2)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(2,2)) + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "a" + ├── call_operator_loc: (2,0)-(2,1) = "." + ├── message_loc: (2,1)-(2,2) = "b" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "b" diff --git a/test/prism/snapshots/seattlerb/difficult4__leading_dots2.txt b/test/prism/snapshots/seattlerb/difficult4__leading_dots2.txt new file mode 100644 index 0000000000..e569fbea1f --- /dev/null +++ b/test/prism/snapshots/seattlerb/difficult4__leading_dots2.txt @@ -0,0 +1,14 @@ +@ ProgramNode (location: (1,0)-(2,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,3)) + └── body: (length: 2) + ├── @ IntegerNode (location: (1,0)-(1,1)) + │ └── flags: decimal + └── @ RangeNode (location: (2,0)-(2,3)) + ├── left: ∅ + ├── right: + │ @ IntegerNode (location: (2,2)-(2,3)) + │ └── flags: decimal + ├── operator_loc: (2,0)-(2,2) = ".." + └── flags: ∅ diff --git a/test/prism/snapshots/seattlerb/difficult6_.txt b/test/prism/snapshots/seattlerb/difficult6_.txt new file mode 100644 index 0000000000..dd12d42c15 --- /dev/null +++ b/test/prism/snapshots/seattlerb/difficult6_.txt @@ -0,0 +1,57 @@ +@ ProgramNode (location: (1,0)-(1,25)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,25)) + └── body: (length: 1) + └── @ LambdaNode (location: (1,0)-(1,25)) + ├── locals: [:a, :b] + ├── operator_loc: (1,0)-(1,2) = "->" + ├── opening_loc: (1,13)-(1,14) = "{" + ├── closing_loc: (1,24)-(1,25) = "}" + ├── parameters: + │ @ BlockParametersNode (location: (1,2)-(1,12)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,3)-(1,11)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,3)-(1,4)) + │ │ │ └── name: :a + │ │ ├── optionals: (length: 1) + │ │ │ └── @ OptionalParameterNode (location: (1,6)-(1,11)) + │ │ │ ├── name: :b + │ │ │ ├── name_loc: (1,6)-(1,7) = "b" + │ │ │ ├── operator_loc: (1,7)-(1,8) = "=" + │ │ │ └── value: + │ │ │ @ NilNode (location: (1,8)-(1,11)) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,2)-(1,3) = "(" + │ └── closing_loc: (1,11)-(1,12) = ")" + └── body: + @ StatementsNode (location: (1,15)-(1,23)) + └── body: (length: 1) + └── @ CallNode (location: (1,15)-(1,23)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,15)-(1,16) = "p" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,17)-(1,23)) + │ └── arguments: (length: 1) + │ └── @ ArrayNode (location: (1,17)-(1,23)) + │ ├── elements: (length: 2) + │ │ ├── @ LocalVariableReadNode (location: (1,18)-(1,19)) + │ │ │ ├── name: :a + │ │ │ └── depth: 0 + │ │ └── @ LocalVariableReadNode (location: (1,21)-(1,22)) + │ │ ├── name: :b + │ │ └── depth: 0 + │ ├── opening_loc: (1,17)-(1,18) = "[" + │ └── closing_loc: (1,22)-(1,23) = "]" + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "p" diff --git a/test/prism/snapshots/seattlerb/difficult6__7.txt b/test/prism/snapshots/seattlerb/difficult6__7.txt new file mode 100644 index 0000000000..2ca623e8e8 --- /dev/null +++ b/test/prism/snapshots/seattlerb/difficult6__7.txt @@ -0,0 +1,53 @@ +@ ProgramNode (location: (1,0)-(1,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,11)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,11)) + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "a" + ├── call_operator_loc: (1,1)-(1,2) = "." + ├── message_loc: (1,2)-(1,3) = "b" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,4)-(1,7)) + │ └── arguments: (length: 1) + │ └── @ ParenthesesNode (location: (1,4)-(1,7)) + │ ├── body: + │ │ @ StatementsNode (location: (1,5)-(1,6)) + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (1,5)-(1,6)) + │ │ └── flags: decimal + │ ├── opening_loc: (1,4)-(1,5) = "(" + │ └── closing_loc: (1,6)-(1,7) = ")" + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,8)-(1,11)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (1,9)-(1,10)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (1,9)-(1,10)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,9)-(1,10) = "c" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "c" + │ ├── opening_loc: (1,8)-(1,9) = "{" + │ └── closing_loc: (1,10)-(1,11) = "}" + ├── flags: ∅ + └── name: "b" diff --git a/test/prism/snapshots/seattlerb/difficult6__8.txt b/test/prism/snapshots/seattlerb/difficult6__8.txt new file mode 100644 index 0000000000..1f7c63ba12 --- /dev/null +++ b/test/prism/snapshots/seattlerb/difficult6__8.txt @@ -0,0 +1,53 @@ +@ ProgramNode (location: (1,0)-(1,12)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,12)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,12)) + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "a" + ├── call_operator_loc: (1,1)-(1,3) = "::" + ├── message_loc: (1,3)-(1,4) = "b" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,5)-(1,8)) + │ └── arguments: (length: 1) + │ └── @ ParenthesesNode (location: (1,5)-(1,8)) + │ ├── body: + │ │ @ StatementsNode (location: (1,6)-(1,7)) + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (1,6)-(1,7)) + │ │ └── flags: decimal + │ ├── opening_loc: (1,5)-(1,6) = "(" + │ └── closing_loc: (1,7)-(1,8) = ")" + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,9)-(1,12)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (1,10)-(1,11)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (1,10)-(1,11)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,10)-(1,11) = "c" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "c" + │ ├── opening_loc: (1,9)-(1,10) = "{" + │ └── closing_loc: (1,11)-(1,12) = "}" + ├── flags: ∅ + └── name: "b" diff --git a/test/prism/snapshots/seattlerb/difficult7_.txt b/test/prism/snapshots/seattlerb/difficult7_.txt new file mode 100644 index 0000000000..e567448bcf --- /dev/null +++ b/test/prism/snapshots/seattlerb/difficult7_.txt @@ -0,0 +1,90 @@ +@ ProgramNode (location: (1,6)-(4,7)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,6)-(4,7)) + └── body: (length: 1) + └── @ HashNode (location: (1,6)-(4,7)) + ├── opening_loc: (1,6)-(1,7) = "{" + ├── elements: (length: 2) + │ ├── @ AssocNode (location: (2,8)-(2,33)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (2,8)-(2,10)) + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (2,8)-(2,9) = "a" + │ │ │ ├── closing_loc: (2,9)-(2,10) = ":" + │ │ │ └── unescaped: "a" + │ │ ├── value: + │ │ │ @ CallNode (location: (2,11)-(2,33)) + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── message_loc: (2,11)-(2,17) = "lambda" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── block: + │ │ │ │ @ BlockNode (location: (2,18)-(2,33)) + │ │ │ │ ├── locals: [] + │ │ │ │ ├── parameters: ∅ + │ │ │ │ ├── body: + │ │ │ │ │ @ StatementsNode (location: (2,20)-(2,31)) + │ │ │ │ │ └── body: (length: 1) + │ │ │ │ │ └── @ IfNode (location: (2,20)-(2,31)) + │ │ │ │ │ ├── if_keyword_loc: ∅ + │ │ │ │ │ ├── predicate: + │ │ │ │ │ │ @ CallNode (location: (2,20)-(2,21)) + │ │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ │ ├── message_loc: (2,20)-(2,21) = "b" + │ │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ │ ├── block: ∅ + │ │ │ │ │ │ ├── flags: variable_call + │ │ │ │ │ │ └── name: "b" + │ │ │ │ │ ├── statements: + │ │ │ │ │ │ @ StatementsNode (location: (2,24)-(2,27)) + │ │ │ │ │ │ └── body: (length: 1) + │ │ │ │ │ │ └── @ CallNode (location: (2,24)-(2,27)) + │ │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ │ ├── message_loc: (2,24)-(2,25) = "c" + │ │ │ │ │ │ ├── opening_loc: (2,25)-(2,26) = "(" + │ │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ │ ├── closing_loc: (2,26)-(2,27) = ")" + │ │ │ │ │ │ ├── block: ∅ + │ │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ │ └── name: "c" + │ │ │ │ │ ├── consequent: + │ │ │ │ │ │ @ ElseNode (location: (2,28)-(2,31)) + │ │ │ │ │ │ ├── else_keyword_loc: (2,28)-(2,29) = ":" + │ │ │ │ │ │ ├── statements: + │ │ │ │ │ │ │ @ StatementsNode (location: (2,30)-(2,31)) + │ │ │ │ │ │ │ └── body: (length: 1) + │ │ │ │ │ │ │ └── @ CallNode (location: (2,30)-(2,31)) + │ │ │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ │ │ ├── message_loc: (2,30)-(2,31) = "d" + │ │ │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ │ │ ├── block: ∅ + │ │ │ │ │ │ │ ├── flags: variable_call + │ │ │ │ │ │ │ └── name: "d" + │ │ │ │ │ │ └── end_keyword_loc: ∅ + │ │ │ │ │ └── end_keyword_loc: ∅ + │ │ │ │ ├── opening_loc: (2,18)-(2,19) = "{" + │ │ │ │ └── closing_loc: (2,32)-(2,33) = "}" + │ │ │ ├── flags: ∅ + │ │ │ └── name: "lambda" + │ │ └── operator_loc: ∅ + │ └── @ AssocNode (location: (3,8)-(3,14)) + │ ├── key: + │ │ @ SymbolNode (location: (3,8)-(3,10)) + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (3,8)-(3,9) = "e" + │ │ ├── closing_loc: (3,9)-(3,10) = ":" + │ │ └── unescaped: "e" + │ ├── value: + │ │ @ NilNode (location: (3,11)-(3,14)) + │ └── operator_loc: ∅ + └── closing_loc: (4,6)-(4,7) = "}" diff --git a/test/prism/snapshots/seattlerb/do_bug.txt b/test/prism/snapshots/seattlerb/do_bug.txt new file mode 100644 index 0000000000..49b3605da3 --- /dev/null +++ b/test/prism/snapshots/seattlerb/do_bug.txt @@ -0,0 +1,60 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 2) + ├── @ CallNode (location: (1,0)-(1,3)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,2)-(1,3)) + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (1,2)-(1,3)) + │ │ └── flags: decimal + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "a" + └── @ CallNode (location: (2,0)-(4,3)) + ├── receiver: + │ @ CallNode (location: (2,0)-(2,1)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (2,0)-(2,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "a" + ├── call_operator_loc: (2,1)-(2,2) = "." + ├── message_loc: (2,2)-(2,3) = "b" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (2,4)-(4,3)) + │ ├── locals: [:c] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (2,7)-(2,10)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (2,8)-(2,9)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (2,8)-(2,9)) + │ │ │ │ └── name: :c + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (2,7)-(2,8) = "|" + │ │ └── closing_loc: (2,9)-(2,10) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (2,4)-(2,6) = "do" + │ └── closing_loc: (4,0)-(4,3) = "end" + ├── flags: ∅ + └── name: "b" diff --git a/test/prism/snapshots/seattlerb/do_lambda.txt b/test/prism/snapshots/seattlerb/do_lambda.txt new file mode 100644 index 0000000000..4713fb3e4b --- /dev/null +++ b/test/prism/snapshots/seattlerb/do_lambda.txt @@ -0,0 +1,17 @@ +@ ProgramNode (location: (1,0)-(1,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,11)) + └── body: (length: 1) + └── @ LambdaNode (location: (1,0)-(1,11)) + ├── locals: [] + ├── operator_loc: (1,0)-(1,2) = "->" + ├── opening_loc: (1,5)-(1,7) = "do" + ├── closing_loc: (1,8)-(1,11) = "end" + ├── parameters: + │ @ BlockParametersNode (location: (1,2)-(1,4)) + │ ├── parameters: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,2)-(1,3) = "(" + │ └── closing_loc: (1,3)-(1,4) = ")" + └── body: ∅ diff --git a/test/prism/snapshots/seattlerb/dot2_nil__26.txt b/test/prism/snapshots/seattlerb/dot2_nil__26.txt new file mode 100644 index 0000000000..6e10c48818 --- /dev/null +++ b/test/prism/snapshots/seattlerb/dot2_nil__26.txt @@ -0,0 +1,20 @@ +@ ProgramNode (location: (1,0)-(1,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,3)) + └── body: (length: 1) + └── @ RangeNode (location: (1,0)-(1,3)) + ├── left: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "a" + ├── right: ∅ + ├── operator_loc: (1,1)-(1,3) = ".." + └── flags: ∅ diff --git a/test/prism/snapshots/seattlerb/dot3_nil__26.txt b/test/prism/snapshots/seattlerb/dot3_nil__26.txt new file mode 100644 index 0000000000..0da36ab471 --- /dev/null +++ b/test/prism/snapshots/seattlerb/dot3_nil__26.txt @@ -0,0 +1,20 @@ +@ ProgramNode (location: (1,0)-(1,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,4)) + └── body: (length: 1) + └── @ RangeNode (location: (1,0)-(1,4)) + ├── left: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "a" + ├── right: ∅ + ├── operator_loc: (1,1)-(1,4) = "..." + └── flags: exclude_end diff --git a/test/prism/snapshots/seattlerb/dstr_evstr.txt b/test/prism/snapshots/seattlerb/dstr_evstr.txt new file mode 100644 index 0000000000..c070c86f96 --- /dev/null +++ b/test/prism/snapshots/seattlerb/dstr_evstr.txt @@ -0,0 +1,37 @@ +@ ProgramNode (location: (1,0)-(1,12)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,12)) + └── body: (length: 1) + └── @ InterpolatedStringNode (location: (1,0)-(1,12)) + ├── opening_loc: (1,0)-(1,1) = "\"" + ├── parts: (length: 2) + │ ├── @ EmbeddedStatementsNode (location: (1,1)-(1,7)) + │ │ ├── opening_loc: (1,1)-(1,3) = "\#{" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (1,3)-(1,6)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ StringNode (location: (1,3)-(1,6)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (1,3)-(1,4) = "'" + │ │ │ ├── content_loc: (1,4)-(1,5) = "a" + │ │ │ ├── closing_loc: (1,5)-(1,6) = "'" + │ │ │ └── unescaped: "a" + │ │ └── closing_loc: (1,6)-(1,7) = "}" + │ └── @ EmbeddedStatementsNode (location: (1,7)-(1,11)) + │ ├── opening_loc: (1,7)-(1,9) = "\#{" + │ ├── statements: + │ │ @ StatementsNode (location: (1,9)-(1,10)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (1,9)-(1,10)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,9)-(1,10) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "b" + │ └── closing_loc: (1,10)-(1,11) = "}" + └── closing_loc: (1,11)-(1,12) = "\"" diff --git a/test/prism/snapshots/seattlerb/dstr_evstr_empty_end.txt b/test/prism/snapshots/seattlerb/dstr_evstr_empty_end.txt new file mode 100644 index 0000000000..a51f7fe994 --- /dev/null +++ b/test/prism/snapshots/seattlerb/dstr_evstr_empty_end.txt @@ -0,0 +1,25 @@ +@ ProgramNode (location: (1,0)-(1,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,11)) + └── body: (length: 1) + └── @ InterpolatedSymbolNode (location: (1,0)-(1,11)) + ├── opening_loc: (1,0)-(1,2) = ":\"" + ├── parts: (length: 1) + │ └── @ EmbeddedStatementsNode (location: (1,2)-(1,10)) + │ ├── opening_loc: (1,2)-(1,4) = "\#{" + │ ├── statements: + │ │ @ StatementsNode (location: (1,4)-(1,9)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (1,4)-(1,9)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,4)-(1,9) = "field" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "field" + │ └── closing_loc: (1,9)-(1,10) = "}" + └── closing_loc: (1,10)-(1,11) = "\"" diff --git a/test/prism/snapshots/seattlerb/dstr_lex_state.txt b/test/prism/snapshots/seattlerb/dstr_lex_state.txt new file mode 100644 index 0000000000..60d9eff91e --- /dev/null +++ b/test/prism/snapshots/seattlerb/dstr_lex_state.txt @@ -0,0 +1,32 @@ +@ ProgramNode (location: (1,0)-(1,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,8)) + └── body: (length: 1) + └── @ InterpolatedStringNode (location: (1,0)-(1,8)) + ├── opening_loc: (1,0)-(1,1) = "\"" + ├── parts: (length: 1) + │ └── @ EmbeddedStatementsNode (location: (1,1)-(1,7)) + │ ├── opening_loc: (1,1)-(1,3) = "\#{" + │ ├── statements: + │ │ @ StatementsNode (location: (1,3)-(1,6)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (1,3)-(1,6)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,3)-(1,4) = "p" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (1,4)-(1,6)) + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ SymbolNode (location: (1,4)-(1,6)) + │ │ │ ├── opening_loc: (1,4)-(1,5) = ":" + │ │ │ ├── value_loc: (1,5)-(1,6) = "a" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a" + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: ∅ + │ │ └── name: "p" + │ └── closing_loc: (1,6)-(1,7) = "}" + └── closing_loc: (1,7)-(1,8) = "\"" diff --git a/test/prism/snapshots/seattlerb/dstr_str.txt b/test/prism/snapshots/seattlerb/dstr_str.txt new file mode 100644 index 0000000000..42bd37a1ac --- /dev/null +++ b/test/prism/snapshots/seattlerb/dstr_str.txt @@ -0,0 +1,27 @@ +@ ProgramNode (location: (1,0)-(1,10)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,10)) + └── body: (length: 1) + └── @ InterpolatedStringNode (location: (1,0)-(1,10)) + ├── opening_loc: (1,0)-(1,1) = "\"" + ├── parts: (length: 2) + │ ├── @ EmbeddedStatementsNode (location: (1,1)-(1,7)) + │ │ ├── opening_loc: (1,1)-(1,3) = "\#{" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (1,3)-(1,6)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ StringNode (location: (1,3)-(1,6)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (1,3)-(1,4) = "'" + │ │ │ ├── content_loc: (1,4)-(1,5) = "a" + │ │ │ ├── closing_loc: (1,5)-(1,6) = "'" + │ │ │ └── unescaped: "a" + │ │ └── closing_loc: (1,6)-(1,7) = "}" + │ └── @ StringNode (location: (1,7)-(1,9)) + │ ├── flags: ∅ + │ ├── opening_loc: ∅ + │ ├── content_loc: (1,7)-(1,9) = " b" + │ ├── closing_loc: ∅ + │ └── unescaped: " b" + └── closing_loc: (1,9)-(1,10) = "\"" diff --git a/test/prism/snapshots/seattlerb/dsym_esc_to_sym.txt b/test/prism/snapshots/seattlerb/dsym_esc_to_sym.txt new file mode 100644 index 0000000000..a52ac4043c --- /dev/null +++ b/test/prism/snapshots/seattlerb/dsym_esc_to_sym.txt @@ -0,0 +1,10 @@ +@ ProgramNode (location: (1,0)-(1,17)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,17)) + └── body: (length: 1) + └── @ SymbolNode (location: (1,0)-(1,17)) + ├── opening_loc: (1,0)-(1,2) = ":\"" + ├── value_loc: (1,2)-(1,16) = "Variet\\303\\240" + ├── closing_loc: (1,16)-(1,17) = "\"" + └── unescaped: "Varietà" diff --git a/test/prism/snapshots/seattlerb/dsym_to_sym.txt b/test/prism/snapshots/seattlerb/dsym_to_sym.txt new file mode 100644 index 0000000000..1d7fcf801f --- /dev/null +++ b/test/prism/snapshots/seattlerb/dsym_to_sym.txt @@ -0,0 +1,33 @@ +@ ProgramNode (location: (1,0)-(3,13)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,13)) + └── body: (length: 2) + ├── @ AliasMethodNode (location: (1,0)-(1,17)) + │ ├── new_name: + │ │ @ SymbolNode (location: (1,6)-(1,11)) + │ │ ├── opening_loc: (1,6)-(1,8) = ":\"" + │ │ ├── value_loc: (1,8)-(1,10) = "<<" + │ │ ├── closing_loc: (1,10)-(1,11) = "\"" + │ │ └── unescaped: "<<" + │ ├── old_name: + │ │ @ SymbolNode (location: (1,12)-(1,17)) + │ │ ├── opening_loc: (1,12)-(1,14) = ":\"" + │ │ ├── value_loc: (1,14)-(1,16) = ">>" + │ │ ├── closing_loc: (1,16)-(1,17) = "\"" + │ │ └── unescaped: ">>" + │ └── keyword_loc: (1,0)-(1,5) = "alias" + └── @ AliasMethodNode (location: (3,0)-(3,13)) + ├── new_name: + │ @ SymbolNode (location: (3,6)-(3,9)) + │ ├── opening_loc: (3,6)-(3,7) = ":" + │ ├── value_loc: (3,7)-(3,9) = "<<" + │ ├── closing_loc: ∅ + │ └── unescaped: "<<" + ├── old_name: + │ @ SymbolNode (location: (3,10)-(3,13)) + │ ├── opening_loc: (3,10)-(3,11) = ":" + │ ├── value_loc: (3,11)-(3,13) = ">>" + │ ├── closing_loc: ∅ + │ └── unescaped: ">>" + └── keyword_loc: (3,0)-(3,5) = "alias" diff --git a/test/prism/snapshots/seattlerb/eq_begin_line_numbers.txt b/test/prism/snapshots/seattlerb/eq_begin_line_numbers.txt new file mode 100644 index 0000000000..1fd43f6166 --- /dev/null +++ b/test/prism/snapshots/seattlerb/eq_begin_line_numbers.txt @@ -0,0 +1,9 @@ +@ ProgramNode (location: (1,0)-(6,1)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(6,1)) + └── body: (length: 2) + ├── @ IntegerNode (location: (1,0)-(1,1)) + │ └── flags: decimal + └── @ IntegerNode (location: (6,0)-(6,1)) + └── flags: decimal diff --git a/test/prism/snapshots/seattlerb/eq_begin_why_wont_people_use_their_spacebar.txt b/test/prism/snapshots/seattlerb/eq_begin_why_wont_people_use_their_spacebar.txt new file mode 100644 index 0000000000..38c745deef --- /dev/null +++ b/test/prism/snapshots/seattlerb/eq_begin_why_wont_people_use_their_spacebar.txt @@ -0,0 +1,48 @@ +@ ProgramNode (location: (1,0)-(3,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,8)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(3,8)) + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,0)-(1,1) = "h" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "h" + ├── call_operator_loc: ∅ + ├── message_loc: (1,1)-(1,4) = "[k]" + ├── opening_loc: (1,1)-(1,2) = "[" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(3,8)) + │ └── arguments: (length: 2) + │ ├── @ CallNode (location: (1,2)-(1,3)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,2)-(1,3) = "k" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "k" + │ └── @ BeginNode (location: (1,5)-(3,8)) + │ ├── begin_keyword_loc: (1,5)-(1,10) = "begin" + │ ├── statements: + │ │ @ StatementsNode (location: (2,7)-(2,9)) + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (2,7)-(2,9)) + │ │ └── flags: decimal + │ ├── rescue_clause: ∅ + │ ├── else_clause: ∅ + │ ├── ensure_clause: ∅ + │ └── end_keyword_loc: (3,5)-(3,8) = "end" + ├── closing_loc: (1,3)-(1,4) = "]" + ├── block: ∅ + ├── flags: ∅ + └── name: "[]=" diff --git a/test/prism/snapshots/seattlerb/evstr_evstr.txt b/test/prism/snapshots/seattlerb/evstr_evstr.txt new file mode 100644 index 0000000000..373f49364e --- /dev/null +++ b/test/prism/snapshots/seattlerb/evstr_evstr.txt @@ -0,0 +1,41 @@ +@ ProgramNode (location: (1,0)-(1,10)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,10)) + └── body: (length: 1) + └── @ InterpolatedStringNode (location: (1,0)-(1,10)) + ├── opening_loc: (1,0)-(1,1) = "\"" + ├── parts: (length: 2) + │ ├── @ EmbeddedStatementsNode (location: (1,1)-(1,5)) + │ │ ├── opening_loc: (1,1)-(1,3) = "\#{" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (1,3)-(1,4)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (1,3)-(1,4)) + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── message_loc: (1,3)-(1,4) = "a" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── block: ∅ + │ │ │ ├── flags: variable_call + │ │ │ └── name: "a" + │ │ └── closing_loc: (1,4)-(1,5) = "}" + │ └── @ EmbeddedStatementsNode (location: (1,5)-(1,9)) + │ ├── opening_loc: (1,5)-(1,7) = "\#{" + │ ├── statements: + │ │ @ StatementsNode (location: (1,7)-(1,8)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (1,7)-(1,8)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,7)-(1,8) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "b" + │ └── closing_loc: (1,8)-(1,9) = "}" + └── closing_loc: (1,9)-(1,10) = "\"" diff --git a/test/prism/snapshots/seattlerb/evstr_str.txt b/test/prism/snapshots/seattlerb/evstr_str.txt new file mode 100644 index 0000000000..196014e307 --- /dev/null +++ b/test/prism/snapshots/seattlerb/evstr_str.txt @@ -0,0 +1,31 @@ +@ ProgramNode (location: (1,0)-(1,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,8)) + └── body: (length: 1) + └── @ InterpolatedStringNode (location: (1,0)-(1,8)) + ├── opening_loc: (1,0)-(1,1) = "\"" + ├── parts: (length: 2) + │ ├── @ EmbeddedStatementsNode (location: (1,1)-(1,5)) + │ │ ├── opening_loc: (1,1)-(1,3) = "\#{" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (1,3)-(1,4)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (1,3)-(1,4)) + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── message_loc: (1,3)-(1,4) = "a" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── block: ∅ + │ │ │ ├── flags: variable_call + │ │ │ └── name: "a" + │ │ └── closing_loc: (1,4)-(1,5) = "}" + │ └── @ StringNode (location: (1,5)-(1,7)) + │ ├── flags: ∅ + │ ├── opening_loc: ∅ + │ ├── content_loc: (1,5)-(1,7) = " b" + │ ├── closing_loc: ∅ + │ └── unescaped: " b" + └── closing_loc: (1,7)-(1,8) = "\"" diff --git a/test/prism/snapshots/seattlerb/expr_not_bang.txt b/test/prism/snapshots/seattlerb/expr_not_bang.txt new file mode 100644 index 0000000000..f9679d8df6 --- /dev/null +++ b/test/prism/snapshots/seattlerb/expr_not_bang.txt @@ -0,0 +1,37 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,5)) + ├── receiver: + │ @ CallNode (location: (1,2)-(1,5)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,2)-(1,3) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,4)-(1,5)) + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (1,4)-(1,5)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,4)-(1,5) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "b" + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "a" + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "!" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "!" diff --git a/test/prism/snapshots/seattlerb/f_kw.txt b/test/prism/snapshots/seattlerb/f_kw.txt new file mode 100644 index 0000000000..cbc29b9c96 --- /dev/null +++ b/test/prism/snapshots/seattlerb/f_kw.txt @@ -0,0 +1,32 @@ +@ ProgramNode (location: (1,0)-(1,15)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,15)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,15)) + ├── name: :x + ├── name_loc: (1,4)-(1,5) = "x" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,6)-(1,10)) + │ ├── requireds: (length: 0) + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 1) + │ │ └── @ KeywordParameterNode (location: (1,6)-(1,10)) + │ │ ├── name: :k + │ │ ├── name_loc: (1,6)-(1,8) = "k:" + │ │ └── value: + │ │ @ IntegerNode (location: (1,8)-(1,10)) + │ │ └── flags: decimal + │ ├── keyword_rest: ∅ + │ └── block: ∅ + ├── body: ∅ + ├── locals: [:k] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── equal_loc: ∅ + └── end_keyword_loc: (1,12)-(1,15) = "end" diff --git a/test/prism/snapshots/seattlerb/f_kw__required.txt b/test/prism/snapshots/seattlerb/f_kw__required.txt new file mode 100644 index 0000000000..16d94d6b46 --- /dev/null +++ b/test/prism/snapshots/seattlerb/f_kw__required.txt @@ -0,0 +1,30 @@ +@ ProgramNode (location: (1,0)-(1,13)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,13)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,13)) + ├── name: :x + ├── name_loc: (1,4)-(1,5) = "x" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,6)-(1,8)) + │ ├── requireds: (length: 0) + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 1) + │ │ └── @ KeywordParameterNode (location: (1,6)-(1,8)) + │ │ ├── name: :k + │ │ ├── name_loc: (1,6)-(1,8) = "k:" + │ │ └── value: ∅ + │ ├── keyword_rest: ∅ + │ └── block: ∅ + ├── body: ∅ + ├── locals: [:k] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── equal_loc: ∅ + └── end_keyword_loc: (1,10)-(1,13) = "end" diff --git a/test/prism/snapshots/seattlerb/flip2_env_lvar.txt b/test/prism/snapshots/seattlerb/flip2_env_lvar.txt new file mode 100644 index 0000000000..1bd74d2b82 --- /dev/null +++ b/test/prism/snapshots/seattlerb/flip2_env_lvar.txt @@ -0,0 +1,36 @@ +@ ProgramNode (location: (1,0)-(1,16)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,16)) + └── body: (length: 1) + └── @ IfNode (location: (1,0)-(1,16)) + ├── if_keyword_loc: (1,0)-(1,2) = "if" + ├── predicate: + │ @ FlipFlopNode (location: (1,3)-(1,7)) + │ ├── left: + │ │ @ CallNode (location: (1,3)-(1,4)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,3)-(1,4) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "a" + │ ├── right: + │ │ @ CallNode (location: (1,6)-(1,7)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,6)-(1,7) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "b" + │ ├── operator_loc: (1,4)-(1,6) = ".." + │ └── flags: ∅ + ├── statements: ∅ + ├── consequent: ∅ + └── end_keyword_loc: (1,13)-(1,16) = "end" diff --git a/test/prism/snapshots/seattlerb/float_with_if_modifier.txt b/test/prism/snapshots/seattlerb/float_with_if_modifier.txt new file mode 100644 index 0000000000..798dba2d05 --- /dev/null +++ b/test/prism/snapshots/seattlerb/float_with_if_modifier.txt @@ -0,0 +1,15 @@ +@ ProgramNode (location: (1,0)-(1,10)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,10)) + └── body: (length: 1) + └── @ IfNode (location: (1,0)-(1,10)) + ├── if_keyword_loc: (1,3)-(1,5) = "if" + ├── predicate: + │ @ TrueNode (location: (1,6)-(1,10)) + ├── statements: + │ @ StatementsNode (location: (1,0)-(1,3)) + │ └── body: (length: 1) + │ └── @ FloatNode (location: (1,0)-(1,3)) + ├── consequent: ∅ + └── end_keyword_loc: ∅ diff --git a/test/prism/snapshots/seattlerb/heredoc__backslash_dos_format.txt b/test/prism/snapshots/seattlerb/heredoc__backslash_dos_format.txt new file mode 100644 index 0000000000..1d8b569dfe --- /dev/null +++ b/test/prism/snapshots/seattlerb/heredoc__backslash_dos_format.txt @@ -0,0 +1,17 @@ +@ ProgramNode (location: (1,0)-(1,12)) +├── locals: [:str] +└── statements: + @ StatementsNode (location: (1,0)-(1,12)) + └── body: (length: 1) + └── @ LocalVariableWriteNode (location: (1,0)-(1,12)) + ├── name: :str + ├── depth: 0 + ├── name_loc: (1,0)-(1,3) = "str" + ├── value: + │ @ StringNode (location: (1,6)-(1,12)) + │ ├── flags: ∅ + │ ├── opening_loc: (1,6)-(1,12) = "<<-XXX" + │ ├── content_loc: (2,0)-(3,0) = "before\\\r\nafter\r\n" + │ ├── closing_loc: (4,0)-(4,0) = "XXX\r\n" + │ └── unescaped: "beforeafter\r\n" + └── operator_loc: (1,4)-(1,5) = "=" diff --git a/test/prism/snapshots/seattlerb/heredoc_backslash_nl.txt b/test/prism/snapshots/seattlerb/heredoc_backslash_nl.txt new file mode 100644 index 0000000000..3f98b7cd43 --- /dev/null +++ b/test/prism/snapshots/seattlerb/heredoc_backslash_nl.txt @@ -0,0 +1,17 @@ +@ ProgramNode (location: (1,0)-(5,7)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(5,7)) + └── body: (length: 2) + ├── @ StringNode (location: (1,0)-(3,1)) + │ ├── flags: ∅ + │ ├── opening_loc: (1,0)-(1,1) = "\"" + │ ├── content_loc: (1,1)-(2,0) = " why would someone do this? \\\n blah\n" + │ ├── closing_loc: (3,0)-(3,1) = "\"" + │ └── unescaped: " why would someone do this? blah\n" + └── @ StringNode (location: (5,0)-(5,7)) + ├── flags: ∅ + ├── opening_loc: (5,0)-(5,7) = "<<-DESC" + ├── content_loc: (6,0)-(7,0) = " why would someone do this? \\\n blah\n" + ├── closing_loc: (8,0)-(8,0) = "DESC\n" + └── unescaped: " why would someone do this? blah\n" diff --git a/test/prism/snapshots/seattlerb/heredoc_bad_hex_escape.txt b/test/prism/snapshots/seattlerb/heredoc_bad_hex_escape.txt new file mode 100644 index 0000000000..29770b2ba3 --- /dev/null +++ b/test/prism/snapshots/seattlerb/heredoc_bad_hex_escape.txt @@ -0,0 +1,17 @@ +@ ProgramNode (location: (1,0)-(1,9)) +├── locals: [:s] +└── statements: + @ StatementsNode (location: (1,0)-(1,9)) + └── body: (length: 1) + └── @ LocalVariableWriteNode (location: (1,0)-(1,9)) + ├── name: :s + ├── depth: 0 + ├── name_loc: (1,0)-(1,1) = "s" + ├── value: + │ @ StringNode (location: (1,4)-(1,9)) + │ ├── flags: ∅ + │ ├── opening_loc: (1,4)-(1,9) = "<<eos" + │ ├── content_loc: (2,0)-(2,0) = "a\\xE9b\n" + │ ├── closing_loc: (3,0)-(3,0) = "eos\n" + │ └── unescaped: "a\xE9b\n" + └── operator_loc: (1,2)-(1,3) = "=" diff --git a/test/prism/snapshots/seattlerb/heredoc_bad_oct_escape.txt b/test/prism/snapshots/seattlerb/heredoc_bad_oct_escape.txt new file mode 100644 index 0000000000..e51b83d922 --- /dev/null +++ b/test/prism/snapshots/seattlerb/heredoc_bad_oct_escape.txt @@ -0,0 +1,17 @@ +@ ProgramNode (location: (1,0)-(1,10)) +├── locals: [:s] +└── statements: + @ StatementsNode (location: (1,0)-(1,10)) + └── body: (length: 1) + └── @ LocalVariableWriteNode (location: (1,0)-(1,10)) + ├── name: :s + ├── depth: 0 + ├── name_loc: (1,0)-(1,1) = "s" + ├── value: + │ @ StringNode (location: (1,4)-(1,10)) + │ ├── flags: ∅ + │ ├── opening_loc: (1,4)-(1,10) = "<<-EOS" + │ ├── content_loc: (2,0)-(3,0) = "a\\247b\ncöd\n" + │ ├── closing_loc: (4,0)-(4,0) = "EOS\n" + │ └── unescaped: "a\xA7b\ncöd\n" + └── operator_loc: (1,2)-(1,3) = "=" diff --git a/test/prism/snapshots/seattlerb/heredoc_comma_arg.txt b/test/prism/snapshots/seattlerb/heredoc_comma_arg.txt new file mode 100644 index 0000000000..007c4308fe --- /dev/null +++ b/test/prism/snapshots/seattlerb/heredoc_comma_arg.txt @@ -0,0 +1,25 @@ +@ ProgramNode (location: (1,0)-(7,1)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(7,1)) + └── body: (length: 2) + ├── @ ArrayNode (location: (1,0)-(2,3)) + │ ├── elements: (length: 1) + │ │ └── @ StringNode (location: (1,1)-(2,1)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (1,1)-(1,2) = "\"" + │ │ ├── content_loc: (1,2)-(1,0) = " some text\n" + │ │ ├── closing_loc: (2,0)-(2,1) = "\"" + │ │ └── unescaped: " some text\n" + │ ├── opening_loc: (1,0)-(1,1) = "[" + │ └── closing_loc: (2,2)-(2,3) = "]" + └── @ ArrayNode (location: (4,0)-(7,1)) + ├── elements: (length: 1) + │ └── @ StringNode (location: (4,1)-(4,8)) + │ ├── flags: ∅ + │ ├── opening_loc: (4,1)-(4,8) = "<<-FILE" + │ ├── content_loc: (5,0)-(5,0) = " some text\n" + │ ├── closing_loc: (6,0)-(6,0) = "FILE\n" + │ └── unescaped: " some text\n" + ├── opening_loc: (4,0)-(4,1) = "[" + └── closing_loc: (7,0)-(7,1) = "]" diff --git a/test/prism/snapshots/seattlerb/heredoc_lineno.txt b/test/prism/snapshots/seattlerb/heredoc_lineno.txt new file mode 100644 index 0000000000..138a6af030 --- /dev/null +++ b/test/prism/snapshots/seattlerb/heredoc_lineno.txt @@ -0,0 +1,25 @@ +@ ProgramNode (location: (1,0)-(7,6)) +├── locals: [:c, :d] +└── statements: + @ StatementsNode (location: (1,0)-(7,6)) + └── body: (length: 2) + ├── @ LocalVariableWriteNode (location: (1,0)-(1,11)) + │ ├── name: :c + │ ├── depth: 0 + │ ├── name_loc: (1,0)-(1,1) = "c" + │ ├── value: + │ │ @ StringNode (location: (1,4)-(1,11)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (1,4)-(1,11) = "<<'CCC'" + │ │ ├── content_loc: (2,0)-(4,0) = "line2\nline3\nline4\n" + │ │ ├── closing_loc: (5,0)-(5,0) = "CCC\n" + │ │ └── unescaped: "line2\nline3\nline4\n" + │ └── operator_loc: (1,2)-(1,3) = "=" + └── @ LocalVariableWriteNode (location: (7,0)-(7,6)) + ├── name: :d + ├── depth: 0 + ├── name_loc: (7,0)-(7,1) = "d" + ├── value: + │ @ IntegerNode (location: (7,4)-(7,6)) + │ └── flags: decimal + └── operator_loc: (7,2)-(7,3) = "=" diff --git a/test/prism/snapshots/seattlerb/heredoc_nested.txt b/test/prism/snapshots/seattlerb/heredoc_nested.txt new file mode 100644 index 0000000000..d46f7253a5 --- /dev/null +++ b/test/prism/snapshots/seattlerb/heredoc_nested.txt @@ -0,0 +1,39 @@ +@ ProgramNode (location: (1,0)-(7,2)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(7,2)) + └── body: (length: 1) + └── @ ArrayNode (location: (1,0)-(7,2)) + ├── elements: (length: 2) + │ ├── @ InterpolatedStringNode (location: (1,1)-(1,4)) + │ │ ├── opening_loc: (1,1)-(1,4) = "<<A" + │ │ ├── parts: (length: 3) + │ │ │ ├── @ EmbeddedStatementsNode (location: (2,0)-(2,6)) + │ │ │ │ ├── opening_loc: (2,0)-(2,2) = "\#{" + │ │ │ │ ├── statements: + │ │ │ │ │ @ StatementsNode (location: (2,2)-(2,5)) + │ │ │ │ │ └── body: (length: 1) + │ │ │ │ │ └── @ StringNode (location: (2,2)-(2,5)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ ├── opening_loc: (2,2)-(2,5) = "<<B" + │ │ │ │ │ ├── content_loc: (3,0)-(3,0) = "b\n" + │ │ │ │ │ ├── closing_loc: (4,0)-(4,0) = "B\n" + │ │ │ │ │ └── unescaped: "b\n" + │ │ │ │ └── closing_loc: (2,5)-(2,6) = "}" + │ │ │ ├── @ StringNode (location: (2,6)-(2,0)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── content_loc: (2,6)-(2,0) = "\n" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "\n" + │ │ │ └── @ StringNode (location: (5,0)-(5,0)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (5,0)-(5,0) = "a\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a\n" + │ │ └── closing_loc: (6,0)-(6,0) = "A\n" + │ └── @ IntegerNode (location: (7,0)-(7,1)) + │ └── flags: decimal + ├── opening_loc: (1,0)-(1,1) = "[" + └── closing_loc: (7,1)-(7,2) = "]" diff --git a/test/prism/snapshots/seattlerb/heredoc_squiggly.txt b/test/prism/snapshots/seattlerb/heredoc_squiggly.txt new file mode 100644 index 0000000000..bc5273e9ac --- /dev/null +++ b/test/prism/snapshots/seattlerb/heredoc_squiggly.txt @@ -0,0 +1,17 @@ +@ ProgramNode (location: (1,0)-(1,12)) +├── locals: [:a] +└── statements: + @ StatementsNode (location: (1,0)-(1,12)) + └── body: (length: 1) + └── @ LocalVariableWriteNode (location: (1,0)-(1,12)) + ├── name: :a + ├── depth: 0 + ├── name_loc: (1,0)-(1,1) = "a" + ├── value: + │ @ StringNode (location: (1,4)-(1,12)) + │ ├── flags: ∅ + │ ├── opening_loc: (1,4)-(1,12) = "<<~\"EOF\"" + │ ├── content_loc: (2,0)-(4,0) = " x\n y\n z\n" + │ ├── closing_loc: (5,0)-(5,0) = " EOF\n" + │ └── unescaped: "x\ny\nz\n" + └── operator_loc: (1,2)-(1,3) = "=" diff --git a/test/prism/snapshots/seattlerb/heredoc_squiggly_blank_line_plus_interpolation.txt b/test/prism/snapshots/seattlerb/heredoc_squiggly_blank_line_plus_interpolation.txt new file mode 100644 index 0000000000..1d6e533151 --- /dev/null +++ b/test/prism/snapshots/seattlerb/heredoc_squiggly_blank_line_plus_interpolation.txt @@ -0,0 +1,65 @@ +@ ProgramNode (location: (1,0)-(1,20)) +├── locals: [:a] +└── statements: + @ StatementsNode (location: (1,0)-(1,20)) + └── body: (length: 1) + └── @ LocalVariableWriteNode (location: (1,0)-(1,20)) + ├── name: :a + ├── depth: 0 + ├── name_loc: (1,0)-(1,1) = "a" + ├── value: + │ @ CallNode (location: (1,4)-(1,20)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,4)-(1,7) = "foo" + │ ├── opening_loc: (1,7)-(1,8) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,8)-(1,19)) + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (1,8)-(1,19)) + │ │ ├── receiver: + │ │ │ @ InterpolatedStringNode (location: (1,8)-(1,14)) + │ │ │ ├── opening_loc: (1,8)-(1,14) = "<<~EOF" + │ │ │ ├── parts: (length: 3) + │ │ │ │ ├── @ StringNode (location: (2,0)-(3,4)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── content_loc: (2,0)-(3,4) = "\n " + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── unescaped: "\n" + │ │ │ │ ├── @ EmbeddedStatementsNode (location: (3,4)-(3,10)) + │ │ │ │ │ ├── opening_loc: (3,4)-(3,6) = "\#{" + │ │ │ │ │ ├── statements: + │ │ │ │ │ │ @ StatementsNode (location: (3,6)-(3,9)) + │ │ │ │ │ │ └── body: (length: 1) + │ │ │ │ │ │ └── @ CallNode (location: (3,6)-(3,9)) + │ │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ │ ├── message_loc: (3,6)-(3,9) = "bar" + │ │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ │ ├── block: ∅ + │ │ │ │ │ │ ├── flags: variable_call + │ │ │ │ │ │ └── name: "bar" + │ │ │ │ │ └── closing_loc: (3,9)-(3,10) = "}" + │ │ │ │ └── @ StringNode (location: (3,10)-(3,0)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── content_loc: (3,10)-(3,0) = "baz\n" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "baz\n" + │ │ │ └── closing_loc: (4,0)-(4,0) = " EOF\n" + │ │ ├── call_operator_loc: (1,14)-(1,15) = "." + │ │ ├── message_loc: (1,15)-(1,19) = "chop" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: ∅ + │ │ └── name: "chop" + │ ├── closing_loc: (1,19)-(1,20) = ")" + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "foo" + └── operator_loc: (1,2)-(1,3) = "=" diff --git a/test/prism/snapshots/seattlerb/heredoc_squiggly_blank_lines.txt b/test/prism/snapshots/seattlerb/heredoc_squiggly_blank_lines.txt new file mode 100644 index 0000000000..8adeee53bf --- /dev/null +++ b/test/prism/snapshots/seattlerb/heredoc_squiggly_blank_lines.txt @@ -0,0 +1,17 @@ +@ ProgramNode (location: (1,0)-(1,10)) +├── locals: [:a] +└── statements: + @ StatementsNode (location: (1,0)-(1,10)) + └── body: (length: 1) + └── @ LocalVariableWriteNode (location: (1,0)-(1,10)) + ├── name: :a + ├── depth: 0 + ├── name_loc: (1,0)-(1,1) = "a" + ├── value: + │ @ StringNode (location: (1,4)-(1,10)) + │ ├── flags: ∅ + │ ├── opening_loc: (1,4)-(1,10) = "<<~EOF" + │ ├── content_loc: (2,0)-(4,0) = " x\n\n z\n" + │ ├── closing_loc: (5,0)-(5,0) = "EOF\n" + │ └── unescaped: "x\n\nz\n" + └── operator_loc: (1,2)-(1,3) = "=" diff --git a/test/prism/snapshots/seattlerb/heredoc_squiggly_empty.txt b/test/prism/snapshots/seattlerb/heredoc_squiggly_empty.txt new file mode 100644 index 0000000000..88049241d3 --- /dev/null +++ b/test/prism/snapshots/seattlerb/heredoc_squiggly_empty.txt @@ -0,0 +1,11 @@ +@ ProgramNode (location: (1,0)-(1,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,4)) + └── body: (length: 1) + └── @ StringNode (location: (1,0)-(1,4)) + ├── flags: ∅ + ├── opening_loc: (1,0)-(1,4) = "<<~A" + ├── content_loc: (2,0)-(1,0) = "" + ├── closing_loc: (2,0)-(2,0) = "A\n" + └── unescaped: "" diff --git a/test/prism/snapshots/seattlerb/heredoc_squiggly_interp.txt b/test/prism/snapshots/seattlerb/heredoc_squiggly_interp.txt new file mode 100644 index 0000000000..620b29591c --- /dev/null +++ b/test/prism/snapshots/seattlerb/heredoc_squiggly_interp.txt @@ -0,0 +1,35 @@ +@ ProgramNode (location: (1,0)-(1,10)) +├── locals: [:a] +└── statements: + @ StatementsNode (location: (1,0)-(1,10)) + └── body: (length: 1) + └── @ LocalVariableWriteNode (location: (1,0)-(1,10)) + ├── name: :a + ├── depth: 0 + ├── name_loc: (1,0)-(1,1) = "a" + ├── value: + │ @ InterpolatedStringNode (location: (1,4)-(1,10)) + │ ├── opening_loc: (1,4)-(1,10) = "<<~EOF" + │ ├── parts: (length: 3) + │ │ ├── @ StringNode (location: (2,0)-(3,3)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (2,0)-(3,3) = " w\n x" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: " w\nx" + │ │ ├── @ EmbeddedStatementsNode (location: (3,3)-(3,8)) + │ │ │ ├── opening_loc: (3,3)-(3,5) = "\#{" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (3,5)-(3,7)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (3,5)-(3,7)) + │ │ │ │ └── flags: decimal + │ │ │ └── closing_loc: (3,7)-(3,8) = "}" + │ │ └── @ StringNode (location: (3,8)-(4,0)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (3,8)-(4,0) = " y\n z\n" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: " y\n z\n" + │ └── closing_loc: (5,0)-(5,0) = " EOF\n" + └── operator_loc: (1,2)-(1,3) = "=" diff --git a/test/prism/snapshots/seattlerb/heredoc_squiggly_no_indent.txt b/test/prism/snapshots/seattlerb/heredoc_squiggly_no_indent.txt new file mode 100644 index 0000000000..b7f67aca7f --- /dev/null +++ b/test/prism/snapshots/seattlerb/heredoc_squiggly_no_indent.txt @@ -0,0 +1,11 @@ +@ ProgramNode (location: (1,0)-(1,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,4)) + └── body: (length: 1) + └── @ StringNode (location: (1,0)-(1,4)) + ├── flags: ∅ + ├── opening_loc: (1,0)-(1,4) = "<<~A" + ├── content_loc: (2,0)-(2,0) = "a\n" + ├── closing_loc: (3,0)-(3,0) = "A\n" + └── unescaped: "a\n" diff --git a/test/prism/snapshots/seattlerb/heredoc_squiggly_tabs.txt b/test/prism/snapshots/seattlerb/heredoc_squiggly_tabs.txt new file mode 100644 index 0000000000..f876ffa456 --- /dev/null +++ b/test/prism/snapshots/seattlerb/heredoc_squiggly_tabs.txt @@ -0,0 +1,17 @@ +@ ProgramNode (location: (1,0)-(1,12)) +├── locals: [:a] +└── statements: + @ StatementsNode (location: (1,0)-(1,12)) + └── body: (length: 1) + └── @ LocalVariableWriteNode (location: (1,0)-(1,12)) + ├── name: :a + ├── depth: 0 + ├── name_loc: (1,0)-(1,1) = "a" + ├── value: + │ @ StringNode (location: (1,4)-(1,12)) + │ ├── flags: ∅ + │ ├── opening_loc: (1,4)-(1,12) = "<<~\"EOF\"" + │ ├── content_loc: (2,0)-(3,0) = " blah blah\n\t blah blah\n" + │ ├── closing_loc: (4,0)-(4,0) = " EOF\n" + │ └── unescaped: "blah blah\n blah blah\n" + └── operator_loc: (1,2)-(1,3) = "=" diff --git a/test/prism/snapshots/seattlerb/heredoc_squiggly_tabs_extra.txt b/test/prism/snapshots/seattlerb/heredoc_squiggly_tabs_extra.txt new file mode 100644 index 0000000000..32a8b64ce4 --- /dev/null +++ b/test/prism/snapshots/seattlerb/heredoc_squiggly_tabs_extra.txt @@ -0,0 +1,17 @@ +@ ProgramNode (location: (1,0)-(1,12)) +├── locals: [:a] +└── statements: + @ StatementsNode (location: (1,0)-(1,12)) + └── body: (length: 1) + └── @ LocalVariableWriteNode (location: (1,0)-(1,12)) + ├── name: :a + ├── depth: 0 + ├── name_loc: (1,0)-(1,1) = "a" + ├── value: + │ @ StringNode (location: (1,4)-(1,12)) + │ ├── flags: ∅ + │ ├── opening_loc: (1,4)-(1,12) = "<<~\"EOF\"" + │ ├── content_loc: (2,0)-(3,0) = " blah blah\n \tblah blah\n" + │ ├── closing_loc: (4,0)-(4,0) = " EOF\n" + │ └── unescaped: "blah blah\n\tblah blah\n" + └── operator_loc: (1,2)-(1,3) = "=" diff --git a/test/prism/snapshots/seattlerb/heredoc_squiggly_visually_blank_lines.txt b/test/prism/snapshots/seattlerb/heredoc_squiggly_visually_blank_lines.txt new file mode 100644 index 0000000000..edf33da732 --- /dev/null +++ b/test/prism/snapshots/seattlerb/heredoc_squiggly_visually_blank_lines.txt @@ -0,0 +1,17 @@ +@ ProgramNode (location: (1,0)-(1,10)) +├── locals: [:a] +└── statements: + @ StatementsNode (location: (1,0)-(1,10)) + └── body: (length: 1) + └── @ LocalVariableWriteNode (location: (1,0)-(1,10)) + ├── name: :a + ├── depth: 0 + ├── name_loc: (1,0)-(1,1) = "a" + ├── value: + │ @ StringNode (location: (1,4)-(1,10)) + │ ├── flags: ∅ + │ ├── opening_loc: (1,4)-(1,10) = "<<~EOF" + │ ├── content_loc: (2,0)-(4,0) = " x\n \n z\n" + │ ├── closing_loc: (5,0)-(5,0) = "EOF\n" + │ └── unescaped: "x\n\nz\n" + └── operator_loc: (1,2)-(1,3) = "=" diff --git a/test/prism/snapshots/seattlerb/heredoc_trailing_slash_continued_call.txt b/test/prism/snapshots/seattlerb/heredoc_trailing_slash_continued_call.txt new file mode 100644 index 0000000000..810031411c --- /dev/null +++ b/test/prism/snapshots/seattlerb/heredoc_trailing_slash_continued_call.txt @@ -0,0 +1,21 @@ +@ ProgramNode (location: (1,0)-(4,6)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,6)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(4,6)) + ├── receiver: + │ @ StringNode (location: (1,0)-(1,5)) + │ ├── flags: ∅ + │ ├── opening_loc: (1,0)-(1,5) = "<<END" + │ ├── content_loc: (2,0)-(2,0) = "blah\n" + │ ├── closing_loc: (3,0)-(3,0) = "END\n" + │ └── unescaped: "blah\n" + ├── call_operator_loc: (4,0)-(4,1) = "." + ├── message_loc: (4,1)-(4,6) = "strip" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "strip" diff --git a/test/prism/snapshots/seattlerb/heredoc_unicode.txt b/test/prism/snapshots/seattlerb/heredoc_unicode.txt new file mode 100644 index 0000000000..cf05249d7d --- /dev/null +++ b/test/prism/snapshots/seattlerb/heredoc_unicode.txt @@ -0,0 +1,11 @@ +@ ProgramNode (location: (1,0)-(1,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,9)) + └── body: (length: 1) + └── @ StringNode (location: (1,0)-(1,9)) + ├── flags: ∅ + ├── opening_loc: (1,0)-(1,9) = "<<OOTPÜT" + ├── content_loc: (2,0)-(2,0) = ".\n" + ├── closing_loc: (3,0)-(3,0) = "OOTPÜT\n" + └── unescaped: ".\n" diff --git a/test/prism/snapshots/seattlerb/heredoc_with_carriage_return_escapes.txt b/test/prism/snapshots/seattlerb/heredoc_with_carriage_return_escapes.txt new file mode 100644 index 0000000000..c2f9bacf34 --- /dev/null +++ b/test/prism/snapshots/seattlerb/heredoc_with_carriage_return_escapes.txt @@ -0,0 +1,11 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ StringNode (location: (1,0)-(1,5)) + ├── flags: ∅ + ├── opening_loc: (1,0)-(1,5) = "<<EOS" + ├── content_loc: (2,0)-(3,0) = "foo\\rbar\nbaz\\r\n" + ├── closing_loc: (4,0)-(4,0) = "EOS\n" + └── unescaped: "foo\rbar\nbaz\r\n" diff --git a/test/prism/snapshots/seattlerb/heredoc_with_carriage_return_escapes_windows.txt b/test/prism/snapshots/seattlerb/heredoc_with_carriage_return_escapes_windows.txt new file mode 100644 index 0000000000..02cbf2d751 --- /dev/null +++ b/test/prism/snapshots/seattlerb/heredoc_with_carriage_return_escapes_windows.txt @@ -0,0 +1,11 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ StringNode (location: (1,0)-(1,5)) + ├── flags: ∅ + ├── opening_loc: (1,0)-(1,5) = "<<EOS" + ├── content_loc: (2,0)-(3,0) = "foo\\rbar\r\nbaz\\r\r\n" + ├── closing_loc: (4,0)-(4,0) = "EOS\r\n" + └── unescaped: "foo\rbar\r\nbaz\r\r\n" diff --git a/test/prism/snapshots/seattlerb/heredoc_with_extra_carriage_horrible_mix.txt b/test/prism/snapshots/seattlerb/heredoc_with_extra_carriage_horrible_mix.txt new file mode 100644 index 0000000000..66e83955b2 --- /dev/null +++ b/test/prism/snapshots/seattlerb/heredoc_with_extra_carriage_horrible_mix.txt @@ -0,0 +1,11 @@ +@ ProgramNode (location: (1,0)-(1,7)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,7)) + └── body: (length: 1) + └── @ StringNode (location: (1,0)-(1,7)) + ├── flags: ∅ + ├── opening_loc: (1,0)-(1,7) = "<<'eot'" + ├── content_loc: (2,0)-(2,0) = "body\r\n" + ├── closing_loc: (3,0)-(3,0) = "eot\n" + └── unescaped: "body\r\n" diff --git a/test/prism/snapshots/seattlerb/heredoc_with_extra_carriage_returns.txt b/test/prism/snapshots/seattlerb/heredoc_with_extra_carriage_returns.txt new file mode 100644 index 0000000000..1873c71d87 --- /dev/null +++ b/test/prism/snapshots/seattlerb/heredoc_with_extra_carriage_returns.txt @@ -0,0 +1,11 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ StringNode (location: (1,0)-(1,5)) + ├── flags: ∅ + ├── opening_loc: (1,0)-(1,5) = "<<EOS" + ├── content_loc: (2,0)-(3,0) = "foo\rbar\r\nbaz\n" + ├── closing_loc: (4,0)-(4,0) = "EOS\n" + └── unescaped: "foo\rbar\r\nbaz\n" diff --git a/test/prism/snapshots/seattlerb/heredoc_with_extra_carriage_returns_windows.txt b/test/prism/snapshots/seattlerb/heredoc_with_extra_carriage_returns_windows.txt new file mode 100644 index 0000000000..9473acb636 --- /dev/null +++ b/test/prism/snapshots/seattlerb/heredoc_with_extra_carriage_returns_windows.txt @@ -0,0 +1,11 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ StringNode (location: (1,0)-(1,5)) + ├── flags: ∅ + ├── opening_loc: (1,0)-(1,5) = "<<EOS" + ├── content_loc: (2,0)-(3,0) = "foo\rbar\r\r\nbaz\r\n" + ├── closing_loc: (4,0)-(4,0) = "EOS\r\n" + └── unescaped: "foo\rbar\r\r\nbaz\r\n" diff --git a/test/prism/snapshots/seattlerb/heredoc_with_interpolation_and_carriage_return_escapes.txt b/test/prism/snapshots/seattlerb/heredoc_with_interpolation_and_carriage_return_escapes.txt new file mode 100644 index 0000000000..af8d5f697d --- /dev/null +++ b/test/prism/snapshots/seattlerb/heredoc_with_interpolation_and_carriage_return_escapes.txt @@ -0,0 +1,26 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ InterpolatedStringNode (location: (1,0)-(1,5)) + ├── opening_loc: (1,0)-(1,5) = "<<EOS" + ├── parts: (length: 3) + │ ├── @ StringNode (location: (2,0)-(2,5)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (2,0)-(2,5) = "foo\\r" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "foo\r" + │ ├── @ EmbeddedVariableNode (location: (2,5)-(2,10)) + │ │ ├── operator_loc: (2,5)-(2,6) = "#" + │ │ └── variable: + │ │ @ InstanceVariableReadNode (location: (2,6)-(2,10)) + │ │ └── name: :@bar + │ └── @ StringNode (location: (2,10)-(2,0)) + │ ├── flags: ∅ + │ ├── opening_loc: ∅ + │ ├── content_loc: (2,10)-(2,0) = "\n" + │ ├── closing_loc: ∅ + │ └── unescaped: "\n" + └── closing_loc: (3,0)-(3,0) = "EOS\n" diff --git a/test/prism/snapshots/seattlerb/heredoc_with_interpolation_and_carriage_return_escapes_windows.txt b/test/prism/snapshots/seattlerb/heredoc_with_interpolation_and_carriage_return_escapes_windows.txt new file mode 100644 index 0000000000..d1b51850a9 --- /dev/null +++ b/test/prism/snapshots/seattlerb/heredoc_with_interpolation_and_carriage_return_escapes_windows.txt @@ -0,0 +1,26 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ InterpolatedStringNode (location: (1,0)-(1,5)) + ├── opening_loc: (1,0)-(1,5) = "<<EOS" + ├── parts: (length: 3) + │ ├── @ StringNode (location: (2,0)-(2,5)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (2,0)-(2,5) = "foo\\r" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "foo\r" + │ ├── @ EmbeddedVariableNode (location: (2,5)-(2,10)) + │ │ ├── operator_loc: (2,5)-(2,6) = "#" + │ │ └── variable: + │ │ @ InstanceVariableReadNode (location: (2,6)-(2,10)) + │ │ └── name: :@bar + │ └── @ StringNode (location: (2,10)-(2,0)) + │ ├── flags: ∅ + │ ├── opening_loc: ∅ + │ ├── content_loc: (2,10)-(2,0) = "\r\n" + │ ├── closing_loc: ∅ + │ └── unescaped: "\r\n" + └── closing_loc: (3,0)-(3,0) = "EOS\r\n" diff --git a/test/prism/snapshots/seattlerb/heredoc_with_not_global_interpolation.txt b/test/prism/snapshots/seattlerb/heredoc_with_not_global_interpolation.txt new file mode 100644 index 0000000000..c656ce4eec --- /dev/null +++ b/test/prism/snapshots/seattlerb/heredoc_with_not_global_interpolation.txt @@ -0,0 +1,11 @@ +@ ProgramNode (location: (1,0)-(1,10)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,10)) + └── body: (length: 1) + └── @ StringNode (location: (1,0)-(1,10)) + ├── flags: ∅ + ├── opening_loc: (1,0)-(1,10) = "<<-HEREDOC" + ├── content_loc: (2,0)-(2,0) = "\#${\n" + ├── closing_loc: (3,0)-(3,0) = "HEREDOC\n" + └── unescaped: "\#${\n" diff --git a/test/prism/snapshots/seattlerb/heredoc_with_only_carriage_returns.txt b/test/prism/snapshots/seattlerb/heredoc_with_only_carriage_returns.txt new file mode 100644 index 0000000000..8043896a9e --- /dev/null +++ b/test/prism/snapshots/seattlerb/heredoc_with_only_carriage_returns.txt @@ -0,0 +1,11 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ StringNode (location: (1,0)-(1,5)) + ├── flags: ∅ + ├── opening_loc: (1,0)-(1,5) = "<<EOS" + ├── content_loc: (2,0)-(4,0) = "\r\n\r\r\n\\r\n" + ├── closing_loc: (5,0)-(5,0) = "EOS\n" + └── unescaped: "\r\n\r\r\n\r\n" diff --git a/test/prism/snapshots/seattlerb/heredoc_with_only_carriage_returns_windows.txt b/test/prism/snapshots/seattlerb/heredoc_with_only_carriage_returns_windows.txt new file mode 100644 index 0000000000..5e62ba4230 --- /dev/null +++ b/test/prism/snapshots/seattlerb/heredoc_with_only_carriage_returns_windows.txt @@ -0,0 +1,11 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ StringNode (location: (1,0)-(1,5)) + ├── flags: ∅ + ├── opening_loc: (1,0)-(1,5) = "<<EOS" + ├── content_loc: (2,0)-(4,0) = "\r\r\n\r\r\r\n\\r\r\n" + ├── closing_loc: (5,0)-(5,0) = "EOS\r\n" + └── unescaped: "\r\r\n\r\r\r\n\r\r\n" diff --git a/test/prism/snapshots/seattlerb/if_elsif.txt b/test/prism/snapshots/seattlerb/if_elsif.txt new file mode 100644 index 0000000000..bc526814a5 --- /dev/null +++ b/test/prism/snapshots/seattlerb/if_elsif.txt @@ -0,0 +1,21 @@ +@ ProgramNode (location: (1,0)-(1,18)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,18)) + └── body: (length: 1) + └── @ IfNode (location: (1,0)-(1,18)) + ├── if_keyword_loc: (1,0)-(1,2) = "if" + ├── predicate: + │ @ IntegerNode (location: (1,3)-(1,4)) + │ └── flags: decimal + ├── statements: ∅ + ├── consequent: + │ @ IfNode (location: (1,6)-(1,18)) + │ ├── if_keyword_loc: (1,6)-(1,11) = "elsif" + │ ├── predicate: + │ │ @ IntegerNode (location: (1,12)-(1,13)) + │ │ └── flags: decimal + │ ├── statements: ∅ + │ ├── consequent: ∅ + │ └── end_keyword_loc: (1,15)-(1,18) = "end" + └── end_keyword_loc: (1,15)-(1,18) = "end" diff --git a/test/prism/snapshots/seattlerb/if_symbol.txt b/test/prism/snapshots/seattlerb/if_symbol.txt new file mode 100644 index 0000000000..050960a0b4 --- /dev/null +++ b/test/prism/snapshots/seattlerb/if_symbol.txt @@ -0,0 +1,28 @@ +@ ProgramNode (location: (1,0)-(1,12)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,12)) + └── body: (length: 1) + └── @ IfNode (location: (1,0)-(1,12)) + ├── if_keyword_loc: (1,0)-(1,2) = "if" + ├── predicate: + │ @ CallNode (location: (1,3)-(1,7)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,3)-(1,4) = "f" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,5)-(1,7)) + │ │ └── arguments: (length: 1) + │ │ └── @ SymbolNode (location: (1,5)-(1,7)) + │ │ ├── opening_loc: (1,5)-(1,6) = ":" + │ │ ├── value_loc: (1,6)-(1,7) = "x" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "x" + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "f" + ├── statements: ∅ + ├── consequent: ∅ + └── end_keyword_loc: (1,9)-(1,12) = "end" diff --git a/test/prism/snapshots/seattlerb/in_expr_no_case.txt b/test/prism/snapshots/seattlerb/in_expr_no_case.txt new file mode 100644 index 0000000000..0a026c08db --- /dev/null +++ b/test/prism/snapshots/seattlerb/in_expr_no_case.txt @@ -0,0 +1,17 @@ +@ ProgramNode (location: (1,0)-(1,16)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,16)) + └── body: (length: 1) + └── @ MatchPredicateNode (location: (1,0)-(1,16)) + ├── value: + │ @ StringNode (location: (1,0)-(1,6)) + │ ├── flags: ∅ + │ ├── opening_loc: (1,0)-(1,1) = "'" + │ ├── content_loc: (1,1)-(1,5) = "woot" + │ ├── closing_loc: (1,5)-(1,6) = "'" + │ └── unescaped: "woot" + ├── pattern: + │ @ ConstantReadNode (location: (1,10)-(1,16)) + │ └── name: :String + └── operator_loc: (1,7)-(1,9) = "in" diff --git a/test/prism/snapshots/seattlerb/index_0.txt b/test/prism/snapshots/seattlerb/index_0.txt new file mode 100644 index 0000000000..6df3611459 --- /dev/null +++ b/test/prism/snapshots/seattlerb/index_0.txt @@ -0,0 +1,37 @@ +@ ProgramNode (location: (1,0)-(1,7)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,7)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,7)) + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "a" + ├── call_operator_loc: ∅ + ├── message_loc: (1,1)-(1,3) = "[]" + ├── opening_loc: (1,1)-(1,2) = "[" + ├── arguments: + │ @ ArgumentsNode (location: (1,6)-(1,7)) + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (1,6)-(1,7)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,6)-(1,7) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "b" + ├── closing_loc: (1,2)-(1,3) = "]" + ├── block: ∅ + ├── flags: ∅ + └── name: "[]=" diff --git a/test/prism/snapshots/seattlerb/index_0_opasgn.txt b/test/prism/snapshots/seattlerb/index_0_opasgn.txt new file mode 100644 index 0000000000..537bcbf219 --- /dev/null +++ b/test/prism/snapshots/seattlerb/index_0_opasgn.txt @@ -0,0 +1,38 @@ +@ ProgramNode (location: (1,0)-(1,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,8)) + └── body: (length: 1) + └── @ CallOperatorWriteNode (location: (1,0)-(1,8)) + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "a" + ├── call_operator_loc: ∅ + ├── message_loc: (1,1)-(1,3) = "[]" + ├── opening_loc: (1,1)-(1,2) = "[" + ├── arguments: ∅ + ├── closing_loc: (1,2)-(1,3) = "]" + ├── flags: ∅ + ├── read_name: "[]" + ├── write_name: "[]=" + ├── operator: :+ + ├── operator_loc: (1,4)-(1,6) = "+=" + └── value: + @ CallNode (location: (1,7)-(1,8)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,7)-(1,8) = "b" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: variable_call + └── name: "b" diff --git a/test/prism/snapshots/seattlerb/integer_with_if_modifier.txt b/test/prism/snapshots/seattlerb/integer_with_if_modifier.txt new file mode 100644 index 0000000000..86632cca13 --- /dev/null +++ b/test/prism/snapshots/seattlerb/integer_with_if_modifier.txt @@ -0,0 +1,16 @@ +@ ProgramNode (location: (1,0)-(1,12)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,12)) + └── body: (length: 1) + └── @ IfNode (location: (1,0)-(1,12)) + ├── if_keyword_loc: (1,5)-(1,7) = "if" + ├── predicate: + │ @ TrueNode (location: (1,8)-(1,12)) + ├── statements: + │ @ StatementsNode (location: (1,0)-(1,5)) + │ └── body: (length: 1) + │ └── @ IntegerNode (location: (1,0)-(1,5)) + │ └── flags: decimal + ├── consequent: ∅ + └── end_keyword_loc: ∅ diff --git a/test/prism/snapshots/seattlerb/interpolated_symbol_array_line_breaks.txt b/test/prism/snapshots/seattlerb/interpolated_symbol_array_line_breaks.txt new file mode 100644 index 0000000000..a64a92ff34 --- /dev/null +++ b/test/prism/snapshots/seattlerb/interpolated_symbol_array_line_breaks.txt @@ -0,0 +1,21 @@ +@ ProgramNode (location: (1,0)-(5,1)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(5,1)) + └── body: (length: 2) + ├── @ ArrayNode (location: (1,0)-(4,1)) + │ ├── elements: (length: 2) + │ │ ├── @ SymbolNode (location: (2,0)-(2,1)) + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (2,0)-(2,1) = "a" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a" + │ │ └── @ SymbolNode (location: (3,0)-(3,1)) + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (3,0)-(3,1) = "b" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "b" + │ ├── opening_loc: (1,0)-(1,3) = "%I(" + │ └── closing_loc: (4,0)-(4,1) = ")" + └── @ IntegerNode (location: (5,0)-(5,1)) + └── flags: decimal diff --git a/test/prism/snapshots/seattlerb/interpolated_word_array_line_breaks.txt b/test/prism/snapshots/seattlerb/interpolated_word_array_line_breaks.txt new file mode 100644 index 0000000000..a9c2463161 --- /dev/null +++ b/test/prism/snapshots/seattlerb/interpolated_word_array_line_breaks.txt @@ -0,0 +1,23 @@ +@ ProgramNode (location: (1,0)-(5,1)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(5,1)) + └── body: (length: 2) + ├── @ ArrayNode (location: (1,0)-(4,1)) + │ ├── elements: (length: 2) + │ │ ├── @ StringNode (location: (2,0)-(2,1)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (2,0)-(2,1) = "a" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a" + │ │ └── @ StringNode (location: (3,0)-(3,1)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (3,0)-(3,1) = "b" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "b" + │ ├── opening_loc: (1,0)-(1,3) = "%W(" + │ └── closing_loc: (4,0)-(4,1) = ")" + └── @ IntegerNode (location: (5,0)-(5,1)) + └── flags: decimal diff --git a/test/prism/snapshots/seattlerb/iter_args_1.txt b/test/prism/snapshots/seattlerb/iter_args_1.txt new file mode 100644 index 0000000000..922c8167ee --- /dev/null +++ b/test/prism/snapshots/seattlerb/iter_args_1.txt @@ -0,0 +1,38 @@ +@ ProgramNode (location: (1,0)-(1,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,11)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,11)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,11)) + │ ├── locals: [:a, :b] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,9)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,8)) + │ │ │ ├── requireds: (length: 2) + │ │ │ │ ├── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ │ │ └── name: :a + │ │ │ │ └── @ RequiredParameterNode (location: (1,7)-(1,8)) + │ │ │ │ └── name: :b + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,8)-(1,9) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,10)-(1,11) = "}" + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/iter_args_10_1.txt b/test/prism/snapshots/seattlerb/iter_args_10_1.txt new file mode 100644 index 0000000000..f883cdc457 --- /dev/null +++ b/test/prism/snapshots/seattlerb/iter_args_10_1.txt @@ -0,0 +1,47 @@ +@ ProgramNode (location: (1,0)-(1,21)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,21)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,21)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,21)) + │ ├── locals: [:a, :b, :c] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,19)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,18)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ │ └── name: :a + │ │ │ ├── optionals: (length: 1) + │ │ │ │ └── @ OptionalParameterNode (location: (1,8)-(1,14)) + │ │ │ │ ├── name: :b + │ │ │ │ ├── name_loc: (1,8)-(1,9) = "b" + │ │ │ │ ├── operator_loc: (1,10)-(1,11) = "=" + │ │ │ │ └── value: + │ │ │ │ @ IntegerNode (location: (1,12)-(1,14)) + │ │ │ │ └── flags: decimal + │ │ │ ├── rest: + │ │ │ │ @ RestParameterNode (location: (1,16)-(1,18)) + │ │ │ │ ├── name: :c + │ │ │ │ ├── name_loc: (1,17)-(1,18) = "c" + │ │ │ │ └── operator_loc: (1,16)-(1,17) = "*" + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,18)-(1,19) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,20)-(1,21) = "}" + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/iter_args_10_2.txt b/test/prism/snapshots/seattlerb/iter_args_10_2.txt new file mode 100644 index 0000000000..9030ccf61a --- /dev/null +++ b/test/prism/snapshots/seattlerb/iter_args_10_2.txt @@ -0,0 +1,51 @@ +@ ProgramNode (location: (1,0)-(1,25)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,25)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,25)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,25)) + │ ├── locals: [:a, :b, :c, :d] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,23)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,22)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ │ └── name: :a + │ │ │ ├── optionals: (length: 1) + │ │ │ │ └── @ OptionalParameterNode (location: (1,8)-(1,14)) + │ │ │ │ ├── name: :b + │ │ │ │ ├── name_loc: (1,8)-(1,9) = "b" + │ │ │ │ ├── operator_loc: (1,10)-(1,11) = "=" + │ │ │ │ └── value: + │ │ │ │ @ IntegerNode (location: (1,12)-(1,14)) + │ │ │ │ └── flags: decimal + │ │ │ ├── rest: + │ │ │ │ @ RestParameterNode (location: (1,16)-(1,18)) + │ │ │ │ ├── name: :c + │ │ │ │ ├── name_loc: (1,17)-(1,18) = "c" + │ │ │ │ └── operator_loc: (1,16)-(1,17) = "*" + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: + │ │ │ @ BlockParameterNode (location: (1,20)-(1,22)) + │ │ │ ├── name: :d + │ │ │ ├── name_loc: (1,21)-(1,22) = "d" + │ │ │ └── operator_loc: (1,20)-(1,21) = "&" + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,22)-(1,23) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,24)-(1,25) = "}" + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/iter_args_11_1.txt b/test/prism/snapshots/seattlerb/iter_args_11_1.txt new file mode 100644 index 0000000000..b9c326d2ed --- /dev/null +++ b/test/prism/snapshots/seattlerb/iter_args_11_1.txt @@ -0,0 +1,49 @@ +@ ProgramNode (location: (1,0)-(1,24)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,24)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,24)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,24)) + │ ├── locals: [:a, :b, :c, :d] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,22)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,21)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ │ └── name: :a + │ │ │ ├── optionals: (length: 1) + │ │ │ │ └── @ OptionalParameterNode (location: (1,8)-(1,14)) + │ │ │ │ ├── name: :b + │ │ │ │ ├── name_loc: (1,8)-(1,9) = "b" + │ │ │ │ ├── operator_loc: (1,10)-(1,11) = "=" + │ │ │ │ └── value: + │ │ │ │ @ IntegerNode (location: (1,12)-(1,14)) + │ │ │ │ └── flags: decimal + │ │ │ ├── rest: + │ │ │ │ @ RestParameterNode (location: (1,16)-(1,18)) + │ │ │ │ ├── name: :c + │ │ │ │ ├── name_loc: (1,17)-(1,18) = "c" + │ │ │ │ └── operator_loc: (1,16)-(1,17) = "*" + │ │ │ ├── posts: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,20)-(1,21)) + │ │ │ │ └── name: :d + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,21)-(1,22) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,23)-(1,24) = "}" + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/iter_args_11_2.txt b/test/prism/snapshots/seattlerb/iter_args_11_2.txt new file mode 100644 index 0000000000..c1dd485bf3 --- /dev/null +++ b/test/prism/snapshots/seattlerb/iter_args_11_2.txt @@ -0,0 +1,53 @@ +@ ProgramNode (location: (1,0)-(1,28)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,28)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,28)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,28)) + │ ├── locals: [:a, :b, :c, :d, :e] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,26)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,25)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ │ └── name: :a + │ │ │ ├── optionals: (length: 1) + │ │ │ │ └── @ OptionalParameterNode (location: (1,8)-(1,14)) + │ │ │ │ ├── name: :b + │ │ │ │ ├── name_loc: (1,8)-(1,9) = "b" + │ │ │ │ ├── operator_loc: (1,10)-(1,11) = "=" + │ │ │ │ └── value: + │ │ │ │ @ IntegerNode (location: (1,12)-(1,14)) + │ │ │ │ └── flags: decimal + │ │ │ ├── rest: + │ │ │ │ @ RestParameterNode (location: (1,16)-(1,18)) + │ │ │ │ ├── name: :c + │ │ │ │ ├── name_loc: (1,17)-(1,18) = "c" + │ │ │ │ └── operator_loc: (1,16)-(1,17) = "*" + │ │ │ ├── posts: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,20)-(1,21)) + │ │ │ │ └── name: :d + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: + │ │ │ @ BlockParameterNode (location: (1,23)-(1,25)) + │ │ │ ├── name: :e + │ │ │ ├── name_loc: (1,24)-(1,25) = "e" + │ │ │ └── operator_loc: (1,23)-(1,24) = "&" + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,25)-(1,26) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,27)-(1,28) = "}" + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/iter_args_2__19.txt b/test/prism/snapshots/seattlerb/iter_args_2__19.txt new file mode 100644 index 0000000000..f6e064ef0f --- /dev/null +++ b/test/prism/snapshots/seattlerb/iter_args_2__19.txt @@ -0,0 +1,42 @@ +@ ProgramNode (location: (1,0)-(1,14)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,14)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,14)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,14)) + │ ├── locals: [:a, :b] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,12)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,11)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredDestructuredParameterNode (location: (1,5)-(1,11)) + │ │ │ │ ├── parameters: (length: 2) + │ │ │ │ │ ├── @ RequiredParameterNode (location: (1,6)-(1,7)) + │ │ │ │ │ │ └── name: :a + │ │ │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ │ │ └── name: :b + │ │ │ │ ├── opening_loc: (1,5)-(1,6) = "(" + │ │ │ │ └── closing_loc: (1,10)-(1,11) = ")" + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,11)-(1,12) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,13)-(1,14) = "}" + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/iter_args_3.txt b/test/prism/snapshots/seattlerb/iter_args_3.txt new file mode 100644 index 0000000000..3b96f8c4ee --- /dev/null +++ b/test/prism/snapshots/seattlerb/iter_args_3.txt @@ -0,0 +1,46 @@ +@ ProgramNode (location: (1,0)-(1,20)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,20)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,20)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,20)) + │ ├── locals: [:a, :b, :c, :d] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,18)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,17)) + │ │ │ ├── requireds: (length: 3) + │ │ │ │ ├── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ │ │ └── name: :a + │ │ │ │ ├── @ RequiredDestructuredParameterNode (location: (1,8)-(1,14)) + │ │ │ │ │ ├── parameters: (length: 2) + │ │ │ │ │ │ ├── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ │ │ │ │ └── name: :b + │ │ │ │ │ │ └── @ RequiredParameterNode (location: (1,12)-(1,13)) + │ │ │ │ │ │ └── name: :c + │ │ │ │ │ ├── opening_loc: (1,8)-(1,9) = "(" + │ │ │ │ │ └── closing_loc: (1,13)-(1,14) = ")" + │ │ │ │ └── @ RequiredParameterNode (location: (1,16)-(1,17)) + │ │ │ │ └── name: :d + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,17)-(1,18) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,19)-(1,20) = "}" + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/iter_args_4.txt b/test/prism/snapshots/seattlerb/iter_args_4.txt new file mode 100644 index 0000000000..a39ce2c671 --- /dev/null +++ b/test/prism/snapshots/seattlerb/iter_args_4.txt @@ -0,0 +1,42 @@ +@ ProgramNode (location: (1,0)-(1,16)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,16)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,16)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,16)) + │ ├── locals: [:a, :b, :c] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,14)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,13)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ │ └── name: :a + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: + │ │ │ │ @ RestParameterNode (location: (1,8)-(1,10)) + │ │ │ │ ├── name: :b + │ │ │ │ ├── name_loc: (1,9)-(1,10) = "b" + │ │ │ │ └── operator_loc: (1,8)-(1,9) = "*" + │ │ │ ├── posts: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,12)-(1,13)) + │ │ │ │ └── name: :c + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,13)-(1,14) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,15)-(1,16) = "}" + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/iter_args_5.txt b/test/prism/snapshots/seattlerb/iter_args_5.txt new file mode 100644 index 0000000000..b97c1d86ec --- /dev/null +++ b/test/prism/snapshots/seattlerb/iter_args_5.txt @@ -0,0 +1,40 @@ +@ ProgramNode (location: (1,0)-(1,13)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,13)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,13)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,13)) + │ ├── locals: [:a, :b] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,11)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,10)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ │ └── name: :a + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: + │ │ │ @ BlockParameterNode (location: (1,8)-(1,10)) + │ │ │ ├── name: :b + │ │ │ ├── name_loc: (1,9)-(1,10) = "b" + │ │ │ └── operator_loc: (1,8)-(1,9) = "&" + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,10)-(1,11) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,12)-(1,13) = "}" + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/iter_args_6.txt b/test/prism/snapshots/seattlerb/iter_args_6.txt new file mode 100644 index 0000000000..d0f81d32c6 --- /dev/null +++ b/test/prism/snapshots/seattlerb/iter_args_6.txt @@ -0,0 +1,45 @@ +@ ProgramNode (location: (1,0)-(1,18)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,18)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,18)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,18)) + │ ├── locals: [:a, :b, :c] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,16)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,15)) + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,5)-(1,6)) + │ │ │ │ └── name: :a + │ │ │ ├── optionals: (length: 1) + │ │ │ │ └── @ OptionalParameterNode (location: (1,8)-(1,12)) + │ │ │ │ ├── name: :b + │ │ │ │ ├── name_loc: (1,8)-(1,9) = "b" + │ │ │ │ ├── operator_loc: (1,9)-(1,10) = "=" + │ │ │ │ └── value: + │ │ │ │ @ IntegerNode (location: (1,10)-(1,12)) + │ │ │ │ └── flags: decimal + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,14)-(1,15)) + │ │ │ │ └── name: :c + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,15)-(1,16) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,17)-(1,18) = "}" + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/iter_args_7_1.txt b/test/prism/snapshots/seattlerb/iter_args_7_1.txt new file mode 100644 index 0000000000..57dc9b5e92 --- /dev/null +++ b/test/prism/snapshots/seattlerb/iter_args_7_1.txt @@ -0,0 +1,45 @@ +@ ProgramNode (location: (1,0)-(1,18)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,18)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,18)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,18)) + │ ├── locals: [:a, :b] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,16)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,15)) + │ │ │ ├── requireds: (length: 0) + │ │ │ ├── optionals: (length: 1) + │ │ │ │ └── @ OptionalParameterNode (location: (1,5)-(1,11)) + │ │ │ │ ├── name: :a + │ │ │ │ ├── name_loc: (1,5)-(1,6) = "a" + │ │ │ │ ├── operator_loc: (1,7)-(1,8) = "=" + │ │ │ │ └── value: + │ │ │ │ @ IntegerNode (location: (1,9)-(1,11)) + │ │ │ │ └── flags: decimal + │ │ │ ├── rest: + │ │ │ │ @ RestParameterNode (location: (1,13)-(1,15)) + │ │ │ │ ├── name: :b + │ │ │ │ ├── name_loc: (1,14)-(1,15) = "b" + │ │ │ │ └── operator_loc: (1,13)-(1,14) = "*" + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,15)-(1,16) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,17)-(1,18) = "}" + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/iter_args_7_2.txt b/test/prism/snapshots/seattlerb/iter_args_7_2.txt new file mode 100644 index 0000000000..7f29777661 --- /dev/null +++ b/test/prism/snapshots/seattlerb/iter_args_7_2.txt @@ -0,0 +1,49 @@ +@ ProgramNode (location: (1,0)-(1,22)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,22)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,22)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,22)) + │ ├── locals: [:a, :b, :c] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,20)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,19)) + │ │ │ ├── requireds: (length: 0) + │ │ │ ├── optionals: (length: 1) + │ │ │ │ └── @ OptionalParameterNode (location: (1,5)-(1,11)) + │ │ │ │ ├── name: :a + │ │ │ │ ├── name_loc: (1,5)-(1,6) = "a" + │ │ │ │ ├── operator_loc: (1,7)-(1,8) = "=" + │ │ │ │ └── value: + │ │ │ │ @ IntegerNode (location: (1,9)-(1,11)) + │ │ │ │ └── flags: decimal + │ │ │ ├── rest: + │ │ │ │ @ RestParameterNode (location: (1,13)-(1,15)) + │ │ │ │ ├── name: :b + │ │ │ │ ├── name_loc: (1,14)-(1,15) = "b" + │ │ │ │ └── operator_loc: (1,13)-(1,14) = "*" + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: + │ │ │ @ BlockParameterNode (location: (1,17)-(1,19)) + │ │ │ ├── name: :c + │ │ │ ├── name_loc: (1,18)-(1,19) = "c" + │ │ │ └── operator_loc: (1,17)-(1,18) = "&" + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,19)-(1,20) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,21)-(1,22) = "}" + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/iter_args_8_1.txt b/test/prism/snapshots/seattlerb/iter_args_8_1.txt new file mode 100644 index 0000000000..d31b1d6c8c --- /dev/null +++ b/test/prism/snapshots/seattlerb/iter_args_8_1.txt @@ -0,0 +1,47 @@ +@ ProgramNode (location: (1,0)-(1,21)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,21)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,21)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,21)) + │ ├── locals: [:a, :b, :c] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,19)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,18)) + │ │ │ ├── requireds: (length: 0) + │ │ │ ├── optionals: (length: 1) + │ │ │ │ └── @ OptionalParameterNode (location: (1,5)-(1,11)) + │ │ │ │ ├── name: :a + │ │ │ │ ├── name_loc: (1,5)-(1,6) = "a" + │ │ │ │ ├── operator_loc: (1,7)-(1,8) = "=" + │ │ │ │ └── value: + │ │ │ │ @ IntegerNode (location: (1,9)-(1,11)) + │ │ │ │ └── flags: decimal + │ │ │ ├── rest: + │ │ │ │ @ RestParameterNode (location: (1,13)-(1,15)) + │ │ │ │ ├── name: :b + │ │ │ │ ├── name_loc: (1,14)-(1,15) = "b" + │ │ │ │ └── operator_loc: (1,13)-(1,14) = "*" + │ │ │ ├── posts: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,17)-(1,18)) + │ │ │ │ └── name: :c + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,18)-(1,19) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,20)-(1,21) = "}" + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/iter_args_8_2.txt b/test/prism/snapshots/seattlerb/iter_args_8_2.txt new file mode 100644 index 0000000000..2c2719ffc7 --- /dev/null +++ b/test/prism/snapshots/seattlerb/iter_args_8_2.txt @@ -0,0 +1,51 @@ +@ ProgramNode (location: (1,0)-(1,25)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,25)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,25)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,25)) + │ ├── locals: [:a, :b, :c, :d] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,23)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,22)) + │ │ │ ├── requireds: (length: 0) + │ │ │ ├── optionals: (length: 1) + │ │ │ │ └── @ OptionalParameterNode (location: (1,5)-(1,11)) + │ │ │ │ ├── name: :a + │ │ │ │ ├── name_loc: (1,5)-(1,6) = "a" + │ │ │ │ ├── operator_loc: (1,7)-(1,8) = "=" + │ │ │ │ └── value: + │ │ │ │ @ IntegerNode (location: (1,9)-(1,11)) + │ │ │ │ └── flags: decimal + │ │ │ ├── rest: + │ │ │ │ @ RestParameterNode (location: (1,13)-(1,15)) + │ │ │ │ ├── name: :b + │ │ │ │ ├── name_loc: (1,14)-(1,15) = "b" + │ │ │ │ └── operator_loc: (1,13)-(1,14) = "*" + │ │ │ ├── posts: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,17)-(1,18)) + │ │ │ │ └── name: :c + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: + │ │ │ @ BlockParameterNode (location: (1,20)-(1,22)) + │ │ │ ├── name: :d + │ │ │ ├── name_loc: (1,21)-(1,22) = "d" + │ │ │ └── operator_loc: (1,20)-(1,21) = "&" + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,22)-(1,23) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,24)-(1,25) = "}" + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/iter_args_9_1.txt b/test/prism/snapshots/seattlerb/iter_args_9_1.txt new file mode 100644 index 0000000000..a04c4da21f --- /dev/null +++ b/test/prism/snapshots/seattlerb/iter_args_9_1.txt @@ -0,0 +1,43 @@ +@ ProgramNode (location: (1,0)-(1,17)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,17)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,17)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,17)) + │ ├── locals: [:a, :b] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,15)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,14)) + │ │ │ ├── requireds: (length: 0) + │ │ │ ├── optionals: (length: 1) + │ │ │ │ └── @ OptionalParameterNode (location: (1,5)-(1,11)) + │ │ │ │ ├── name: :a + │ │ │ │ ├── name_loc: (1,5)-(1,6) = "a" + │ │ │ │ ├── operator_loc: (1,7)-(1,8) = "=" + │ │ │ │ └── value: + │ │ │ │ @ IntegerNode (location: (1,9)-(1,11)) + │ │ │ │ └── flags: decimal + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,13)-(1,14)) + │ │ │ │ └── name: :b + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,14)-(1,15) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,16)-(1,17) = "}" + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/iter_args_9_2.txt b/test/prism/snapshots/seattlerb/iter_args_9_2.txt new file mode 100644 index 0000000000..b9475368a7 --- /dev/null +++ b/test/prism/snapshots/seattlerb/iter_args_9_2.txt @@ -0,0 +1,47 @@ +@ ProgramNode (location: (1,0)-(1,21)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,21)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,21)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,21)) + │ ├── locals: [:a, :b, :c] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,19)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,18)) + │ │ │ ├── requireds: (length: 0) + │ │ │ ├── optionals: (length: 1) + │ │ │ │ └── @ OptionalParameterNode (location: (1,5)-(1,11)) + │ │ │ │ ├── name: :a + │ │ │ │ ├── name_loc: (1,5)-(1,6) = "a" + │ │ │ │ ├── operator_loc: (1,7)-(1,8) = "=" + │ │ │ │ └── value: + │ │ │ │ @ IntegerNode (location: (1,9)-(1,11)) + │ │ │ │ └── flags: decimal + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,13)-(1,14)) + │ │ │ │ └── name: :b + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: + │ │ │ @ BlockParameterNode (location: (1,16)-(1,18)) + │ │ │ ├── name: :c + │ │ │ ├── name_loc: (1,17)-(1,18) = "c" + │ │ │ └── operator_loc: (1,16)-(1,17) = "&" + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,18)-(1,19) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,20)-(1,21) = "}" + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/iter_kwarg.txt b/test/prism/snapshots/seattlerb/iter_kwarg.txt new file mode 100644 index 0000000000..127ce75018 --- /dev/null +++ b/test/prism/snapshots/seattlerb/iter_kwarg.txt @@ -0,0 +1,40 @@ +@ ProgramNode (location: (1,0)-(1,12)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,12)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,12)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,12)) + │ ├── locals: [:b] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,10)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,9)) + │ │ │ ├── requireds: (length: 0) + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 1) + │ │ │ │ └── @ KeywordParameterNode (location: (1,5)-(1,9)) + │ │ │ │ ├── name: :b + │ │ │ │ ├── name_loc: (1,5)-(1,7) = "b:" + │ │ │ │ └── value: + │ │ │ │ @ IntegerNode (location: (1,8)-(1,9)) + │ │ │ │ └── flags: decimal + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,9)-(1,10) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,11)-(1,12) = "}" + ├── flags: ∅ + └── name: "a" diff --git a/test/prism/snapshots/seattlerb/iter_kwarg_kwsplat.txt b/test/prism/snapshots/seattlerb/iter_kwarg_kwsplat.txt new file mode 100644 index 0000000000..ac4ef0a80d --- /dev/null +++ b/test/prism/snapshots/seattlerb/iter_kwarg_kwsplat.txt @@ -0,0 +1,44 @@ +@ ProgramNode (location: (1,0)-(1,17)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,17)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,17)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(1,17)) + │ ├── locals: [:b, :c] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,4)-(1,15)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,5)-(1,14)) + │ │ │ ├── requireds: (length: 0) + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 1) + │ │ │ │ └── @ KeywordParameterNode (location: (1,5)-(1,9)) + │ │ │ │ ├── name: :b + │ │ │ │ ├── name_loc: (1,5)-(1,7) = "b:" + │ │ │ │ └── value: + │ │ │ │ @ IntegerNode (location: (1,8)-(1,9)) + │ │ │ │ └── flags: decimal + │ │ │ ├── keyword_rest: + │ │ │ │ @ KeywordRestParameterNode (location: (1,11)-(1,14)) + │ │ │ │ ├── name: :c + │ │ │ │ ├── name_loc: (1,13)-(1,14) = "c" + │ │ │ │ └── operator_loc: (1,11)-(1,13) = "**" + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,4)-(1,5) = "|" + │ │ └── closing_loc: (1,14)-(1,15) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "{" + │ └── closing_loc: (1,16)-(1,17) = "}" + ├── flags: ∅ + └── name: "a" diff --git a/test/prism/snapshots/seattlerb/label_vs_string.txt b/test/prism/snapshots/seattlerb/label_vs_string.txt new file mode 100644 index 0000000000..bba7782fe6 --- /dev/null +++ b/test/prism/snapshots/seattlerb/label_vs_string.txt @@ -0,0 +1,33 @@ +@ ProgramNode (location: (1,0)-(2,1)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,1)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(2,1)) + ├── receiver: + │ @ CallNode (location: (1,0)-(1,4)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,0)-(1,4) = "_buf" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "_buf" + ├── call_operator_loc: ∅ + ├── message_loc: (1,5)-(1,7) = "<<" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,8)-(2,1)) + │ └── arguments: (length: 1) + │ └── @ StringNode (location: (1,8)-(2,1)) + │ ├── flags: ∅ + │ ├── opening_loc: (1,8)-(1,9) = "'" + │ ├── content_loc: (1,9)-(1,0) = ":\n" + │ ├── closing_loc: (2,0)-(2,1) = "'" + │ └── unescaped: ":\n" + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "<<" diff --git a/test/prism/snapshots/seattlerb/lambda_do_vs_brace.txt b/test/prism/snapshots/seattlerb/lambda_do_vs_brace.txt new file mode 100644 index 0000000000..5762a91ccd --- /dev/null +++ b/test/prism/snapshots/seattlerb/lambda_do_vs_brace.txt @@ -0,0 +1,91 @@ +@ ProgramNode (location: (1,0)-(7,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(7,9)) + └── body: (length: 4) + ├── @ CallNode (location: (1,0)-(1,11)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,0)-(1,1) = "f" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,2)-(1,11)) + │ │ └── arguments: (length: 1) + │ │ └── @ LambdaNode (location: (1,2)-(1,11)) + │ │ ├── locals: [] + │ │ ├── operator_loc: (1,2)-(1,4) = "->" + │ │ ├── opening_loc: (1,5)-(1,7) = "do" + │ │ ├── closing_loc: (1,8)-(1,11) = "end" + │ │ ├── parameters: ∅ + │ │ └── body: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "f" + ├── @ CallNode (location: (3,0)-(3,7)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (3,0)-(3,1) = "f" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (3,2)-(3,7)) + │ │ └── arguments: (length: 1) + │ │ └── @ LambdaNode (location: (3,2)-(3,7)) + │ │ ├── locals: [] + │ │ ├── operator_loc: (3,2)-(3,4) = "->" + │ │ ├── opening_loc: (3,5)-(3,6) = "{" + │ │ ├── closing_loc: (3,6)-(3,7) = "}" + │ │ ├── parameters: ∅ + │ │ └── body: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "f" + ├── @ CallNode (location: (5,0)-(5,13)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (5,0)-(5,1) = "f" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (5,2)-(5,13)) + │ │ └── arguments: (length: 1) + │ │ └── @ LambdaNode (location: (5,2)-(5,13)) + │ │ ├── locals: [] + │ │ ├── operator_loc: (5,2)-(5,4) = "->" + │ │ ├── opening_loc: (5,7)-(5,9) = "do" + │ │ ├── closing_loc: (5,10)-(5,13) = "end" + │ │ ├── parameters: + │ │ │ @ BlockParametersNode (location: (5,4)-(5,6)) + │ │ │ ├── parameters: ∅ + │ │ │ ├── locals: (length: 0) + │ │ │ ├── opening_loc: (5,4)-(5,5) = "(" + │ │ │ └── closing_loc: (5,5)-(5,6) = ")" + │ │ └── body: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "f" + └── @ CallNode (location: (7,0)-(7,9)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (7,0)-(7,1) = "f" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (7,2)-(7,9)) + │ └── arguments: (length: 1) + │ └── @ LambdaNode (location: (7,2)-(7,9)) + │ ├── locals: [] + │ ├── operator_loc: (7,2)-(7,4) = "->" + │ ├── opening_loc: (7,7)-(7,8) = "{" + │ ├── closing_loc: (7,8)-(7,9) = "}" + │ ├── parameters: + │ │ @ BlockParametersNode (location: (7,4)-(7,6)) + │ │ ├── parameters: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (7,4)-(7,5) = "(" + │ │ └── closing_loc: (7,5)-(7,6) = ")" + │ └── body: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/lasgn_arg_rescue_arg.txt b/test/prism/snapshots/seattlerb/lasgn_arg_rescue_arg.txt new file mode 100644 index 0000000000..b1c234bff2 --- /dev/null +++ b/test/prism/snapshots/seattlerb/lasgn_arg_rescue_arg.txt @@ -0,0 +1,19 @@ +@ ProgramNode (location: (1,0)-(1,14)) +├── locals: [:a] +└── statements: + @ StatementsNode (location: (1,0)-(1,14)) + └── body: (length: 1) + └── @ LocalVariableWriteNode (location: (1,0)-(1,14)) + ├── name: :a + ├── depth: 0 + ├── name_loc: (1,0)-(1,1) = "a" + ├── value: + │ @ RescueModifierNode (location: (1,4)-(1,14)) + │ ├── expression: + │ │ @ IntegerNode (location: (1,4)-(1,5)) + │ │ └── flags: decimal + │ ├── keyword_loc: (1,6)-(1,12) = "rescue" + │ └── rescue_expression: + │ @ IntegerNode (location: (1,13)-(1,14)) + │ └── flags: decimal + └── operator_loc: (1,2)-(1,3) = "=" diff --git a/test/prism/snapshots/seattlerb/lasgn_call_bracket_rescue_arg.txt b/test/prism/snapshots/seattlerb/lasgn_call_bracket_rescue_arg.txt new file mode 100644 index 0000000000..36ee85c9d9 --- /dev/null +++ b/test/prism/snapshots/seattlerb/lasgn_call_bracket_rescue_arg.txt @@ -0,0 +1,31 @@ +@ ProgramNode (location: (1,0)-(1,17)) +├── locals: [:a] +└── statements: + @ StatementsNode (location: (1,0)-(1,17)) + └── body: (length: 1) + └── @ LocalVariableWriteNode (location: (1,0)-(1,17)) + ├── name: :a + ├── depth: 0 + ├── name_loc: (1,0)-(1,1) = "a" + ├── value: + │ @ RescueModifierNode (location: (1,4)-(1,17)) + │ ├── expression: + │ │ @ CallNode (location: (1,4)-(1,8)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,4)-(1,5) = "b" + │ │ ├── opening_loc: (1,5)-(1,6) = "(" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (1,6)-(1,7)) + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (1,6)-(1,7)) + │ │ │ └── flags: decimal + │ │ ├── closing_loc: (1,7)-(1,8) = ")" + │ │ ├── block: ∅ + │ │ ├── flags: ∅ + │ │ └── name: "b" + │ ├── keyword_loc: (1,9)-(1,15) = "rescue" + │ └── rescue_expression: + │ @ IntegerNode (location: (1,16)-(1,17)) + │ └── flags: decimal + └── operator_loc: (1,2)-(1,3) = "=" diff --git a/test/prism/snapshots/seattlerb/lasgn_call_nobracket_rescue_arg.txt b/test/prism/snapshots/seattlerb/lasgn_call_nobracket_rescue_arg.txt new file mode 100644 index 0000000000..a1e22f1852 --- /dev/null +++ b/test/prism/snapshots/seattlerb/lasgn_call_nobracket_rescue_arg.txt @@ -0,0 +1,31 @@ +@ ProgramNode (location: (1,0)-(1,16)) +├── locals: [:a] +└── statements: + @ StatementsNode (location: (1,0)-(1,16)) + └── body: (length: 1) + └── @ LocalVariableWriteNode (location: (1,0)-(1,16)) + ├── name: :a + ├── depth: 0 + ├── name_loc: (1,0)-(1,1) = "a" + ├── value: + │ @ CallNode (location: (1,4)-(1,16)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,4)-(1,5) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,6)-(1,16)) + │ │ └── arguments: (length: 1) + │ │ └── @ RescueModifierNode (location: (1,6)-(1,16)) + │ │ ├── expression: + │ │ │ @ IntegerNode (location: (1,6)-(1,7)) + │ │ │ └── flags: decimal + │ │ ├── keyword_loc: (1,8)-(1,14) = "rescue" + │ │ └── rescue_expression: + │ │ @ IntegerNode (location: (1,15)-(1,16)) + │ │ └── flags: decimal + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "b" + └── operator_loc: (1,2)-(1,3) = "=" diff --git a/test/prism/snapshots/seattlerb/lasgn_command.txt b/test/prism/snapshots/seattlerb/lasgn_command.txt new file mode 100644 index 0000000000..30bc60f5bc --- /dev/null +++ b/test/prism/snapshots/seattlerb/lasgn_command.txt @@ -0,0 +1,35 @@ +@ ProgramNode (location: (1,0)-(1,9)) +├── locals: [:a] +└── statements: + @ StatementsNode (location: (1,0)-(1,9)) + └── body: (length: 1) + └── @ LocalVariableWriteNode (location: (1,0)-(1,9)) + ├── name: :a + ├── depth: 0 + ├── name_loc: (1,0)-(1,1) = "a" + ├── value: + │ @ CallNode (location: (1,4)-(1,9)) + │ ├── receiver: + │ │ @ CallNode (location: (1,4)-(1,5)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,4)-(1,5) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "b" + │ ├── call_operator_loc: (1,5)-(1,6) = "." + │ ├── message_loc: (1,6)-(1,7) = "c" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,8)-(1,9)) + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (1,8)-(1,9)) + │ │ └── flags: decimal + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "c" + └── operator_loc: (1,2)-(1,3) = "=" diff --git a/test/prism/snapshots/seattlerb/lasgn_env.txt b/test/prism/snapshots/seattlerb/lasgn_env.txt new file mode 100644 index 0000000000..33539a6918 --- /dev/null +++ b/test/prism/snapshots/seattlerb/lasgn_env.txt @@ -0,0 +1,13 @@ +@ ProgramNode (location: (1,0)-(1,6)) +├── locals: [:a] +└── statements: + @ StatementsNode (location: (1,0)-(1,6)) + └── body: (length: 1) + └── @ LocalVariableWriteNode (location: (1,0)-(1,6)) + ├── name: :a + ├── depth: 0 + ├── name_loc: (1,0)-(1,1) = "a" + ├── value: + │ @ IntegerNode (location: (1,4)-(1,6)) + │ └── flags: decimal + └── operator_loc: (1,2)-(1,3) = "=" diff --git a/test/prism/snapshots/seattlerb/lasgn_ivar_env.txt b/test/prism/snapshots/seattlerb/lasgn_ivar_env.txt new file mode 100644 index 0000000000..e37a331d51 --- /dev/null +++ b/test/prism/snapshots/seattlerb/lasgn_ivar_env.txt @@ -0,0 +1,12 @@ +@ ProgramNode (location: (1,0)-(1,7)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,7)) + └── body: (length: 1) + └── @ InstanceVariableWriteNode (location: (1,0)-(1,7)) + ├── name: :@a + ├── name_loc: (1,0)-(1,2) = "@a" + ├── value: + │ @ IntegerNode (location: (1,5)-(1,7)) + │ └── flags: decimal + └── operator_loc: (1,3)-(1,4) = "=" diff --git a/test/prism/snapshots/seattlerb/lasgn_lasgn_command_call.txt b/test/prism/snapshots/seattlerb/lasgn_lasgn_command_call.txt new file mode 100644 index 0000000000..0056decf76 --- /dev/null +++ b/test/prism/snapshots/seattlerb/lasgn_lasgn_command_call.txt @@ -0,0 +1,31 @@ +@ ProgramNode (location: (1,0)-(1,11)) +├── locals: [:a, :b] +└── statements: + @ StatementsNode (location: (1,0)-(1,11)) + └── body: (length: 1) + └── @ LocalVariableWriteNode (location: (1,0)-(1,11)) + ├── name: :a + ├── depth: 0 + ├── name_loc: (1,0)-(1,1) = "a" + ├── value: + │ @ LocalVariableWriteNode (location: (1,4)-(1,11)) + │ ├── name: :b + │ ├── depth: 0 + │ ├── name_loc: (1,4)-(1,5) = "b" + │ ├── value: + │ │ @ CallNode (location: (1,8)-(1,11)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,8)-(1,9) = "c" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (1,10)-(1,11)) + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (1,10)-(1,11)) + │ │ │ └── flags: decimal + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: ∅ + │ │ └── name: "c" + │ └── operator_loc: (1,6)-(1,7) = "=" + └── operator_loc: (1,2)-(1,3) = "=" diff --git a/test/prism/snapshots/seattlerb/lasgn_middle_splat.txt b/test/prism/snapshots/seattlerb/lasgn_middle_splat.txt new file mode 100644 index 0000000000..c21348bc75 --- /dev/null +++ b/test/prism/snapshots/seattlerb/lasgn_middle_splat.txt @@ -0,0 +1,48 @@ +@ ProgramNode (location: (1,0)-(1,12)) +├── locals: [:a] +└── statements: + @ StatementsNode (location: (1,0)-(1,12)) + └── body: (length: 1) + └── @ LocalVariableWriteNode (location: (1,0)-(1,12)) + ├── name: :a + ├── depth: 0 + ├── name_loc: (1,0)-(1,1) = "a" + ├── value: + │ @ ArrayNode (location: (1,4)-(1,12)) + │ ├── elements: (length: 3) + │ │ ├── @ CallNode (location: (1,4)-(1,5)) + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── message_loc: (1,4)-(1,5) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── block: ∅ + │ │ │ ├── flags: variable_call + │ │ │ └── name: "b" + │ │ ├── @ SplatNode (location: (1,7)-(1,9)) + │ │ │ ├── operator_loc: (1,7)-(1,8) = "*" + │ │ │ └── expression: + │ │ │ @ CallNode (location: (1,8)-(1,9)) + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── message_loc: (1,8)-(1,9) = "c" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── block: ∅ + │ │ │ ├── flags: variable_call + │ │ │ └── name: "c" + │ │ └── @ CallNode (location: (1,11)-(1,12)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,11)-(1,12) = "d" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "d" + │ ├── opening_loc: ∅ + │ └── closing_loc: ∅ + └── operator_loc: (1,2)-(1,3) = "=" diff --git a/test/prism/snapshots/seattlerb/magic_encoding_comment.txt b/test/prism/snapshots/seattlerb/magic_encoding_comment.txt new file mode 100644 index 0000000000..969d318d39 --- /dev/null +++ b/test/prism/snapshots/seattlerb/magic_encoding_comment.txt @@ -0,0 +1,45 @@ +@ ProgramNode (location: (2,0)-(3,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (2,0)-(3,3)) + └── body: (length: 1) + └── @ ClassNode (location: (2,0)-(3,3)) + ├── locals: [] + ├── class_keyword_loc: (2,0)-(2,5) = "class" + ├── constant_path: + │ @ ConstantReadNode (location: (2,6)-(2,34)) + │ └── name: :ExampleUTF8ClassNameVarietà + ├── inheritance_operator_loc: ∅ + ├── superclass: ∅ + ├── body: + │ @ StatementsNode (location: (2,36)-(2,68)) + │ └── body: (length: 1) + │ └── @ DefNode (location: (2,36)-(2,68)) + │ ├── name: :è + │ ├── name_loc: (2,45)-(2,47) = "è" + │ ├── receiver: + │ │ @ SelfNode (location: (2,40)-(2,44)) + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (2,49)-(2,63)) + │ │ └── body: (length: 1) + │ │ └── @ LocalVariableWriteNode (location: (2,49)-(2,63)) + │ │ ├── name: :così + │ │ ├── depth: 0 + │ │ ├── name_loc: (2,49)-(2,54) = "così" + │ │ ├── value: + │ │ │ @ SymbolNode (location: (2,57)-(2,63)) + │ │ │ ├── opening_loc: (2,57)-(2,58) = ":" + │ │ │ ├── value_loc: (2,58)-(2,63) = "però" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "però" + │ │ └── operator_loc: (2,55)-(2,56) = "=" + │ ├── locals: [:così] + │ ├── def_keyword_loc: (2,36)-(2,39) = "def" + │ ├── operator_loc: (2,44)-(2,45) = "." + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (2,65)-(2,68) = "end" + ├── end_keyword_loc: (3,0)-(3,3) = "end" + └── name: :ExampleUTF8ClassNameVarietà diff --git a/test/prism/snapshots/seattlerb/masgn_anon_splat_arg.txt b/test/prism/snapshots/seattlerb/masgn_anon_splat_arg.txt new file mode 100644 index 0000000000..3b0ff6e998 --- /dev/null +++ b/test/prism/snapshots/seattlerb/masgn_anon_splat_arg.txt @@ -0,0 +1,31 @@ +@ ProgramNode (location: (1,0)-(1,8)) +├── locals: [:a] +└── statements: + @ StatementsNode (location: (1,0)-(1,8)) + └── body: (length: 1) + └── @ MultiWriteNode (location: (1,0)-(1,8)) + ├── targets: (length: 2) + │ ├── @ MultiTargetNode (location: (1,0)-(1,1)) + │ │ ├── targets: (length: 1) + │ │ │ └── @ SplatNode (location: (1,0)-(1,1)) + │ │ │ ├── operator_loc: (1,0)-(1,1) = "*" + │ │ │ └── expression: ∅ + │ │ ├── lparen_loc: ∅ + │ │ └── rparen_loc: ∅ + │ └── @ LocalVariableTargetNode (location: (1,3)-(1,4)) + │ ├── name: :a + │ └── depth: 0 + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── operator_loc: (1,5)-(1,6) = "=" + └── value: + @ CallNode (location: (1,7)-(1,8)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,7)-(1,8) = "b" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: variable_call + └── name: "b" diff --git a/test/prism/snapshots/seattlerb/masgn_arg_colon_arg.txt b/test/prism/snapshots/seattlerb/masgn_arg_colon_arg.txt new file mode 100644 index 0000000000..c09d215438 --- /dev/null +++ b/test/prism/snapshots/seattlerb/masgn_arg_colon_arg.txt @@ -0,0 +1,44 @@ +@ ProgramNode (location: (1,0)-(1,11)) +├── locals: [:a] +└── statements: + @ StatementsNode (location: (1,0)-(1,11)) + └── body: (length: 1) + └── @ MultiWriteNode (location: (1,0)-(1,11)) + ├── targets: (length: 2) + │ ├── @ LocalVariableTargetNode (location: (1,0)-(1,1)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ └── @ CallNode (location: (1,3)-(1,7)) + │ ├── receiver: + │ │ @ CallNode (location: (1,3)-(1,4)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,3)-(1,4) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "b" + │ ├── call_operator_loc: (1,4)-(1,6) = "::" + │ ├── message_loc: (1,6)-(1,7) = "c" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "c=" + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── operator_loc: (1,8)-(1,9) = "=" + └── value: + @ CallNode (location: (1,10)-(1,11)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,10)-(1,11) = "d" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: variable_call + └── name: "d" diff --git a/test/prism/snapshots/seattlerb/masgn_arg_ident.txt b/test/prism/snapshots/seattlerb/masgn_arg_ident.txt new file mode 100644 index 0000000000..670540bb20 --- /dev/null +++ b/test/prism/snapshots/seattlerb/masgn_arg_ident.txt @@ -0,0 +1,44 @@ +@ ProgramNode (location: (1,0)-(1,10)) +├── locals: [:a] +└── statements: + @ StatementsNode (location: (1,0)-(1,10)) + └── body: (length: 1) + └── @ MultiWriteNode (location: (1,0)-(1,10)) + ├── targets: (length: 2) + │ ├── @ LocalVariableTargetNode (location: (1,0)-(1,1)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ └── @ CallNode (location: (1,3)-(1,6)) + │ ├── receiver: + │ │ @ CallNode (location: (1,3)-(1,4)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,3)-(1,4) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "b" + │ ├── call_operator_loc: (1,4)-(1,5) = "." + │ ├── message_loc: (1,5)-(1,6) = "C" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "C=" + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── operator_loc: (1,7)-(1,8) = "=" + └── value: + @ CallNode (location: (1,9)-(1,10)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,9)-(1,10) = "d" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: variable_call + └── name: "d" diff --git a/test/prism/snapshots/seattlerb/masgn_arg_splat_arg.txt b/test/prism/snapshots/seattlerb/masgn_arg_splat_arg.txt new file mode 100644 index 0000000000..c0849099cd --- /dev/null +++ b/test/prism/snapshots/seattlerb/masgn_arg_splat_arg.txt @@ -0,0 +1,33 @@ +@ ProgramNode (location: (1,0)-(1,12)) +├── locals: [:a, :b, :c] +└── statements: + @ StatementsNode (location: (1,0)-(1,12)) + └── body: (length: 1) + └── @ MultiWriteNode (location: (1,0)-(1,12)) + ├── targets: (length: 3) + │ ├── @ LocalVariableTargetNode (location: (1,0)-(1,1)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ ├── @ SplatNode (location: (1,3)-(1,5)) + │ │ ├── operator_loc: (1,3)-(1,4) = "*" + │ │ └── expression: + │ │ @ LocalVariableTargetNode (location: (1,4)-(1,5)) + │ │ ├── name: :b + │ │ └── depth: 0 + │ └── @ LocalVariableTargetNode (location: (1,7)-(1,8)) + │ ├── name: :c + │ └── depth: 0 + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── operator_loc: (1,9)-(1,10) = "=" + └── value: + @ CallNode (location: (1,11)-(1,12)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,11)-(1,12) = "d" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: variable_call + └── name: "d" diff --git a/test/prism/snapshots/seattlerb/masgn_colon2.txt b/test/prism/snapshots/seattlerb/masgn_colon2.txt new file mode 100644 index 0000000000..01cf2320fc --- /dev/null +++ b/test/prism/snapshots/seattlerb/masgn_colon2.txt @@ -0,0 +1,38 @@ +@ ProgramNode (location: (1,0)-(1,14)) +├── locals: [:a] +└── statements: + @ StatementsNode (location: (1,0)-(1,14)) + └── body: (length: 1) + └── @ MultiWriteNode (location: (1,0)-(1,14)) + ├── targets: (length: 2) + │ ├── @ LocalVariableTargetNode (location: (1,0)-(1,1)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ └── @ ConstantPathTargetNode (location: (1,3)-(1,7)) + │ ├── parent: + │ │ @ CallNode (location: (1,3)-(1,4)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,3)-(1,4) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "b" + │ ├── child: + │ │ @ ConstantReadNode (location: (1,6)-(1,7)) + │ │ └── name: :C + │ └── delimiter_loc: (1,4)-(1,6) = "::" + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── operator_loc: (1,8)-(1,9) = "=" + └── value: + @ ArrayNode (location: (1,10)-(1,14)) + ├── elements: (length: 2) + │ ├── @ IntegerNode (location: (1,10)-(1,11)) + │ │ └── flags: decimal + │ └── @ IntegerNode (location: (1,13)-(1,14)) + │ └── flags: decimal + ├── opening_loc: ∅ + └── closing_loc: ∅ diff --git a/test/prism/snapshots/seattlerb/masgn_colon3.txt b/test/prism/snapshots/seattlerb/masgn_colon3.txt new file mode 100644 index 0000000000..1c97b15d23 --- /dev/null +++ b/test/prism/snapshots/seattlerb/masgn_colon3.txt @@ -0,0 +1,31 @@ +@ ProgramNode (location: (1,0)-(1,15)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,15)) + └── body: (length: 1) + └── @ MultiWriteNode (location: (1,0)-(1,15)) + ├── targets: (length: 2) + │ ├── @ ConstantPathTargetNode (location: (1,0)-(1,3)) + │ │ ├── parent: ∅ + │ │ ├── child: + │ │ │ @ ConstantReadNode (location: (1,2)-(1,3)) + │ │ │ └── name: :A + │ │ └── delimiter_loc: (1,0)-(1,2) = "::" + │ └── @ ConstantPathTargetNode (location: (1,5)-(1,8)) + │ ├── parent: ∅ + │ ├── child: + │ │ @ ConstantReadNode (location: (1,7)-(1,8)) + │ │ └── name: :B + │ └── delimiter_loc: (1,5)-(1,7) = "::" + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── operator_loc: (1,9)-(1,10) = "=" + └── value: + @ ArrayNode (location: (1,11)-(1,15)) + ├── elements: (length: 2) + │ ├── @ IntegerNode (location: (1,11)-(1,12)) + │ │ └── flags: decimal + │ └── @ IntegerNode (location: (1,14)-(1,15)) + │ └── flags: decimal + ├── opening_loc: ∅ + └── closing_loc: ∅ diff --git a/test/prism/snapshots/seattlerb/masgn_command_call.txt b/test/prism/snapshots/seattlerb/masgn_command_call.txt new file mode 100644 index 0000000000..becf774546 --- /dev/null +++ b/test/prism/snapshots/seattlerb/masgn_command_call.txt @@ -0,0 +1,41 @@ +@ ProgramNode (location: (1,0)-(1,10)) +├── locals: [:a] +└── statements: + @ StatementsNode (location: (1,0)-(1,10)) + └── body: (length: 1) + └── @ MultiWriteNode (location: (1,0)-(1,10)) + ├── targets: (length: 2) + │ ├── @ LocalVariableTargetNode (location: (1,0)-(1,1)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ └── @ SplatNode (location: (1,1)-(1,2)) + │ ├── operator_loc: (1,1)-(1,2) = "," + │ └── expression: ∅ + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── operator_loc: (1,3)-(1,4) = "=" + └── value: + @ CallNode (location: (1,5)-(1,10)) + ├── receiver: + │ @ CallNode (location: (1,5)-(1,6)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,5)-(1,6) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "b" + ├── call_operator_loc: (1,6)-(1,7) = "." + ├── message_loc: (1,7)-(1,8) = "c" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,9)-(1,10)) + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,9)-(1,10)) + │ └── flags: decimal + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "c" diff --git a/test/prism/snapshots/seattlerb/masgn_double_paren.txt b/test/prism/snapshots/seattlerb/masgn_double_paren.txt new file mode 100644 index 0000000000..3dfb782975 --- /dev/null +++ b/test/prism/snapshots/seattlerb/masgn_double_paren.txt @@ -0,0 +1,31 @@ +@ ProgramNode (location: (1,0)-(1,9)) +├── locals: [:a, :b] +└── statements: + @ StatementsNode (location: (1,0)-(1,9)) + └── body: (length: 1) + └── @ MultiWriteNode (location: (1,0)-(1,9)) + ├── targets: (length: 1) + │ └── @ MultiTargetNode (location: (1,1)-(1,6)) + │ ├── targets: (length: 2) + │ │ ├── @ LocalVariableTargetNode (location: (1,2)-(1,3)) + │ │ │ ├── name: :a + │ │ │ └── depth: 0 + │ │ └── @ LocalVariableTargetNode (location: (1,4)-(1,5)) + │ │ ├── name: :b + │ │ └── depth: 0 + │ ├── lparen_loc: (1,1)-(1,2) = "(" + │ └── rparen_loc: (1,5)-(1,6) = ")" + ├── lparen_loc: (1,0)-(1,1) = "(" + ├── rparen_loc: (1,6)-(1,7) = ")" + ├── operator_loc: (1,7)-(1,8) = "=" + └── value: + @ CallNode (location: (1,8)-(1,9)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,8)-(1,9) = "c" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: variable_call + └── name: "c" diff --git a/test/prism/snapshots/seattlerb/masgn_lhs_splat.txt b/test/prism/snapshots/seattlerb/masgn_lhs_splat.txt new file mode 100644 index 0000000000..49b717143b --- /dev/null +++ b/test/prism/snapshots/seattlerb/masgn_lhs_splat.txt @@ -0,0 +1,27 @@ +@ ProgramNode (location: (1,0)-(1,12)) +├── locals: [:a] +└── statements: + @ StatementsNode (location: (1,0)-(1,12)) + └── body: (length: 1) + └── @ MultiWriteNode (location: (1,0)-(1,12)) + ├── targets: (length: 1) + │ └── @ SplatNode (location: (1,0)-(1,2)) + │ ├── operator_loc: (1,0)-(1,1) = "*" + │ └── expression: + │ @ LocalVariableTargetNode (location: (1,1)-(1,2)) + │ ├── name: :a + │ └── depth: 0 + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── operator_loc: (1,3)-(1,4) = "=" + └── value: + @ ArrayNode (location: (1,5)-(1,12)) + ├── elements: (length: 3) + │ ├── @ IntegerNode (location: (1,5)-(1,6)) + │ │ └── flags: decimal + │ ├── @ IntegerNode (location: (1,8)-(1,9)) + │ │ └── flags: decimal + │ └── @ IntegerNode (location: (1,11)-(1,12)) + │ └── flags: decimal + ├── opening_loc: ∅ + └── closing_loc: ∅ diff --git a/test/prism/snapshots/seattlerb/masgn_paren.txt b/test/prism/snapshots/seattlerb/masgn_paren.txt new file mode 100644 index 0000000000..4463b6ac19 --- /dev/null +++ b/test/prism/snapshots/seattlerb/masgn_paren.txt @@ -0,0 +1,37 @@ +@ ProgramNode (location: (1,0)-(1,12)) +├── locals: [:a, :b] +└── statements: + @ StatementsNode (location: (1,0)-(1,12)) + └── body: (length: 1) + └── @ MultiWriteNode (location: (1,0)-(1,12)) + ├── targets: (length: 2) + │ ├── @ LocalVariableTargetNode (location: (1,1)-(1,2)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ └── @ LocalVariableTargetNode (location: (1,4)-(1,5)) + │ ├── name: :b + │ └── depth: 0 + ├── lparen_loc: (1,0)-(1,1) = "(" + ├── rparen_loc: (1,5)-(1,6) = ")" + ├── operator_loc: (1,7)-(1,8) = "=" + └── value: + @ CallNode (location: (1,9)-(1,12)) + ├── receiver: + │ @ CallNode (location: (1,9)-(1,10)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,9)-(1,10) = "c" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "c" + ├── call_operator_loc: (1,10)-(1,11) = "." + ├── message_loc: (1,11)-(1,12) = "d" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "d" diff --git a/test/prism/snapshots/seattlerb/masgn_splat_arg.txt b/test/prism/snapshots/seattlerb/masgn_splat_arg.txt new file mode 100644 index 0000000000..1c29fe51a5 --- /dev/null +++ b/test/prism/snapshots/seattlerb/masgn_splat_arg.txt @@ -0,0 +1,34 @@ +@ ProgramNode (location: (1,0)-(1,9)) +├── locals: [:a, :b] +└── statements: + @ StatementsNode (location: (1,0)-(1,9)) + └── body: (length: 1) + └── @ MultiWriteNode (location: (1,0)-(1,9)) + ├── targets: (length: 2) + │ ├── @ MultiTargetNode (location: (1,0)-(1,2)) + │ │ ├── targets: (length: 1) + │ │ │ └── @ SplatNode (location: (1,0)-(1,2)) + │ │ │ ├── operator_loc: (1,0)-(1,1) = "*" + │ │ │ └── expression: + │ │ │ @ LocalVariableTargetNode (location: (1,1)-(1,2)) + │ │ │ ├── name: :a + │ │ │ └── depth: 0 + │ │ ├── lparen_loc: ∅ + │ │ └── rparen_loc: ∅ + │ └── @ LocalVariableTargetNode (location: (1,4)-(1,5)) + │ ├── name: :b + │ └── depth: 0 + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── operator_loc: (1,6)-(1,7) = "=" + └── value: + @ CallNode (location: (1,8)-(1,9)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,8)-(1,9) = "c" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: variable_call + └── name: "c" diff --git a/test/prism/snapshots/seattlerb/masgn_splat_arg_arg.txt b/test/prism/snapshots/seattlerb/masgn_splat_arg_arg.txt new file mode 100644 index 0000000000..5274cda1b8 --- /dev/null +++ b/test/prism/snapshots/seattlerb/masgn_splat_arg_arg.txt @@ -0,0 +1,37 @@ +@ ProgramNode (location: (1,0)-(1,12)) +├── locals: [:a, :b, :c] +└── statements: + @ StatementsNode (location: (1,0)-(1,12)) + └── body: (length: 1) + └── @ MultiWriteNode (location: (1,0)-(1,12)) + ├── targets: (length: 3) + │ ├── @ MultiTargetNode (location: (1,0)-(1,2)) + │ │ ├── targets: (length: 1) + │ │ │ └── @ SplatNode (location: (1,0)-(1,2)) + │ │ │ ├── operator_loc: (1,0)-(1,1) = "*" + │ │ │ └── expression: + │ │ │ @ LocalVariableTargetNode (location: (1,1)-(1,2)) + │ │ │ ├── name: :a + │ │ │ └── depth: 0 + │ │ ├── lparen_loc: ∅ + │ │ └── rparen_loc: ∅ + │ ├── @ LocalVariableTargetNode (location: (1,4)-(1,5)) + │ │ ├── name: :b + │ │ └── depth: 0 + │ └── @ LocalVariableTargetNode (location: (1,7)-(1,8)) + │ ├── name: :c + │ └── depth: 0 + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── operator_loc: (1,9)-(1,10) = "=" + └── value: + @ CallNode (location: (1,11)-(1,12)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,11)-(1,12) = "d" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: variable_call + └── name: "d" diff --git a/test/prism/snapshots/seattlerb/masgn_star.txt b/test/prism/snapshots/seattlerb/masgn_star.txt new file mode 100644 index 0000000000..f86b63fbd0 --- /dev/null +++ b/test/prism/snapshots/seattlerb/masgn_star.txt @@ -0,0 +1,16 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ MultiWriteNode (location: (1,0)-(1,5)) + ├── targets: (length: 1) + │ └── @ SplatNode (location: (1,0)-(1,1)) + │ ├── operator_loc: (1,0)-(1,1) = "*" + │ └── expression: ∅ + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── operator_loc: (1,2)-(1,3) = "=" + └── value: + @ IntegerNode (location: (1,4)-(1,5)) + └── flags: decimal diff --git a/test/prism/snapshots/seattlerb/masgn_var_star_var.txt b/test/prism/snapshots/seattlerb/masgn_var_star_var.txt new file mode 100644 index 0000000000..7923a9e6f8 --- /dev/null +++ b/test/prism/snapshots/seattlerb/masgn_var_star_var.txt @@ -0,0 +1,30 @@ +@ ProgramNode (location: (1,0)-(1,11)) +├── locals: [:a, :b] +└── statements: + @ StatementsNode (location: (1,0)-(1,11)) + └── body: (length: 1) + └── @ MultiWriteNode (location: (1,0)-(1,11)) + ├── targets: (length: 3) + │ ├── @ LocalVariableTargetNode (location: (1,0)-(1,1)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ ├── @ SplatNode (location: (1,3)-(1,4)) + │ │ ├── operator_loc: (1,3)-(1,4) = "*" + │ │ └── expression: ∅ + │ └── @ LocalVariableTargetNode (location: (1,6)-(1,7)) + │ ├── name: :b + │ └── depth: 0 + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── operator_loc: (1,8)-(1,9) = "=" + └── value: + @ CallNode (location: (1,10)-(1,11)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,10)-(1,11) = "c" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: variable_call + └── name: "c" diff --git a/test/prism/snapshots/seattlerb/messy_op_asgn_lineno.txt b/test/prism/snapshots/seattlerb/messy_op_asgn_lineno.txt new file mode 100644 index 0000000000..44ea4fec29 --- /dev/null +++ b/test/prism/snapshots/seattlerb/messy_op_asgn_lineno.txt @@ -0,0 +1,58 @@ +@ ProgramNode (location: (1,0)-(1,15)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,15)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,15)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,15)) + │ └── arguments: (length: 1) + │ └── @ ParenthesesNode (location: (1,2)-(1,15)) + │ ├── body: + │ │ @ StatementsNode (location: (1,3)-(1,14)) + │ │ └── body: (length: 1) + │ │ └── @ ConstantPathOperatorWriteNode (location: (1,3)-(1,14)) + │ │ ├── target: + │ │ │ @ ConstantPathNode (location: (1,3)-(1,7)) + │ │ │ ├── parent: + │ │ │ │ @ ConstantReadNode (location: (1,3)-(1,4)) + │ │ │ │ └── name: :B + │ │ │ ├── child: + │ │ │ │ @ ConstantReadNode (location: (1,6)-(1,7)) + │ │ │ │ └── name: :C + │ │ │ └── delimiter_loc: (1,4)-(1,6) = "::" + │ │ ├── operator_loc: (1,8)-(1,10) = "*=" + │ │ ├── value: + │ │ │ @ CallNode (location: (1,11)-(1,14)) + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── message_loc: (1,11)-(1,12) = "d" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (1,13)-(1,14)) + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ CallNode (location: (1,13)-(1,14)) + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── message_loc: (1,13)-(1,14) = "e" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── block: ∅ + │ │ │ │ ├── flags: variable_call + │ │ │ │ └── name: "e" + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── block: ∅ + │ │ │ ├── flags: ∅ + │ │ │ └── name: "d" + │ │ └── operator: :* + │ ├── opening_loc: (1,2)-(1,3) = "(" + │ └── closing_loc: (1,14)-(1,15) = ")" + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "a" diff --git a/test/prism/snapshots/seattlerb/method_call_assoc_trailing_comma.txt b/test/prism/snapshots/seattlerb/method_call_assoc_trailing_comma.txt new file mode 100644 index 0000000000..356831f513 --- /dev/null +++ b/test/prism/snapshots/seattlerb/method_call_assoc_trailing_comma.txt @@ -0,0 +1,37 @@ +@ ProgramNode (location: (1,0)-(1,10)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,10)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,10)) + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "a" + ├── call_operator_loc: (1,1)-(1,2) = "." + ├── message_loc: (1,2)-(1,3) = "f" + ├── opening_loc: (1,3)-(1,4) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,4)-(1,8)) + │ └── arguments: (length: 1) + │ └── @ KeywordHashNode (location: (1,4)-(1,8)) + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (1,4)-(1,8)) + │ ├── key: + │ │ @ IntegerNode (location: (1,4)-(1,5)) + │ │ └── flags: decimal + │ ├── value: + │ │ @ IntegerNode (location: (1,7)-(1,8)) + │ │ └── flags: decimal + │ └── operator_loc: (1,5)-(1,7) = "=>" + ├── closing_loc: (1,9)-(1,10) = ")" + ├── block: ∅ + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/method_call_trailing_comma.txt b/test/prism/snapshots/seattlerb/method_call_trailing_comma.txt new file mode 100644 index 0000000000..a7ac3c7b6f --- /dev/null +++ b/test/prism/snapshots/seattlerb/method_call_trailing_comma.txt @@ -0,0 +1,29 @@ +@ ProgramNode (location: (1,0)-(1,7)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,7)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,7)) + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "a" + ├── call_operator_loc: (1,1)-(1,2) = "." + ├── message_loc: (1,2)-(1,3) = "f" + ├── opening_loc: (1,3)-(1,4) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,4)-(1,5)) + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,4)-(1,5)) + │ └── flags: decimal + ├── closing_loc: (1,6)-(1,7) = ")" + ├── block: ∅ + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/mlhs_back_anonsplat.txt b/test/prism/snapshots/seattlerb/mlhs_back_anonsplat.txt new file mode 100644 index 0000000000..6166ec0705 --- /dev/null +++ b/test/prism/snapshots/seattlerb/mlhs_back_anonsplat.txt @@ -0,0 +1,33 @@ +@ ProgramNode (location: (1,0)-(1,14)) +├── locals: [:a, :b, :c] +└── statements: + @ StatementsNode (location: (1,0)-(1,14)) + └── body: (length: 1) + └── @ MultiWriteNode (location: (1,0)-(1,14)) + ├── targets: (length: 4) + │ ├── @ LocalVariableTargetNode (location: (1,0)-(1,1)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ ├── @ LocalVariableTargetNode (location: (1,3)-(1,4)) + │ │ ├── name: :b + │ │ └── depth: 0 + │ ├── @ LocalVariableTargetNode (location: (1,6)-(1,7)) + │ │ ├── name: :c + │ │ └── depth: 0 + │ └── @ SplatNode (location: (1,9)-(1,10)) + │ ├── operator_loc: (1,9)-(1,10) = "*" + │ └── expression: ∅ + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── operator_loc: (1,11)-(1,12) = "=" + └── value: + @ CallNode (location: (1,13)-(1,14)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,13)-(1,14) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: variable_call + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/mlhs_back_splat.txt b/test/prism/snapshots/seattlerb/mlhs_back_splat.txt new file mode 100644 index 0000000000..eb41fc6b87 --- /dev/null +++ b/test/prism/snapshots/seattlerb/mlhs_back_splat.txt @@ -0,0 +1,36 @@ +@ ProgramNode (location: (1,0)-(1,15)) +├── locals: [:a, :b, :c, :s] +└── statements: + @ StatementsNode (location: (1,0)-(1,15)) + └── body: (length: 1) + └── @ MultiWriteNode (location: (1,0)-(1,15)) + ├── targets: (length: 4) + │ ├── @ LocalVariableTargetNode (location: (1,0)-(1,1)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ ├── @ LocalVariableTargetNode (location: (1,3)-(1,4)) + │ │ ├── name: :b + │ │ └── depth: 0 + │ ├── @ LocalVariableTargetNode (location: (1,6)-(1,7)) + │ │ ├── name: :c + │ │ └── depth: 0 + │ └── @ SplatNode (location: (1,9)-(1,11)) + │ ├── operator_loc: (1,9)-(1,10) = "*" + │ └── expression: + │ @ LocalVariableTargetNode (location: (1,10)-(1,11)) + │ ├── name: :s + │ └── depth: 0 + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── operator_loc: (1,12)-(1,13) = "=" + └── value: + @ CallNode (location: (1,14)-(1,15)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,14)-(1,15) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: variable_call + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/mlhs_front_anonsplat.txt b/test/prism/snapshots/seattlerb/mlhs_front_anonsplat.txt new file mode 100644 index 0000000000..76b312d65b --- /dev/null +++ b/test/prism/snapshots/seattlerb/mlhs_front_anonsplat.txt @@ -0,0 +1,37 @@ +@ ProgramNode (location: (1,0)-(1,14)) +├── locals: [:x, :y, :z] +└── statements: + @ StatementsNode (location: (1,0)-(1,14)) + └── body: (length: 1) + └── @ MultiWriteNode (location: (1,0)-(1,14)) + ├── targets: (length: 4) + │ ├── @ MultiTargetNode (location: (1,0)-(1,1)) + │ │ ├── targets: (length: 1) + │ │ │ └── @ SplatNode (location: (1,0)-(1,1)) + │ │ │ ├── operator_loc: (1,0)-(1,1) = "*" + │ │ │ └── expression: ∅ + │ │ ├── lparen_loc: ∅ + │ │ └── rparen_loc: ∅ + │ ├── @ LocalVariableTargetNode (location: (1,3)-(1,4)) + │ │ ├── name: :x + │ │ └── depth: 0 + │ ├── @ LocalVariableTargetNode (location: (1,6)-(1,7)) + │ │ ├── name: :y + │ │ └── depth: 0 + │ └── @ LocalVariableTargetNode (location: (1,9)-(1,10)) + │ ├── name: :z + │ └── depth: 0 + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── operator_loc: (1,11)-(1,12) = "=" + └── value: + @ CallNode (location: (1,13)-(1,14)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,13)-(1,14) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: variable_call + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/mlhs_front_splat.txt b/test/prism/snapshots/seattlerb/mlhs_front_splat.txt new file mode 100644 index 0000000000..0fff95f49e --- /dev/null +++ b/test/prism/snapshots/seattlerb/mlhs_front_splat.txt @@ -0,0 +1,40 @@ +@ ProgramNode (location: (1,0)-(1,15)) +├── locals: [:s, :x, :y, :z] +└── statements: + @ StatementsNode (location: (1,0)-(1,15)) + └── body: (length: 1) + └── @ MultiWriteNode (location: (1,0)-(1,15)) + ├── targets: (length: 4) + │ ├── @ MultiTargetNode (location: (1,0)-(1,2)) + │ │ ├── targets: (length: 1) + │ │ │ └── @ SplatNode (location: (1,0)-(1,2)) + │ │ │ ├── operator_loc: (1,0)-(1,1) = "*" + │ │ │ └── expression: + │ │ │ @ LocalVariableTargetNode (location: (1,1)-(1,2)) + │ │ │ ├── name: :s + │ │ │ └── depth: 0 + │ │ ├── lparen_loc: ∅ + │ │ └── rparen_loc: ∅ + │ ├── @ LocalVariableTargetNode (location: (1,4)-(1,5)) + │ │ ├── name: :x + │ │ └── depth: 0 + │ ├── @ LocalVariableTargetNode (location: (1,7)-(1,8)) + │ │ ├── name: :y + │ │ └── depth: 0 + │ └── @ LocalVariableTargetNode (location: (1,10)-(1,11)) + │ ├── name: :z + │ └── depth: 0 + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── operator_loc: (1,12)-(1,13) = "=" + └── value: + @ CallNode (location: (1,14)-(1,15)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,14)-(1,15) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: variable_call + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/mlhs_keyword.txt b/test/prism/snapshots/seattlerb/mlhs_keyword.txt new file mode 100644 index 0000000000..05cf9c9ce9 --- /dev/null +++ b/test/prism/snapshots/seattlerb/mlhs_keyword.txt @@ -0,0 +1,29 @@ +@ ProgramNode (location: (1,0)-(1,16)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,16)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,16)) + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "a" + ├── call_operator_loc: (1,1)-(1,2) = "." + ├── message_loc: (1,2)-(1,4) = "!=" + ├── opening_loc: (1,4)-(1,5) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,5)-(1,15)) + │ └── arguments: (length: 2) + │ ├── @ TrueNode (location: (1,5)-(1,9)) + │ └── @ TrueNode (location: (1,11)-(1,15)) + ├── closing_loc: (1,15)-(1,16) = ")" + ├── block: ∅ + ├── flags: ∅ + └── name: "!=" diff --git a/test/prism/snapshots/seattlerb/mlhs_mid_anonsplat.txt b/test/prism/snapshots/seattlerb/mlhs_mid_anonsplat.txt new file mode 100644 index 0000000000..b2448bc839 --- /dev/null +++ b/test/prism/snapshots/seattlerb/mlhs_mid_anonsplat.txt @@ -0,0 +1,42 @@ +@ ProgramNode (location: (1,0)-(1,23)) +├── locals: [:a, :b, :c, :x, :y, :z] +└── statements: + @ StatementsNode (location: (1,0)-(1,23)) + └── body: (length: 1) + └── @ MultiWriteNode (location: (1,0)-(1,23)) + ├── targets: (length: 7) + │ ├── @ LocalVariableTargetNode (location: (1,0)-(1,1)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ ├── @ LocalVariableTargetNode (location: (1,3)-(1,4)) + │ │ ├── name: :b + │ │ └── depth: 0 + │ ├── @ LocalVariableTargetNode (location: (1,6)-(1,7)) + │ │ ├── name: :c + │ │ └── depth: 0 + │ ├── @ SplatNode (location: (1,9)-(1,10)) + │ │ ├── operator_loc: (1,9)-(1,10) = "*" + │ │ └── expression: ∅ + │ ├── @ LocalVariableTargetNode (location: (1,12)-(1,13)) + │ │ ├── name: :x + │ │ └── depth: 0 + │ ├── @ LocalVariableTargetNode (location: (1,15)-(1,16)) + │ │ ├── name: :y + │ │ └── depth: 0 + │ └── @ LocalVariableTargetNode (location: (1,18)-(1,19)) + │ ├── name: :z + │ └── depth: 0 + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── operator_loc: (1,20)-(1,21) = "=" + └── value: + @ CallNode (location: (1,22)-(1,23)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,22)-(1,23) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: variable_call + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/mlhs_mid_splat.txt b/test/prism/snapshots/seattlerb/mlhs_mid_splat.txt new file mode 100644 index 0000000000..704f9f1c80 --- /dev/null +++ b/test/prism/snapshots/seattlerb/mlhs_mid_splat.txt @@ -0,0 +1,45 @@ +@ ProgramNode (location: (1,0)-(1,24)) +├── locals: [:a, :b, :c, :s, :x, :y, :z] +└── statements: + @ StatementsNode (location: (1,0)-(1,24)) + └── body: (length: 1) + └── @ MultiWriteNode (location: (1,0)-(1,24)) + ├── targets: (length: 7) + │ ├── @ LocalVariableTargetNode (location: (1,0)-(1,1)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ ├── @ LocalVariableTargetNode (location: (1,3)-(1,4)) + │ │ ├── name: :b + │ │ └── depth: 0 + │ ├── @ LocalVariableTargetNode (location: (1,6)-(1,7)) + │ │ ├── name: :c + │ │ └── depth: 0 + │ ├── @ SplatNode (location: (1,9)-(1,11)) + │ │ ├── operator_loc: (1,9)-(1,10) = "*" + │ │ └── expression: + │ │ @ LocalVariableTargetNode (location: (1,10)-(1,11)) + │ │ ├── name: :s + │ │ └── depth: 0 + │ ├── @ LocalVariableTargetNode (location: (1,13)-(1,14)) + │ │ ├── name: :x + │ │ └── depth: 0 + │ ├── @ LocalVariableTargetNode (location: (1,16)-(1,17)) + │ │ ├── name: :y + │ │ └── depth: 0 + │ └── @ LocalVariableTargetNode (location: (1,19)-(1,20)) + │ ├── name: :z + │ └── depth: 0 + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── operator_loc: (1,21)-(1,22) = "=" + └── value: + @ CallNode (location: (1,23)-(1,24)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,23)-(1,24) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: variable_call + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/mlhs_rescue.txt b/test/prism/snapshots/seattlerb/mlhs_rescue.txt new file mode 100644 index 0000000000..d6e2f7a75f --- /dev/null +++ b/test/prism/snapshots/seattlerb/mlhs_rescue.txt @@ -0,0 +1,33 @@ +@ ProgramNode (location: (1,0)-(1,18)) +├── locals: [:a, :b] +└── statements: + @ StatementsNode (location: (1,0)-(1,18)) + └── body: (length: 1) + └── @ MultiWriteNode (location: (1,0)-(1,18)) + ├── targets: (length: 2) + │ ├── @ LocalVariableTargetNode (location: (1,0)-(1,1)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ └── @ LocalVariableTargetNode (location: (1,3)-(1,4)) + │ ├── name: :b + │ └── depth: 0 + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── operator_loc: (1,5)-(1,6) = "=" + └── value: + @ RescueModifierNode (location: (1,7)-(1,18)) + ├── expression: + │ @ CallNode (location: (1,7)-(1,8)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,7)-(1,8) = "f" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "f" + ├── keyword_loc: (1,9)-(1,15) = "rescue" + └── rescue_expression: + @ IntegerNode (location: (1,16)-(1,18)) + └── flags: decimal diff --git a/test/prism/snapshots/seattlerb/module_comments.txt b/test/prism/snapshots/seattlerb/module_comments.txt new file mode 100644 index 0000000000..2785187a29 --- /dev/null +++ b/test/prism/snapshots/seattlerb/module_comments.txt @@ -0,0 +1,29 @@ +@ ProgramNode (location: (5,0)-(10,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (5,0)-(10,3)) + └── body: (length: 1) + └── @ ModuleNode (location: (5,0)-(10,3)) + ├── locals: [] + ├── module_keyword_loc: (5,0)-(5,6) = "module" + ├── constant_path: + │ @ ConstantReadNode (location: (5,7)-(5,8)) + │ └── name: :X + ├── body: + │ @ StatementsNode (location: (7,2)-(9,5)) + │ └── body: (length: 1) + │ └── @ DefNode (location: (7,2)-(9,5)) + │ ├── name: :blah + │ ├── name_loc: (7,6)-(7,10) = "blah" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (7,2)-(7,5) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (9,2)-(9,5) = "end" + ├── end_keyword_loc: (10,0)-(10,3) = "end" + └── name: :X diff --git a/test/prism/snapshots/seattlerb/multiline_hash_declaration.txt b/test/prism/snapshots/seattlerb/multiline_hash_declaration.txt new file mode 100644 index 0000000000..5c7453727b --- /dev/null +++ b/test/prism/snapshots/seattlerb/multiline_hash_declaration.txt @@ -0,0 +1,86 @@ +@ ProgramNode (location: (1,0)-(8,12)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(8,12)) + └── body: (length: 3) + ├── @ CallNode (location: (1,0)-(3,2)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,0)-(1,1) = "f" + │ ├── opening_loc: (1,1)-(1,2) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,2)-(3,1)) + │ │ └── arguments: (length: 1) + │ │ └── @ KeywordHashNode (location: (1,2)-(3,1)) + │ │ └── elements: (length: 1) + │ │ └── @ AssocNode (location: (1,2)-(3,1)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (1,2)-(1,8)) + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (1,2)-(1,7) = "state" + │ │ │ ├── closing_loc: (1,7)-(1,8) = ":" + │ │ │ └── unescaped: "state" + │ │ ├── value: + │ │ │ @ HashNode (location: (2,1)-(3,1)) + │ │ │ ├── opening_loc: (2,1)-(2,2) = "{" + │ │ │ ├── elements: (length: 0) + │ │ │ └── closing_loc: (3,0)-(3,1) = "}" + │ │ └── operator_loc: ∅ + │ ├── closing_loc: (3,1)-(3,2) = ")" + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "f" + ├── @ CallNode (location: (5,0)-(6,2)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (5,0)-(5,1) = "f" + │ ├── opening_loc: (5,1)-(5,2) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (5,2)-(6,1)) + │ │ └── arguments: (length: 1) + │ │ └── @ KeywordHashNode (location: (5,2)-(6,1)) + │ │ └── elements: (length: 1) + │ │ └── @ AssocNode (location: (5,2)-(6,1)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (5,2)-(5,8)) + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (5,2)-(5,7) = "state" + │ │ │ ├── closing_loc: (5,7)-(5,8) = ":" + │ │ │ └── unescaped: "state" + │ │ ├── value: + │ │ │ @ HashNode (location: (5,9)-(6,1)) + │ │ │ ├── opening_loc: (5,9)-(5,10) = "{" + │ │ │ ├── elements: (length: 0) + │ │ │ └── closing_loc: (6,0)-(6,1) = "}" + │ │ └── operator_loc: ∅ + │ ├── closing_loc: (6,1)-(6,2) = ")" + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "f" + └── @ CallNode (location: (8,0)-(8,12)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (8,0)-(8,1) = "f" + ├── opening_loc: (8,1)-(8,2) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (8,2)-(8,11)) + │ └── arguments: (length: 1) + │ └── @ KeywordHashNode (location: (8,2)-(8,11)) + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (8,2)-(8,11)) + │ ├── key: + │ │ @ SymbolNode (location: (8,2)-(8,8)) + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (8,2)-(8,7) = "state" + │ │ ├── closing_loc: (8,7)-(8,8) = ":" + │ │ └── unescaped: "state" + │ ├── value: + │ │ @ HashNode (location: (8,9)-(8,11)) + │ │ ├── opening_loc: (8,9)-(8,10) = "{" + │ │ ├── elements: (length: 0) + │ │ └── closing_loc: (8,10)-(8,11) = "}" + │ └── operator_loc: ∅ + ├── closing_loc: (8,11)-(8,12) = ")" + ├── block: ∅ + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/non_interpolated_symbol_array_line_breaks.txt b/test/prism/snapshots/seattlerb/non_interpolated_symbol_array_line_breaks.txt new file mode 100644 index 0000000000..84da92544b --- /dev/null +++ b/test/prism/snapshots/seattlerb/non_interpolated_symbol_array_line_breaks.txt @@ -0,0 +1,21 @@ +@ ProgramNode (location: (1,0)-(5,1)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(5,1)) + └── body: (length: 2) + ├── @ ArrayNode (location: (1,0)-(4,1)) + │ ├── elements: (length: 2) + │ │ ├── @ SymbolNode (location: (2,0)-(2,1)) + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (2,0)-(2,1) = "a" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a" + │ │ └── @ SymbolNode (location: (3,0)-(3,1)) + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (3,0)-(3,1) = "b" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "b" + │ ├── opening_loc: (1,0)-(1,3) = "%i(" + │ └── closing_loc: (4,0)-(4,1) = ")" + └── @ IntegerNode (location: (5,0)-(5,1)) + └── flags: decimal diff --git a/test/prism/snapshots/seattlerb/non_interpolated_word_array_line_breaks.txt b/test/prism/snapshots/seattlerb/non_interpolated_word_array_line_breaks.txt new file mode 100644 index 0000000000..8e34057120 --- /dev/null +++ b/test/prism/snapshots/seattlerb/non_interpolated_word_array_line_breaks.txt @@ -0,0 +1,23 @@ +@ ProgramNode (location: (1,0)-(5,1)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(5,1)) + └── body: (length: 2) + ├── @ ArrayNode (location: (1,0)-(4,1)) + │ ├── elements: (length: 2) + │ │ ├── @ StringNode (location: (2,0)-(2,1)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (2,0)-(2,1) = "a" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a" + │ │ └── @ StringNode (location: (3,0)-(3,1)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (3,0)-(3,1) = "b" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "b" + │ ├── opening_loc: (1,0)-(1,3) = "%w(" + │ └── closing_loc: (4,0)-(4,1) = ")" + └── @ IntegerNode (location: (5,0)-(5,1)) + └── flags: decimal diff --git a/test/prism/snapshots/seattlerb/op_asgn_command_call.txt b/test/prism/snapshots/seattlerb/op_asgn_command_call.txt new file mode 100644 index 0000000000..d986eccdb9 --- /dev/null +++ b/test/prism/snapshots/seattlerb/op_asgn_command_call.txt @@ -0,0 +1,35 @@ +@ ProgramNode (location: (1,0)-(1,11)) +├── locals: [:a] +└── statements: + @ StatementsNode (location: (1,0)-(1,11)) + └── body: (length: 1) + └── @ LocalVariableOrWriteNode (location: (1,0)-(1,11)) + ├── name_loc: (1,0)-(1,1) = "a" + ├── operator_loc: (1,2)-(1,5) = "||=" + ├── value: + │ @ CallNode (location: (1,6)-(1,11)) + │ ├── receiver: + │ │ @ CallNode (location: (1,6)-(1,7)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,6)-(1,7) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "b" + │ ├── call_operator_loc: (1,7)-(1,8) = "." + │ ├── message_loc: (1,8)-(1,9) = "c" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,10)-(1,11)) + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (1,10)-(1,11)) + │ │ └── flags: decimal + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "c" + ├── name: :a + └── depth: 0 diff --git a/test/prism/snapshots/seattlerb/op_asgn_dot_ident_command_call.txt b/test/prism/snapshots/seattlerb/op_asgn_dot_ident_command_call.txt new file mode 100644 index 0000000000..62853c9475 --- /dev/null +++ b/test/prism/snapshots/seattlerb/op_asgn_dot_ident_command_call.txt @@ -0,0 +1,33 @@ +@ ProgramNode (location: (1,0)-(1,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,11)) + └── body: (length: 1) + └── @ CallOrWriteNode (location: (1,0)-(1,11)) + ├── receiver: + │ @ ConstantReadNode (location: (1,0)-(1,1)) + │ └── name: :A + ├── call_operator_loc: (1,1)-(1,2) = "." + ├── message_loc: (1,2)-(1,3) = "B" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── flags: ∅ + ├── read_name: "B" + ├── write_name: "B=" + ├── operator_loc: (1,4)-(1,7) = "||=" + └── value: + @ CallNode (location: (1,8)-(1,11)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,8)-(1,9) = "c" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,10)-(1,11)) + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,10)-(1,11)) + │ └── flags: decimal + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "c" diff --git a/test/prism/snapshots/seattlerb/op_asgn_index_command_call.txt b/test/prism/snapshots/seattlerb/op_asgn_index_command_call.txt new file mode 100644 index 0000000000..33f094b849 --- /dev/null +++ b/test/prism/snapshots/seattlerb/op_asgn_index_command_call.txt @@ -0,0 +1,50 @@ +@ ProgramNode (location: (1,0)-(1,16)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,16)) + └── body: (length: 1) + └── @ CallOrWriteNode (location: (1,0)-(1,16)) + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "a" + ├── call_operator_loc: ∅ + ├── message_loc: (1,1)-(1,5) = "[:b]" + ├── opening_loc: (1,1)-(1,2) = "[" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,4)) + │ └── arguments: (length: 1) + │ └── @ SymbolNode (location: (1,2)-(1,4)) + │ ├── opening_loc: (1,2)-(1,3) = ":" + │ ├── value_loc: (1,3)-(1,4) = "b" + │ ├── closing_loc: ∅ + │ └── unescaped: "b" + ├── closing_loc: (1,4)-(1,5) = "]" + ├── flags: ∅ + ├── read_name: "[]" + ├── write_name: "[]=" + ├── operator_loc: (1,6)-(1,9) = "||=" + └── value: + @ CallNode (location: (1,10)-(1,16)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,10)-(1,11) = "c" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,12)-(1,16)) + │ └── arguments: (length: 2) + │ ├── @ IntegerNode (location: (1,12)-(1,13)) + │ │ └── flags: decimal + │ └── @ IntegerNode (location: (1,15)-(1,16)) + │ └── flags: decimal + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "c" diff --git a/test/prism/snapshots/seattlerb/op_asgn_primary_colon_const_command_call.txt b/test/prism/snapshots/seattlerb/op_asgn_primary_colon_const_command_call.txt new file mode 100644 index 0000000000..81568afe4b --- /dev/null +++ b/test/prism/snapshots/seattlerb/op_asgn_primary_colon_const_command_call.txt @@ -0,0 +1,40 @@ +@ ProgramNode (location: (1,0)-(1,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,11)) + └── body: (length: 1) + └── @ ConstantPathOperatorWriteNode (location: (1,0)-(1,11)) + ├── target: + │ @ ConstantPathNode (location: (1,0)-(1,4)) + │ ├── parent: + │ │ @ ConstantReadNode (location: (1,0)-(1,1)) + │ │ └── name: :A + │ ├── child: + │ │ @ ConstantReadNode (location: (1,3)-(1,4)) + │ │ └── name: :B + │ └── delimiter_loc: (1,1)-(1,3) = "::" + ├── operator_loc: (1,5)-(1,7) = "*=" + ├── value: + │ @ CallNode (location: (1,8)-(1,11)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,8)-(1,9) = "c" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,10)-(1,11)) + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (1,10)-(1,11)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,10)-(1,11) = "d" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "d" + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "c" + └── operator: :* diff --git a/test/prism/snapshots/seattlerb/op_asgn_primary_colon_identifier1.txt b/test/prism/snapshots/seattlerb/op_asgn_primary_colon_identifier1.txt new file mode 100644 index 0000000000..f03c9057a3 --- /dev/null +++ b/test/prism/snapshots/seattlerb/op_asgn_primary_colon_identifier1.txt @@ -0,0 +1,22 @@ +@ ProgramNode (location: (1,0)-(1,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,9)) + └── body: (length: 1) + └── @ CallOperatorWriteNode (location: (1,0)-(1,9)) + ├── receiver: + │ @ ConstantReadNode (location: (1,0)-(1,1)) + │ └── name: :A + ├── call_operator_loc: (1,1)-(1,3) = "::" + ├── message_loc: (1,3)-(1,4) = "b" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── flags: ∅ + ├── read_name: "b" + ├── write_name: "b=" + ├── operator: :+ + ├── operator_loc: (1,5)-(1,7) = "+=" + └── value: + @ IntegerNode (location: (1,8)-(1,9)) + └── flags: decimal diff --git a/test/prism/snapshots/seattlerb/op_asgn_primary_colon_identifier_command_call.txt b/test/prism/snapshots/seattlerb/op_asgn_primary_colon_identifier_command_call.txt new file mode 100644 index 0000000000..addc999eec --- /dev/null +++ b/test/prism/snapshots/seattlerb/op_asgn_primary_colon_identifier_command_call.txt @@ -0,0 +1,42 @@ +@ ProgramNode (location: (1,0)-(1,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,11)) + └── body: (length: 1) + └── @ CallOperatorWriteNode (location: (1,0)-(1,11)) + ├── receiver: + │ @ ConstantReadNode (location: (1,0)-(1,1)) + │ └── name: :A + ├── call_operator_loc: (1,1)-(1,3) = "::" + ├── message_loc: (1,3)-(1,4) = "b" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── flags: ∅ + ├── read_name: "b" + ├── write_name: "b=" + ├── operator: :* + ├── operator_loc: (1,5)-(1,7) = "*=" + └── value: + @ CallNode (location: (1,8)-(1,11)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,8)-(1,9) = "c" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,10)-(1,11)) + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (1,10)-(1,11)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,10)-(1,11) = "d" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "d" + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "c" diff --git a/test/prism/snapshots/seattlerb/op_asgn_val_dot_ident_command_call.txt b/test/prism/snapshots/seattlerb/op_asgn_val_dot_ident_command_call.txt new file mode 100644 index 0000000000..e6c9d1efd4 --- /dev/null +++ b/test/prism/snapshots/seattlerb/op_asgn_val_dot_ident_command_call.txt @@ -0,0 +1,41 @@ +@ ProgramNode (location: (1,0)-(1,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,11)) + └── body: (length: 1) + └── @ CallOrWriteNode (location: (1,0)-(1,11)) + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "a" + ├── call_operator_loc: (1,1)-(1,2) = "." + ├── message_loc: (1,2)-(1,3) = "b" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── flags: ∅ + ├── read_name: "b" + ├── write_name: "b=" + ├── operator_loc: (1,4)-(1,7) = "||=" + └── value: + @ CallNode (location: (1,8)-(1,11)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,8)-(1,9) = "c" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,10)-(1,11)) + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,10)-(1,11)) + │ └── flags: decimal + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "c" diff --git a/test/prism/snapshots/seattlerb/parse_def_special_name.txt b/test/prism/snapshots/seattlerb/parse_def_special_name.txt new file mode 100644 index 0000000000..dfbfe8a391 --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_def_special_name.txt @@ -0,0 +1,18 @@ +@ ProgramNode (location: (1,0)-(1,13)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,13)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(1,13)) + ├── name: :next + ├── name_loc: (1,4)-(1,8) = "next" + ├── receiver: ∅ + ├── parameters: ∅ + ├── body: ∅ + ├── locals: [] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── equal_loc: ∅ + └── end_keyword_loc: (1,10)-(1,13) = "end" diff --git a/test/prism/snapshots/seattlerb/parse_if_not_canonical.txt b/test/prism/snapshots/seattlerb/parse_if_not_canonical.txt new file mode 100644 index 0000000000..a8c1aede4a --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_if_not_canonical.txt @@ -0,0 +1,61 @@ +@ ProgramNode (location: (1,0)-(2,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,3)) + └── body: (length: 1) + └── @ IfNode (location: (1,0)-(2,3)) + ├── if_keyword_loc: (1,0)-(1,2) = "if" + ├── predicate: + │ @ CallNode (location: (1,3)-(1,15)) + │ ├── receiver: + │ │ @ CallNode (location: (1,7)-(1,15)) + │ │ ├── receiver: + │ │ │ @ CallNode (location: (1,7)-(1,10)) + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── message_loc: (1,7)-(1,10) = "var" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── block: ∅ + │ │ │ ├── flags: variable_call + │ │ │ └── name: "var" + │ │ ├── call_operator_loc: (1,10)-(1,11) = "." + │ │ ├── message_loc: (1,11)-(1,15) = "nil?" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: ∅ + │ │ └── name: "nil?" + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,3)-(1,6) = "not" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "!" + ├── statements: + │ @ StatementsNode (location: (1,21)-(1,26)) + │ └── body: (length: 1) + │ └── @ StringNode (location: (1,21)-(1,26)) + │ ├── flags: ∅ + │ ├── opening_loc: (1,21)-(1,22) = "'" + │ ├── content_loc: (1,22)-(1,25) = "foo" + │ ├── closing_loc: (1,25)-(1,26) = "'" + │ └── unescaped: "foo" + ├── consequent: + │ @ ElseNode (location: (1,27)-(2,3)) + │ ├── else_keyword_loc: (1,27)-(1,31) = "else" + │ ├── statements: + │ │ @ StatementsNode (location: (1,32)-(1,37)) + │ │ └── body: (length: 1) + │ │ └── @ StringNode (location: (1,32)-(1,37)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (1,32)-(1,33) = "'" + │ │ ├── content_loc: (1,33)-(1,36) = "bar" + │ │ ├── closing_loc: (1,36)-(1,37) = "'" + │ │ └── unescaped: "bar" + │ └── end_keyword_loc: (2,0)-(2,3) = "end" + └── end_keyword_loc: (2,0)-(2,3) = "end" diff --git a/test/prism/snapshots/seattlerb/parse_if_not_noncanonical.txt b/test/prism/snapshots/seattlerb/parse_if_not_noncanonical.txt new file mode 100644 index 0000000000..a8c1aede4a --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_if_not_noncanonical.txt @@ -0,0 +1,61 @@ +@ ProgramNode (location: (1,0)-(2,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,3)) + └── body: (length: 1) + └── @ IfNode (location: (1,0)-(2,3)) + ├── if_keyword_loc: (1,0)-(1,2) = "if" + ├── predicate: + │ @ CallNode (location: (1,3)-(1,15)) + │ ├── receiver: + │ │ @ CallNode (location: (1,7)-(1,15)) + │ │ ├── receiver: + │ │ │ @ CallNode (location: (1,7)-(1,10)) + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── message_loc: (1,7)-(1,10) = "var" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── block: ∅ + │ │ │ ├── flags: variable_call + │ │ │ └── name: "var" + │ │ ├── call_operator_loc: (1,10)-(1,11) = "." + │ │ ├── message_loc: (1,11)-(1,15) = "nil?" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: ∅ + │ │ └── name: "nil?" + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,3)-(1,6) = "not" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "!" + ├── statements: + │ @ StatementsNode (location: (1,21)-(1,26)) + │ └── body: (length: 1) + │ └── @ StringNode (location: (1,21)-(1,26)) + │ ├── flags: ∅ + │ ├── opening_loc: (1,21)-(1,22) = "'" + │ ├── content_loc: (1,22)-(1,25) = "foo" + │ ├── closing_loc: (1,25)-(1,26) = "'" + │ └── unescaped: "foo" + ├── consequent: + │ @ ElseNode (location: (1,27)-(2,3)) + │ ├── else_keyword_loc: (1,27)-(1,31) = "else" + │ ├── statements: + │ │ @ StatementsNode (location: (1,32)-(1,37)) + │ │ └── body: (length: 1) + │ │ └── @ StringNode (location: (1,32)-(1,37)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (1,32)-(1,33) = "'" + │ │ ├── content_loc: (1,33)-(1,36) = "bar" + │ │ ├── closing_loc: (1,36)-(1,37) = "'" + │ │ └── unescaped: "bar" + │ └── end_keyword_loc: (2,0)-(2,3) = "end" + └── end_keyword_loc: (2,0)-(2,3) = "end" diff --git a/test/prism/snapshots/seattlerb/parse_line_block.txt b/test/prism/snapshots/seattlerb/parse_line_block.txt new file mode 100644 index 0000000000..f75ed80127 --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_block.txt @@ -0,0 +1,28 @@ +@ ProgramNode (location: (1,0)-(2,3)) +├── locals: [:a] +└── statements: + @ StatementsNode (location: (1,0)-(2,3)) + └── body: (length: 2) + ├── @ LocalVariableWriteNode (location: (1,0)-(1,6)) + │ ├── name: :a + │ ├── depth: 0 + │ ├── name_loc: (1,0)-(1,1) = "a" + │ ├── value: + │ │ @ IntegerNode (location: (1,4)-(1,6)) + │ │ └── flags: decimal + │ └── operator_loc: (1,2)-(1,3) = "=" + └── @ CallNode (location: (2,0)-(2,3)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (2,0)-(2,1) = "p" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (2,2)-(2,3)) + │ └── arguments: (length: 1) + │ └── @ LocalVariableReadNode (location: (2,2)-(2,3)) + │ ├── name: :a + │ └── depth: 0 + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "p" diff --git a/test/prism/snapshots/seattlerb/parse_line_block_inline_comment.txt b/test/prism/snapshots/seattlerb/parse_line_block_inline_comment.txt new file mode 100644 index 0000000000..0cae7d514b --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_block_inline_comment.txt @@ -0,0 +1,35 @@ +@ ProgramNode (location: (1,0)-(3,1)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,1)) + └── body: (length: 3) + ├── @ CallNode (location: (1,0)-(1,1)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "a" + ├── @ CallNode (location: (2,0)-(2,1)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (2,0)-(2,1) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "b" + └── @ CallNode (location: (3,0)-(3,1)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (3,0)-(3,1) = "c" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: variable_call + └── name: "c" diff --git a/test/prism/snapshots/seattlerb/parse_line_block_inline_comment_leading_newlines.txt b/test/prism/snapshots/seattlerb/parse_line_block_inline_comment_leading_newlines.txt new file mode 100644 index 0000000000..5bb55d0f6a --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_block_inline_comment_leading_newlines.txt @@ -0,0 +1,35 @@ +@ ProgramNode (location: (4,0)-(7,1)) +├── locals: [] +└── statements: + @ StatementsNode (location: (4,0)-(7,1)) + └── body: (length: 3) + ├── @ CallNode (location: (4,0)-(4,1)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (4,0)-(4,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "a" + ├── @ CallNode (location: (5,0)-(5,1)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (5,0)-(5,1) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "b" + └── @ CallNode (location: (7,0)-(7,1)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (7,0)-(7,1) = "c" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: variable_call + └── name: "c" diff --git a/test/prism/snapshots/seattlerb/parse_line_block_inline_multiline_comment.txt b/test/prism/snapshots/seattlerb/parse_line_block_inline_multiline_comment.txt new file mode 100644 index 0000000000..2aa469b88c --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_block_inline_multiline_comment.txt @@ -0,0 +1,35 @@ +@ ProgramNode (location: (1,0)-(4,1)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,1)) + └── body: (length: 3) + ├── @ CallNode (location: (1,0)-(1,1)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "a" + ├── @ CallNode (location: (2,0)-(2,1)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (2,0)-(2,1) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "b" + └── @ CallNode (location: (4,0)-(4,1)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (4,0)-(4,1) = "c" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: variable_call + └── name: "c" diff --git a/test/prism/snapshots/seattlerb/parse_line_call_ivar_arg_no_parens_line_break.txt b/test/prism/snapshots/seattlerb/parse_line_call_ivar_arg_no_parens_line_break.txt new file mode 100644 index 0000000000..a70dee6c7c --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_call_ivar_arg_no_parens_line_break.txt @@ -0,0 +1,19 @@ +@ ProgramNode (location: (1,0)-(1,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,4)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,4)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,4)) + │ └── arguments: (length: 1) + │ └── @ InstanceVariableReadNode (location: (1,2)-(1,4)) + │ └── name: :@b + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "a" diff --git a/test/prism/snapshots/seattlerb/parse_line_call_ivar_line_break_paren.txt b/test/prism/snapshots/seattlerb/parse_line_call_ivar_line_break_paren.txt new file mode 100644 index 0000000000..9aa87bb1b7 --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_call_ivar_line_break_paren.txt @@ -0,0 +1,19 @@ +@ ProgramNode (location: (1,0)-(2,1)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,1)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(2,1)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: (1,1)-(1,2) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,4)) + │ └── arguments: (length: 1) + │ └── @ InstanceVariableReadNode (location: (1,2)-(1,4)) + │ └── name: :@b + ├── closing_loc: (2,0)-(2,1) = ")" + ├── block: ∅ + ├── flags: ∅ + └── name: "a" diff --git a/test/prism/snapshots/seattlerb/parse_line_call_no_args.txt b/test/prism/snapshots/seattlerb/parse_line_call_no_args.txt new file mode 100644 index 0000000000..cc71f259bf --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_call_no_args.txt @@ -0,0 +1,58 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(3,3)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,2)-(3,3)) + │ ├── locals: [:x, :y] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,5)-(1,11)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,6)-(1,10)) + │ │ │ ├── requireds: (length: 2) + │ │ │ │ ├── @ RequiredParameterNode (location: (1,6)-(1,7)) + │ │ │ │ │ └── name: :x + │ │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ │ └── name: :y + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,5)-(1,6) = "|" + │ │ └── closing_loc: (1,10)-(1,11) = "|" + │ ├── body: + │ │ @ StatementsNode (location: (2,2)-(2,7)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (2,2)-(2,7)) + │ │ ├── receiver: + │ │ │ @ LocalVariableReadNode (location: (2,2)-(2,3)) + │ │ │ ├── name: :x + │ │ │ └── depth: 0 + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (2,4)-(2,5) = "+" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (2,6)-(2,7)) + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ LocalVariableReadNode (location: (2,6)-(2,7)) + │ │ │ ├── name: :y + │ │ │ └── depth: 0 + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: ∅ + │ │ └── name: "+" + │ ├── opening_loc: (1,2)-(1,4) = "do" + │ └── closing_loc: (3,0)-(3,3) = "end" + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/parse_line_defn_complex.txt b/test/prism/snapshots/seattlerb/parse_line_defn_complex.txt new file mode 100644 index 0000000000..f2fa55fb2d --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_defn_complex.txt @@ -0,0 +1,62 @@ +@ ProgramNode (location: (1,0)-(5,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(5,3)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(5,3)) + ├── name: :x + ├── name_loc: (1,4)-(1,5) = "x" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,6)-(1,7)) + │ ├── requireds: (length: 1) + │ │ └── @ RequiredParameterNode (location: (1,6)-(1,7)) + │ │ └── name: :y + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 0) + │ ├── keyword_rest: ∅ + │ └── block: ∅ + ├── body: + │ @ StatementsNode (location: (2,2)-(4,10)) + │ └── body: (length: 3) + │ ├── @ CallNode (location: (2,2)-(2,6)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (2,2)-(2,3) = "p" + │ │ ├── opening_loc: (2,3)-(2,4) = "(" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (2,4)-(2,5)) + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ LocalVariableReadNode (location: (2,4)-(2,5)) + │ │ │ ├── name: :y + │ │ │ └── depth: 0 + │ │ ├── closing_loc: (2,5)-(2,6) = ")" + │ │ ├── block: ∅ + │ │ ├── flags: ∅ + │ │ └── name: "p" + │ ├── @ LocalVariableOperatorWriteNode (location: (3,2)-(3,8)) + │ │ ├── name_loc: (3,2)-(3,3) = "y" + │ │ ├── operator_loc: (3,4)-(3,6) = "*=" + │ │ ├── value: + │ │ │ @ IntegerNode (location: (3,7)-(3,8)) + │ │ │ └── flags: decimal + │ │ ├── name: :y + │ │ ├── operator: :* + │ │ └── depth: 0 + │ └── @ ReturnNode (location: (4,2)-(4,10)) + │ ├── keyword_loc: (4,2)-(4,8) = "return" + │ └── arguments: + │ @ ArgumentsNode (location: (4,9)-(4,10)) + │ └── arguments: (length: 1) + │ └── @ LocalVariableReadNode (location: (4,9)-(4,10)) + │ ├── name: :y + │ └── depth: 0 + ├── locals: [:y] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: (1,5)-(1,6) = "(" + ├── rparen_loc: (1,7)-(1,8) = ")" + ├── equal_loc: ∅ + └── end_keyword_loc: (5,0)-(5,3) = "end" diff --git a/test/prism/snapshots/seattlerb/parse_line_defn_no_parens.txt b/test/prism/snapshots/seattlerb/parse_line_defn_no_parens.txt new file mode 100644 index 0000000000..74240322ac --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_defn_no_parens.txt @@ -0,0 +1,31 @@ +@ ProgramNode (location: (1,0)-(6,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(6,3)) + └── body: (length: 2) + ├── @ DefNode (location: (1,0)-(3,3)) + │ ├── name: :f + │ ├── name_loc: (1,4)-(1,5) = "f" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (1,0)-(1,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (3,0)-(3,3) = "end" + └── @ DefNode (location: (5,0)-(6,3)) + ├── name: :f + ├── name_loc: (5,4)-(5,5) = "f" + ├── receiver: ∅ + ├── parameters: ∅ + ├── body: ∅ + ├── locals: [] + ├── def_keyword_loc: (5,0)-(5,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── equal_loc: ∅ + └── end_keyword_loc: (6,0)-(6,3) = "end" diff --git a/test/prism/snapshots/seattlerb/parse_line_defn_no_parens_args.txt b/test/prism/snapshots/seattlerb/parse_line_defn_no_parens_args.txt new file mode 100644 index 0000000000..d19fa698f6 --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_defn_no_parens_args.txt @@ -0,0 +1,28 @@ +@ ProgramNode (location: (1,0)-(2,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,3)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(2,3)) + ├── name: :f + ├── name_loc: (1,4)-(1,5) = "f" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,6)-(1,7)) + │ ├── requireds: (length: 1) + │ │ └── @ RequiredParameterNode (location: (1,6)-(1,7)) + │ │ └── name: :a + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 0) + │ ├── keyword_rest: ∅ + │ └── block: ∅ + ├── body: ∅ + ├── locals: [:a] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── equal_loc: ∅ + └── end_keyword_loc: (2,0)-(2,3) = "end" diff --git a/test/prism/snapshots/seattlerb/parse_line_dot2.txt b/test/prism/snapshots/seattlerb/parse_line_dot2.txt new file mode 100644 index 0000000000..3c2cd7a8ca --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_dot2.txt @@ -0,0 +1,49 @@ +@ ProgramNode (location: (1,0)-(5,1)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(5,1)) + └── body: (length: 3) + ├── @ RangeNode (location: (1,0)-(2,1)) + │ ├── left: + │ │ @ IntegerNode (location: (1,0)-(1,1)) + │ │ └── flags: decimal + │ ├── right: + │ │ @ IntegerNode (location: (2,0)-(2,1)) + │ │ └── flags: decimal + │ ├── operator_loc: (1,1)-(1,3) = ".." + │ └── flags: ∅ + ├── @ RangeNode (location: (3,0)-(4,1)) + │ ├── left: + │ │ @ CallNode (location: (3,0)-(3,1)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (3,0)-(3,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "a" + │ ├── right: + │ │ @ CallNode (location: (4,0)-(4,1)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (4,0)-(4,1) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "b" + │ ├── operator_loc: (3,1)-(3,3) = ".." + │ └── flags: ∅ + └── @ CallNode (location: (5,0)-(5,1)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (5,0)-(5,1) = "c" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: variable_call + └── name: "c" diff --git a/test/prism/snapshots/seattlerb/parse_line_dot2_open.txt b/test/prism/snapshots/seattlerb/parse_line_dot2_open.txt new file mode 100644 index 0000000000..03183f59b1 --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_dot2_open.txt @@ -0,0 +1,37 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 3) + ├── @ RangeNode (location: (1,0)-(1,3)) + │ ├── left: + │ │ @ IntegerNode (location: (1,0)-(1,1)) + │ │ └── flags: decimal + │ ├── right: ∅ + │ ├── operator_loc: (1,1)-(1,3) = ".." + │ └── flags: ∅ + ├── @ RangeNode (location: (2,2)-(2,5)) + │ ├── left: + │ │ @ CallNode (location: (2,2)-(2,3)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (2,2)-(2,3) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "a" + │ ├── right: ∅ + │ ├── operator_loc: (2,3)-(2,5) = ".." + │ └── flags: ∅ + └── @ CallNode (location: (3,2)-(3,3)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (3,2)-(3,3) = "c" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: variable_call + └── name: "c" diff --git a/test/prism/snapshots/seattlerb/parse_line_dot3.txt b/test/prism/snapshots/seattlerb/parse_line_dot3.txt new file mode 100644 index 0000000000..cb6d394d76 --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_dot3.txt @@ -0,0 +1,49 @@ +@ ProgramNode (location: (1,0)-(5,1)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(5,1)) + └── body: (length: 3) + ├── @ RangeNode (location: (1,0)-(2,1)) + │ ├── left: + │ │ @ IntegerNode (location: (1,0)-(1,1)) + │ │ └── flags: decimal + │ ├── right: + │ │ @ IntegerNode (location: (2,0)-(2,1)) + │ │ └── flags: decimal + │ ├── operator_loc: (1,1)-(1,4) = "..." + │ └── flags: exclude_end + ├── @ RangeNode (location: (3,0)-(4,1)) + │ ├── left: + │ │ @ CallNode (location: (3,0)-(3,1)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (3,0)-(3,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "a" + │ ├── right: + │ │ @ CallNode (location: (4,0)-(4,1)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (4,0)-(4,1) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "b" + │ ├── operator_loc: (3,1)-(3,4) = "..." + │ └── flags: exclude_end + └── @ CallNode (location: (5,0)-(5,1)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (5,0)-(5,1) = "c" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: variable_call + └── name: "c" diff --git a/test/prism/snapshots/seattlerb/parse_line_dot3_open.txt b/test/prism/snapshots/seattlerb/parse_line_dot3_open.txt new file mode 100644 index 0000000000..ec9b0f8f82 --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_dot3_open.txt @@ -0,0 +1,37 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 3) + ├── @ RangeNode (location: (1,0)-(1,4)) + │ ├── left: + │ │ @ IntegerNode (location: (1,0)-(1,1)) + │ │ └── flags: decimal + │ ├── right: ∅ + │ ├── operator_loc: (1,1)-(1,4) = "..." + │ └── flags: exclude_end + ├── @ RangeNode (location: (2,2)-(2,6)) + │ ├── left: + │ │ @ CallNode (location: (2,2)-(2,3)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (2,2)-(2,3) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "a" + │ ├── right: ∅ + │ ├── operator_loc: (2,3)-(2,6) = "..." + │ └── flags: exclude_end + └── @ CallNode (location: (3,2)-(3,3)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (3,2)-(3,3) = "c" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: variable_call + └── name: "c" diff --git a/test/prism/snapshots/seattlerb/parse_line_dstr_escaped_newline.txt b/test/prism/snapshots/seattlerb/parse_line_dstr_escaped_newline.txt new file mode 100644 index 0000000000..e135d31a25 --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_dstr_escaped_newline.txt @@ -0,0 +1,20 @@ +@ ProgramNode (location: (1,0)-(3,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,4)) + └── body: (length: 2) + ├── @ InterpolatedStringNode (location: (1,0)-(2,2)) + │ ├── opening_loc: (1,0)-(1,1) = "\"" + │ ├── parts: (length: 2) + │ │ ├── @ StringNode (location: (1,1)-(1,4)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (1,1)-(1,4) = "a\\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a\n" + │ │ └── @ EmbeddedStatementsNode (location: (1,4)-(2,1)) + │ │ ├── opening_loc: (1,4)-(1,6) = "\#{" + │ │ ├── statements: ∅ + │ │ └── closing_loc: (2,0)-(2,1) = "}" + │ └── closing_loc: (2,1)-(2,2) = "\"" + └── @ TrueNode (location: (3,0)-(3,4)) diff --git a/test/prism/snapshots/seattlerb/parse_line_dstr_soft_newline.txt b/test/prism/snapshots/seattlerb/parse_line_dstr_soft_newline.txt new file mode 100644 index 0000000000..6f881c15f9 --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_dstr_soft_newline.txt @@ -0,0 +1,20 @@ +@ ProgramNode (location: (1,0)-(4,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,4)) + └── body: (length: 2) + ├── @ InterpolatedStringNode (location: (1,0)-(3,2)) + │ ├── opening_loc: (1,0)-(1,1) = "\"" + │ ├── parts: (length: 2) + │ │ ├── @ StringNode (location: (1,1)-(1,0)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (1,1)-(1,0) = "a\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a\n" + │ │ └── @ EmbeddedStatementsNode (location: (2,0)-(3,1)) + │ │ ├── opening_loc: (2,0)-(2,2) = "\#{" + │ │ ├── statements: ∅ + │ │ └── closing_loc: (3,0)-(3,1) = "}" + │ └── closing_loc: (3,1)-(3,2) = "\"" + └── @ TrueNode (location: (4,0)-(4,4)) diff --git a/test/prism/snapshots/seattlerb/parse_line_evstr_after_break.txt b/test/prism/snapshots/seattlerb/parse_line_evstr_after_break.txt new file mode 100644 index 0000000000..931556aabc --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_evstr_after_break.txt @@ -0,0 +1,34 @@ +@ ProgramNode (location: (1,0)-(2,6)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,6)) + └── body: (length: 1) + └── @ StringConcatNode (location: (1,0)-(2,6)) + ├── left: + │ @ StringNode (location: (1,0)-(1,3)) + │ ├── flags: ∅ + │ ├── opening_loc: (1,0)-(1,1) = "\"" + │ ├── content_loc: (1,1)-(1,2) = "a" + │ ├── closing_loc: (1,2)-(1,3) = "\"" + │ └── unescaped: "a" + └── right: + @ InterpolatedStringNode (location: (2,0)-(2,6)) + ├── opening_loc: (2,0)-(2,1) = "\"" + ├── parts: (length: 1) + │ └── @ EmbeddedStatementsNode (location: (2,1)-(2,5)) + │ ├── opening_loc: (2,1)-(2,3) = "\#{" + │ ├── statements: + │ │ @ StatementsNode (location: (2,3)-(2,4)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (2,3)-(2,4)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (2,3)-(2,4) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "b" + │ └── closing_loc: (2,4)-(2,5) = "}" + └── closing_loc: (2,5)-(2,6) = "\"" diff --git a/test/prism/snapshots/seattlerb/parse_line_hash_lit.txt b/test/prism/snapshots/seattlerb/parse_line_hash_lit.txt new file mode 100644 index 0000000000..b29f36bf22 --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_hash_lit.txt @@ -0,0 +1,20 @@ +@ ProgramNode (location: (1,0)-(3,1)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,1)) + └── body: (length: 1) + └── @ HashNode (location: (1,0)-(3,1)) + ├── opening_loc: (1,0)-(1,1) = "{" + ├── elements: (length: 1) + │ └── @ AssocNode (location: (2,0)-(2,8)) + │ ├── key: + │ │ @ SymbolNode (location: (2,0)-(2,3)) + │ │ ├── opening_loc: (2,0)-(2,1) = ":" + │ │ ├── value_loc: (2,1)-(2,3) = "s1" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "s1" + │ ├── value: + │ │ @ IntegerNode (location: (2,7)-(2,8)) + │ │ └── flags: decimal + │ └── operator_loc: (2,4)-(2,6) = "=>" + └── closing_loc: (3,0)-(3,1) = "}" diff --git a/test/prism/snapshots/seattlerb/parse_line_heredoc.txt b/test/prism/snapshots/seattlerb/parse_line_heredoc.txt new file mode 100644 index 0000000000..47a4f82f16 --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_heredoc.txt @@ -0,0 +1,42 @@ +@ ProgramNode (location: (1,6)-(4,17)) +├── locals: [:string] +└── statements: + @ StatementsNode (location: (1,6)-(4,17)) + └── body: (length: 2) + ├── @ LocalVariableWriteNode (location: (1,6)-(1,31)) + │ ├── name: :string + │ ├── depth: 0 + │ ├── name_loc: (1,6)-(1,12) = "string" + │ ├── value: + │ │ @ CallNode (location: (1,15)-(1,31)) + │ │ ├── receiver: + │ │ │ @ StringNode (location: (1,15)-(1,25)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (1,15)-(1,25) = "<<-HEREDOC" + │ │ │ ├── content_loc: (2,0)-(2,0) = " very long string\n" + │ │ │ ├── closing_loc: (3,0)-(3,0) = " HEREDOC\n" + │ │ │ └── unescaped: " very long string\n" + │ │ ├── call_operator_loc: (1,25)-(1,26) = "." + │ │ ├── message_loc: (1,26)-(1,31) = "strip" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: ∅ + │ │ └── name: "strip" + │ └── operator_loc: (1,13)-(1,14) = "=" + └── @ CallNode (location: (4,6)-(4,17)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (4,6)-(4,10) = "puts" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (4,11)-(4,17)) + │ └── arguments: (length: 1) + │ └── @ LocalVariableReadNode (location: (4,11)-(4,17)) + │ ├── name: :string + │ └── depth: 0 + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "puts" diff --git a/test/prism/snapshots/seattlerb/parse_line_heredoc_evstr.txt b/test/prism/snapshots/seattlerb/parse_line_heredoc_evstr.txt new file mode 100644 index 0000000000..d32f4fa7a1 --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_heredoc_evstr.txt @@ -0,0 +1,37 @@ +@ ProgramNode (location: (1,0)-(1,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,4)) + └── body: (length: 1) + └── @ InterpolatedStringNode (location: (1,0)-(1,4)) + ├── opening_loc: (1,0)-(1,4) = "<<-A" + ├── parts: (length: 3) + │ ├── @ StringNode (location: (2,0)-(2,0)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (2,0)-(2,0) = "a\n" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a\n" + │ ├── @ EmbeddedStatementsNode (location: (3,0)-(3,4)) + │ │ ├── opening_loc: (3,0)-(3,2) = "\#{" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (3,2)-(3,3)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (3,2)-(3,3)) + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── message_loc: (3,2)-(3,3) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── block: ∅ + │ │ │ ├── flags: variable_call + │ │ │ └── name: "b" + │ │ └── closing_loc: (3,3)-(3,4) = "}" + │ └── @ StringNode (location: (3,4)-(3,0)) + │ ├── flags: ∅ + │ ├── opening_loc: ∅ + │ ├── content_loc: (3,4)-(3,0) = "\n" + │ ├── closing_loc: ∅ + │ └── unescaped: "\n" + └── closing_loc: (4,0)-(4,0) = "A\n" diff --git a/test/prism/snapshots/seattlerb/parse_line_heredoc_hardnewline.txt b/test/prism/snapshots/seattlerb/parse_line_heredoc_hardnewline.txt new file mode 100644 index 0000000000..230de59dd6 --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_heredoc_hardnewline.txt @@ -0,0 +1,22 @@ +@ ProgramNode (location: (1,0)-(6,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(6,3)) + └── body: (length: 2) + ├── @ StringNode (location: (1,0)-(1,8)) + │ ├── flags: ∅ + │ ├── opening_loc: (1,0)-(1,8) = "<<-EOFOO" + │ ├── content_loc: (2,0)-(2,0) = "\\n\\n\\n\\n\\n\\n\\n\\n\\n\n" + │ ├── closing_loc: (3,0)-(3,0) = "EOFOO\n" + │ └── unescaped: "\n\n\n\n\n\n\n\n\n\n" + └── @ ClassNode (location: (5,0)-(6,3)) + ├── locals: [] + ├── class_keyword_loc: (5,0)-(5,5) = "class" + ├── constant_path: + │ @ ConstantReadNode (location: (5,6)-(5,9)) + │ └── name: :Foo + ├── inheritance_operator_loc: ∅ + ├── superclass: ∅ + ├── body: ∅ + ├── end_keyword_loc: (6,0)-(6,3) = "end" + └── name: :Foo diff --git a/test/prism/snapshots/seattlerb/parse_line_heredoc_regexp_chars.txt b/test/prism/snapshots/seattlerb/parse_line_heredoc_regexp_chars.txt new file mode 100644 index 0000000000..f351c424f0 --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_heredoc_regexp_chars.txt @@ -0,0 +1,32 @@ +@ ProgramNode (location: (1,6)-(4,17)) +├── locals: [:string] +└── statements: + @ StatementsNode (location: (1,6)-(4,17)) + └── body: (length: 2) + ├── @ LocalVariableWriteNode (location: (1,6)-(1,22)) + │ ├── name: :string + │ ├── depth: 0 + │ ├── name_loc: (1,6)-(1,12) = "string" + │ ├── value: + │ │ @ StringNode (location: (1,15)-(1,22)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (1,15)-(1,22) = "<<-\"^D\"" + │ │ ├── content_loc: (2,0)-(2,0) = " very long string\n" + │ │ ├── closing_loc: (3,0)-(3,0) = " ^D\n" + │ │ └── unescaped: " very long string\n" + │ └── operator_loc: (1,13)-(1,14) = "=" + └── @ CallNode (location: (4,6)-(4,17)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (4,6)-(4,10) = "puts" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (4,11)-(4,17)) + │ └── arguments: (length: 1) + │ └── @ LocalVariableReadNode (location: (4,11)-(4,17)) + │ ├── name: :string + │ └── depth: 0 + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "puts" diff --git a/test/prism/snapshots/seattlerb/parse_line_iter_call_no_parens.txt b/test/prism/snapshots/seattlerb/parse_line_iter_call_no_parens.txt new file mode 100644 index 0000000000..f4c6adaf93 --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_iter_call_no_parens.txt @@ -0,0 +1,70 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(3,3)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,3)) + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (1,2)-(1,3)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,2)-(1,3) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "a" + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,4)-(3,3)) + │ ├── locals: [:x, :y] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,7)-(1,13)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,8)-(1,12)) + │ │ │ ├── requireds: (length: 2) + │ │ │ │ ├── @ RequiredParameterNode (location: (1,8)-(1,9)) + │ │ │ │ │ └── name: :x + │ │ │ │ └── @ RequiredParameterNode (location: (1,11)-(1,12)) + │ │ │ │ └── name: :y + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,7)-(1,8) = "|" + │ │ └── closing_loc: (1,12)-(1,13) = "|" + │ ├── body: + │ │ @ StatementsNode (location: (2,2)-(2,7)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (2,2)-(2,7)) + │ │ ├── receiver: + │ │ │ @ LocalVariableReadNode (location: (2,2)-(2,3)) + │ │ │ ├── name: :x + │ │ │ └── depth: 0 + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (2,4)-(2,5) = "+" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (2,6)-(2,7)) + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ LocalVariableReadNode (location: (2,6)-(2,7)) + │ │ │ ├── name: :y + │ │ │ └── depth: 0 + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: ∅ + │ │ └── name: "+" + │ ├── opening_loc: (1,4)-(1,6) = "do" + │ └── closing_loc: (3,0)-(3,3) = "end" + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/parse_line_iter_call_parens.txt b/test/prism/snapshots/seattlerb/parse_line_iter_call_parens.txt new file mode 100644 index 0000000000..f5240a5534 --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_iter_call_parens.txt @@ -0,0 +1,70 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(3,3)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: (1,1)-(1,2) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,3)) + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (1,2)-(1,3)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,2)-(1,3) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "a" + ├── closing_loc: (1,3)-(1,4) = ")" + ├── block: + │ @ BlockNode (location: (1,5)-(3,3)) + │ ├── locals: [:x, :y] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,8)-(1,14)) + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (1,9)-(1,13)) + │ │ │ ├── requireds: (length: 2) + │ │ │ │ ├── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ │ │ └── name: :x + │ │ │ │ └── @ RequiredParameterNode (location: (1,12)-(1,13)) + │ │ │ │ └── name: :y + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,8)-(1,9) = "|" + │ │ └── closing_loc: (1,13)-(1,14) = "|" + │ ├── body: + │ │ @ StatementsNode (location: (2,2)-(2,7)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (2,2)-(2,7)) + │ │ ├── receiver: + │ │ │ @ LocalVariableReadNode (location: (2,2)-(2,3)) + │ │ │ ├── name: :x + │ │ │ └── depth: 0 + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (2,4)-(2,5) = "+" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (2,6)-(2,7)) + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ LocalVariableReadNode (location: (2,6)-(2,7)) + │ │ │ ├── name: :y + │ │ │ └── depth: 0 + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: ∅ + │ │ └── name: "+" + │ ├── opening_loc: (1,5)-(1,7) = "do" + │ └── closing_loc: (3,0)-(3,3) = "end" + ├── flags: ∅ + └── name: "f" diff --git a/test/prism/snapshots/seattlerb/parse_line_multiline_str.txt b/test/prism/snapshots/seattlerb/parse_line_multiline_str.txt new file mode 100644 index 0000000000..fa8c491047 --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_multiline_str.txt @@ -0,0 +1,13 @@ +@ ProgramNode (location: (1,0)-(3,1)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,1)) + └── body: (length: 2) + ├── @ StringNode (location: (1,0)-(2,2)) + │ ├── flags: ∅ + │ ├── opening_loc: (1,0)-(1,1) = "\"" + │ ├── content_loc: (1,1)-(2,1) = "a\nb" + │ ├── closing_loc: (2,1)-(2,2) = "\"" + │ └── unescaped: "a\nb" + └── @ IntegerNode (location: (3,0)-(3,1)) + └── flags: decimal diff --git a/test/prism/snapshots/seattlerb/parse_line_multiline_str_literal_n.txt b/test/prism/snapshots/seattlerb/parse_line_multiline_str_literal_n.txt new file mode 100644 index 0000000000..c72b516baa --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_multiline_str_literal_n.txt @@ -0,0 +1,13 @@ +@ ProgramNode (location: (1,0)-(2,1)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,1)) + └── body: (length: 2) + ├── @ StringNode (location: (1,0)-(1,6)) + │ ├── flags: ∅ + │ ├── opening_loc: (1,0)-(1,1) = "\"" + │ ├── content_loc: (1,1)-(1,5) = "a\\nb" + │ ├── closing_loc: (1,5)-(1,6) = "\"" + │ └── unescaped: "a\nb" + └── @ IntegerNode (location: (2,0)-(2,1)) + └── flags: decimal diff --git a/test/prism/snapshots/seattlerb/parse_line_newlines.txt b/test/prism/snapshots/seattlerb/parse_line_newlines.txt new file mode 100644 index 0000000000..3e1ceef586 --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_newlines.txt @@ -0,0 +1,6 @@ +@ ProgramNode (location: (1,0)-(1,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,4)) + └── body: (length: 1) + └── @ TrueNode (location: (1,0)-(1,4)) diff --git a/test/prism/snapshots/seattlerb/parse_line_op_asgn.txt b/test/prism/snapshots/seattlerb/parse_line_op_asgn.txt new file mode 100644 index 0000000000..e10f376dac --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_op_asgn.txt @@ -0,0 +1,32 @@ +@ ProgramNode (location: (1,6)-(3,9)) +├── locals: [:foo] +└── statements: + @ StatementsNode (location: (1,6)-(3,9)) + └── body: (length: 2) + ├── @ LocalVariableOperatorWriteNode (location: (1,6)-(2,11)) + │ ├── name_loc: (1,6)-(1,9) = "foo" + │ ├── operator_loc: (1,10)-(1,12) = "+=" + │ ├── value: + │ │ @ CallNode (location: (2,8)-(2,11)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (2,8)-(2,11) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "bar" + │ ├── name: :foo + │ ├── operator: :+ + │ └── depth: 0 + └── @ CallNode (location: (3,6)-(3,9)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (3,6)-(3,9) = "baz" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: variable_call + └── name: "baz" diff --git a/test/prism/snapshots/seattlerb/parse_line_postexe.txt b/test/prism/snapshots/seattlerb/parse_line_postexe.txt new file mode 100644 index 0000000000..507fba834b --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_postexe.txt @@ -0,0 +1,22 @@ +@ ProgramNode (location: (1,0)-(3,1)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,1)) + └── body: (length: 1) + └── @ PostExecutionNode (location: (1,0)-(3,1)) + ├── statements: + │ @ StatementsNode (location: (2,0)-(2,3)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (2,0)-(2,3)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (2,0)-(2,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "foo" + ├── keyword_loc: (1,0)-(1,3) = "END" + ├── opening_loc: (1,4)-(1,5) = "{" + └── closing_loc: (3,0)-(3,1) = "}" diff --git a/test/prism/snapshots/seattlerb/parse_line_preexe.txt b/test/prism/snapshots/seattlerb/parse_line_preexe.txt new file mode 100644 index 0000000000..3b2f75fdd0 --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_preexe.txt @@ -0,0 +1,22 @@ +@ ProgramNode (location: (1,0)-(3,1)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,1)) + └── body: (length: 1) + └── @ PreExecutionNode (location: (1,0)-(3,1)) + ├── statements: + │ @ StatementsNode (location: (2,0)-(2,3)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (2,0)-(2,3)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (2,0)-(2,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "foo" + ├── keyword_loc: (1,0)-(1,5) = "BEGIN" + ├── opening_loc: (1,6)-(1,7) = "{" + └── closing_loc: (3,0)-(3,1) = "}" diff --git a/test/prism/snapshots/seattlerb/parse_line_rescue.txt b/test/prism/snapshots/seattlerb/parse_line_rescue.txt new file mode 100644 index 0000000000..4b4de20405 --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_rescue.txt @@ -0,0 +1,62 @@ +@ ProgramNode (location: (1,0)-(7,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(7,3)) + └── body: (length: 1) + └── @ BeginNode (location: (1,0)-(7,3)) + ├── begin_keyword_loc: (1,0)-(1,5) = "begin" + ├── statements: + │ @ StatementsNode (location: (2,2)-(2,3)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (2,2)-(2,3)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (2,2)-(2,3) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "a" + ├── rescue_clause: + │ @ RescueNode (location: (3,0)-(6,3)) + │ ├── keyword_loc: (3,0)-(3,6) = "rescue" + │ ├── exceptions: (length: 0) + │ ├── operator_loc: ∅ + │ ├── reference: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (4,2)-(4,3)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (4,2)-(4,3)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (4,2)-(4,3) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "b" + │ └── consequent: + │ @ RescueNode (location: (5,0)-(6,3)) + │ ├── keyword_loc: (5,0)-(5,6) = "rescue" + │ ├── exceptions: (length: 0) + │ ├── operator_loc: ∅ + │ ├── reference: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (6,2)-(6,3)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (6,2)-(6,3)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (6,2)-(6,3) = "c" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "c" + │ └── consequent: ∅ + ├── else_clause: ∅ + ├── ensure_clause: ∅ + └── end_keyword_loc: (7,0)-(7,3) = "end" diff --git a/test/prism/snapshots/seattlerb/parse_line_return.txt b/test/prism/snapshots/seattlerb/parse_line_return.txt new file mode 100644 index 0000000000..129b96d837 --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_return.txt @@ -0,0 +1,36 @@ +@ ProgramNode (location: (1,6)-(5,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,6)-(5,9)) + └── body: (length: 1) + └── @ DefNode (location: (1,6)-(5,9)) + ├── name: :blah + ├── name_loc: (1,10)-(1,14) = "blah" + ├── receiver: ∅ + ├── parameters: ∅ + ├── body: + │ @ StatementsNode (location: (2,8)-(4,11)) + │ └── body: (length: 1) + │ └── @ IfNode (location: (2,8)-(4,11)) + │ ├── if_keyword_loc: (2,8)-(2,10) = "if" + │ ├── predicate: + │ │ @ TrueNode (location: (2,11)-(2,15)) + │ ├── statements: + │ │ @ StatementsNode (location: (3,10)-(3,19)) + │ │ └── body: (length: 1) + │ │ └── @ ReturnNode (location: (3,10)-(3,19)) + │ │ ├── keyword_loc: (3,10)-(3,16) = "return" + │ │ └── arguments: + │ │ @ ArgumentsNode (location: (3,17)-(3,19)) + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (3,17)-(3,19)) + │ │ └── flags: decimal + │ ├── consequent: ∅ + │ └── end_keyword_loc: (4,8)-(4,11) = "end" + ├── locals: [] + ├── def_keyword_loc: (1,6)-(1,9) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── equal_loc: ∅ + └── end_keyword_loc: (5,6)-(5,9) = "end" diff --git a/test/prism/snapshots/seattlerb/parse_line_str_with_newline_escape.txt b/test/prism/snapshots/seattlerb/parse_line_str_with_newline_escape.txt new file mode 100644 index 0000000000..29f76ea9ba --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_str_with_newline_escape.txt @@ -0,0 +1,24 @@ +@ ProgramNode (location: (1,0)-(1,13)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,13)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,13)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: (1,1)-(1,2) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,12)) + │ └── arguments: (length: 2) + │ ├── @ StringNode (location: (1,2)-(1,6)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (1,2)-(1,3) = "\"" + │ │ ├── content_loc: (1,3)-(1,5) = "\\n" + │ │ ├── closing_loc: (1,5)-(1,6) = "\"" + │ │ └── unescaped: "\n" + │ └── @ TrueNode (location: (1,8)-(1,12)) + ├── closing_loc: (1,12)-(1,13) = ")" + ├── block: ∅ + ├── flags: ∅ + └── name: "a" diff --git a/test/prism/snapshots/seattlerb/parse_line_to_ary.txt b/test/prism/snapshots/seattlerb/parse_line_to_ary.txt new file mode 100644 index 0000000000..dffbdcbcd0 --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_to_ary.txt @@ -0,0 +1,37 @@ +@ ProgramNode (location: (1,0)-(3,1)) +├── locals: [:a, :b] +└── statements: + @ StatementsNode (location: (1,0)-(3,1)) + └── body: (length: 2) + ├── @ MultiWriteNode (location: (1,0)-(2,5)) + │ ├── targets: (length: 2) + │ │ ├── @ LocalVariableTargetNode (location: (1,0)-(1,1)) + │ │ │ ├── name: :a + │ │ │ └── depth: 0 + │ │ └── @ LocalVariableTargetNode (location: (2,0)-(2,1)) + │ │ ├── name: :b + │ │ └── depth: 0 + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── operator_loc: (2,2)-(2,3) = "=" + │ └── value: + │ @ CallNode (location: (2,4)-(2,5)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (2,4)-(2,5) = "c" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "c" + └── @ CallNode (location: (3,0)-(3,1)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (3,0)-(3,1) = "d" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: variable_call + └── name: "d" diff --git a/test/prism/snapshots/seattlerb/parse_line_trailing_newlines.txt b/test/prism/snapshots/seattlerb/parse_line_trailing_newlines.txt new file mode 100644 index 0000000000..cd019a3045 --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_trailing_newlines.txt @@ -0,0 +1,25 @@ +@ ProgramNode (location: (1,0)-(2,1)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,1)) + └── body: (length: 2) + ├── @ CallNode (location: (1,0)-(1,1)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "a" + └── @ CallNode (location: (2,0)-(2,1)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (2,0)-(2,1) = "b" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: variable_call + └── name: "b" diff --git a/test/prism/snapshots/seattlerb/parse_opt_call_args_assocs_comma.txt b/test/prism/snapshots/seattlerb/parse_opt_call_args_assocs_comma.txt new file mode 100644 index 0000000000..b831cc094a --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_opt_call_args_assocs_comma.txt @@ -0,0 +1,29 @@ +@ ProgramNode (location: (1,0)-(1,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,8)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,8)) + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ └── flags: decimal + ├── call_operator_loc: ∅ + ├── message_loc: (1,1)-(1,8) = "[2=>3,]" + ├── opening_loc: (1,1)-(1,2) = "[" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,6)) + │ └── arguments: (length: 1) + │ └── @ KeywordHashNode (location: (1,2)-(1,6)) + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (1,2)-(1,6)) + │ ├── key: + │ │ @ IntegerNode (location: (1,2)-(1,3)) + │ │ └── flags: decimal + │ ├── value: + │ │ @ IntegerNode (location: (1,5)-(1,6)) + │ │ └── flags: decimal + │ └── operator_loc: (1,3)-(1,5) = "=>" + ├── closing_loc: (1,7)-(1,8) = "]" + ├── block: ∅ + ├── flags: ∅ + └── name: "[]" diff --git a/test/prism/snapshots/seattlerb/parse_opt_call_args_lit_comma.txt b/test/prism/snapshots/seattlerb/parse_opt_call_args_lit_comma.txt new file mode 100644 index 0000000000..9e61b425fc --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_opt_call_args_lit_comma.txt @@ -0,0 +1,21 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,5)) + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ └── flags: decimal + ├── call_operator_loc: ∅ + ├── message_loc: (1,1)-(1,5) = "[2,]" + ├── opening_loc: (1,1)-(1,2) = "[" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,3)) + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,2)-(1,3)) + │ └── flags: decimal + ├── closing_loc: (1,4)-(1,5) = "]" + ├── block: ∅ + ├── flags: ∅ + └── name: "[]" diff --git a/test/prism/snapshots/seattlerb/parse_pattern_019.txt b/test/prism/snapshots/seattlerb/parse_pattern_019.txt new file mode 100644 index 0000000000..e3bf981ded --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_pattern_019.txt @@ -0,0 +1,30 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CaseNode (location: (1,0)-(4,3)) + ├── predicate: + │ @ IntegerNode (location: (1,5)-(1,6)) + │ └── flags: decimal + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,0)-(3,6)) + │ ├── pattern: + │ │ @ RangeNode (location: (2,3)-(2,8)) + │ │ ├── left: + │ │ │ @ IntegerNode (location: (2,3)-(2,5)) + │ │ │ └── flags: decimal + │ │ ├── right: + │ │ │ @ IntegerNode (location: (2,7)-(2,8)) + │ │ │ └── flags: decimal + │ │ ├── operator_loc: (2,5)-(2,7) = ".." + │ │ └── flags: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (3,2)-(3,6)) + │ │ └── body: (length: 1) + │ │ └── @ TrueNode (location: (3,2)-(3,6)) + │ ├── in_loc: (2,0)-(2,2) = "in" + │ └── then_loc: ∅ + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (4,0)-(4,3) = "end" diff --git a/test/prism/snapshots/seattlerb/parse_pattern_044.txt b/test/prism/snapshots/seattlerb/parse_pattern_044.txt new file mode 100644 index 0000000000..6d4dee139c --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_pattern_044.txt @@ -0,0 +1,38 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CaseNode (location: (1,0)-(4,3)) + ├── predicate: + │ @ CallNode (location: (1,5)-(1,8)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,5)-(1,8) = "obj" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "obj" + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,0)-(3,6)) + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (2,3)-(2,11)) + │ │ ├── constant: + │ │ │ @ ConstantReadNode (location: (2,3)-(2,9)) + │ │ │ └── name: :Object + │ │ ├── requireds: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── opening_loc: (2,9)-(2,10) = "[" + │ │ └── closing_loc: (2,10)-(2,11) = "]" + │ ├── statements: + │ │ @ StatementsNode (location: (3,2)-(3,6)) + │ │ └── body: (length: 1) + │ │ └── @ TrueNode (location: (3,2)-(3,6)) + │ ├── in_loc: (2,0)-(2,2) = "in" + │ └── then_loc: ∅ + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (4,0)-(4,3) = "end" diff --git a/test/prism/snapshots/seattlerb/parse_pattern_051.txt b/test/prism/snapshots/seattlerb/parse_pattern_051.txt new file mode 100644 index 0000000000..5d95d71701 --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_pattern_051.txt @@ -0,0 +1,40 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CaseNode (location: (1,0)-(4,3)) + ├── predicate: + │ @ ArrayNode (location: (1,5)-(1,14)) + │ ├── elements: (length: 3) + │ │ ├── @ IntegerNode (location: (1,6)-(1,7)) + │ │ │ └── flags: decimal + │ │ ├── @ IntegerNode (location: (1,9)-(1,10)) + │ │ │ └── flags: decimal + │ │ └── @ IntegerNode (location: (1,12)-(1,13)) + │ │ └── flags: decimal + │ ├── opening_loc: (1,5)-(1,6) = "[" + │ └── closing_loc: (1,13)-(1,14) = "]" + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,0)-(3,6)) + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (2,3)-(2,10)) + │ │ ├── constant: ∅ + │ │ ├── requireds: (length: 2) + │ │ │ ├── @ IntegerNode (location: (2,4)-(2,5)) + │ │ │ │ └── flags: decimal + │ │ │ └── @ IntegerNode (location: (2,7)-(2,8)) + │ │ │ └── flags: decimal + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── opening_loc: (2,3)-(2,4) = "[" + │ │ └── closing_loc: (2,9)-(2,10) = "]" + │ ├── statements: + │ │ @ StatementsNode (location: (3,2)-(3,6)) + │ │ └── body: (length: 1) + │ │ └── @ TrueNode (location: (3,2)-(3,6)) + │ ├── in_loc: (2,0)-(2,2) = "in" + │ └── then_loc: ∅ + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (4,0)-(4,3) = "end" diff --git a/test/prism/snapshots/seattlerb/parse_pattern_058.txt b/test/prism/snapshots/seattlerb/parse_pattern_058.txt new file mode 100644 index 0000000000..15010ca250 --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_pattern_058.txt @@ -0,0 +1,64 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [:a, :rest] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CaseNode (location: (1,0)-(4,3)) + ├── predicate: + │ @ HashNode (location: (1,5)-(1,11)) + │ ├── opening_loc: (1,5)-(1,6) = "{" + │ ├── elements: (length: 1) + │ │ └── @ AssocNode (location: (1,6)-(1,10)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (1,6)-(1,8)) + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (1,6)-(1,7) = "a" + │ │ │ ├── closing_loc: (1,7)-(1,8) = ":" + │ │ │ └── unescaped: "a" + │ │ ├── value: + │ │ │ @ IntegerNode (location: (1,9)-(1,10)) + │ │ │ └── flags: decimal + │ │ └── operator_loc: ∅ + │ └── closing_loc: (1,10)-(1,11) = "}" + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,0)-(3,11)) + │ ├── pattern: + │ │ @ HashPatternNode (location: (2,3)-(2,15)) + │ │ ├── constant: ∅ + │ │ ├── assocs: (length: 2) + │ │ │ ├── @ AssocNode (location: (2,4)-(2,6)) + │ │ │ │ ├── key: + │ │ │ │ │ @ SymbolNode (location: (2,4)-(2,6)) + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── value_loc: (2,4)-(2,5) = "a" + │ │ │ │ │ ├── closing_loc: (2,5)-(2,6) = ":" + │ │ │ │ │ └── unescaped: "a" + │ │ │ │ ├── value: ∅ + │ │ │ │ └── operator_loc: ∅ + │ │ │ └── @ AssocSplatNode (location: (2,8)-(2,14)) + │ │ │ ├── value: + │ │ │ │ @ LocalVariableTargetNode (location: (2,10)-(2,14)) + │ │ │ │ ├── name: :rest + │ │ │ │ └── depth: 0 + │ │ │ └── operator_loc: (2,8)-(2,10) = "**" + │ │ ├── kwrest: ∅ + │ │ ├── opening_loc: (2,3)-(2,4) = "{" + │ │ └── closing_loc: (2,14)-(2,15) = "}" + │ ├── statements: + │ │ @ StatementsNode (location: (3,2)-(3,11)) + │ │ └── body: (length: 1) + │ │ └── @ ArrayNode (location: (3,2)-(3,11)) + │ │ ├── elements: (length: 2) + │ │ │ ├── @ LocalVariableReadNode (location: (3,3)-(3,4)) + │ │ │ │ ├── name: :a + │ │ │ │ └── depth: 0 + │ │ │ └── @ LocalVariableReadNode (location: (3,6)-(3,10)) + │ │ │ ├── name: :rest + │ │ │ └── depth: 0 + │ │ ├── opening_loc: (3,2)-(3,3) = "[" + │ │ └── closing_loc: (3,10)-(3,11) = "]" + │ ├── in_loc: (2,0)-(2,2) = "in" + │ └── then_loc: ∅ + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (4,0)-(4,3) = "end" diff --git a/test/prism/snapshots/seattlerb/parse_pattern_058_2.txt b/test/prism/snapshots/seattlerb/parse_pattern_058_2.txt new file mode 100644 index 0000000000..dc89fc3640 --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_pattern_058_2.txt @@ -0,0 +1,58 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [:a] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CaseNode (location: (1,0)-(4,3)) + ├── predicate: + │ @ HashNode (location: (1,5)-(1,11)) + │ ├── opening_loc: (1,5)-(1,6) = "{" + │ ├── elements: (length: 1) + │ │ └── @ AssocNode (location: (1,6)-(1,10)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (1,6)-(1,8)) + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (1,6)-(1,7) = "a" + │ │ │ ├── closing_loc: (1,7)-(1,8) = ":" + │ │ │ └── unescaped: "a" + │ │ ├── value: + │ │ │ @ IntegerNode (location: (1,9)-(1,10)) + │ │ │ └── flags: decimal + │ │ └── operator_loc: ∅ + │ └── closing_loc: (1,10)-(1,11) = "}" + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,0)-(3,5)) + │ ├── pattern: + │ │ @ HashPatternNode (location: (2,3)-(2,11)) + │ │ ├── constant: ∅ + │ │ ├── assocs: (length: 2) + │ │ │ ├── @ AssocNode (location: (2,4)-(2,6)) + │ │ │ │ ├── key: + │ │ │ │ │ @ SymbolNode (location: (2,4)-(2,6)) + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── value_loc: (2,4)-(2,5) = "a" + │ │ │ │ │ ├── closing_loc: (2,5)-(2,6) = ":" + │ │ │ │ │ └── unescaped: "a" + │ │ │ │ ├── value: ∅ + │ │ │ │ └── operator_loc: ∅ + │ │ │ └── @ AssocSplatNode (location: (2,8)-(2,10)) + │ │ │ ├── value: ∅ + │ │ │ └── operator_loc: (2,8)-(2,10) = "**" + │ │ ├── kwrest: ∅ + │ │ ├── opening_loc: (2,3)-(2,4) = "{" + │ │ └── closing_loc: (2,10)-(2,11) = "}" + │ ├── statements: + │ │ @ StatementsNode (location: (3,2)-(3,5)) + │ │ └── body: (length: 1) + │ │ └── @ ArrayNode (location: (3,2)-(3,5)) + │ │ ├── elements: (length: 1) + │ │ │ └── @ LocalVariableReadNode (location: (3,3)-(3,4)) + │ │ │ ├── name: :a + │ │ │ └── depth: 0 + │ │ ├── opening_loc: (3,2)-(3,3) = "[" + │ │ └── closing_loc: (3,4)-(3,5) = "]" + │ ├── in_loc: (2,0)-(2,2) = "in" + │ └── then_loc: ∅ + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (4,0)-(4,3) = "end" diff --git a/test/prism/snapshots/seattlerb/parse_pattern_069.txt b/test/prism/snapshots/seattlerb/parse_pattern_069.txt new file mode 100644 index 0000000000..4d1e51e3f4 --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_pattern_069.txt @@ -0,0 +1,44 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CaseNode (location: (1,0)-(4,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── opening_loc: (1,5)-(1,6) = ":" + │ ├── value_loc: (1,6)-(1,7) = "a" + │ ├── closing_loc: ∅ + │ └── unescaped: "a" + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,0)-(3,3)) + │ ├── pattern: + │ │ @ HashPatternNode (location: (2,3)-(2,15)) + │ │ ├── constant: + │ │ │ @ ConstantReadNode (location: (2,3)-(2,9)) + │ │ │ └── name: :Object + │ │ ├── assocs: (length: 1) + │ │ │ └── @ AssocNode (location: (2,10)-(2,14)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (2,10)-(2,12)) + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (2,10)-(2,11) = "b" + │ │ │ │ ├── closing_loc: (2,11)-(2,12) = ":" + │ │ │ │ └── unescaped: "b" + │ │ │ ├── value: + │ │ │ │ @ IntegerNode (location: (2,13)-(2,14)) + │ │ │ │ └── flags: decimal + │ │ │ └── operator_loc: ∅ + │ │ ├── kwrest: ∅ + │ │ ├── opening_loc: (2,9)-(2,10) = "[" + │ │ └── closing_loc: (2,14)-(2,15) = "]" + │ ├── statements: + │ │ @ StatementsNode (location: (3,2)-(3,3)) + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (3,2)-(3,3)) + │ │ └── flags: decimal + │ ├── in_loc: (2,0)-(2,2) = "in" + │ └── then_loc: ∅ + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (4,0)-(4,3) = "end" diff --git a/test/prism/snapshots/seattlerb/parse_pattern_076.txt b/test/prism/snapshots/seattlerb/parse_pattern_076.txt new file mode 100644 index 0000000000..bce1fdce96 --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_pattern_076.txt @@ -0,0 +1,54 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CaseNode (location: (1,0)-(4,3)) + ├── predicate: + │ @ HashNode (location: (1,5)-(1,11)) + │ ├── opening_loc: (1,5)-(1,6) = "{" + │ ├── elements: (length: 1) + │ │ └── @ AssocNode (location: (1,6)-(1,10)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (1,6)-(1,8)) + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (1,6)-(1,7) = "a" + │ │ │ ├── closing_loc: (1,7)-(1,8) = ":" + │ │ │ └── unescaped: "a" + │ │ ├── value: + │ │ │ @ IntegerNode (location: (1,9)-(1,10)) + │ │ │ └── flags: decimal + │ │ └── operator_loc: ∅ + │ └── closing_loc: (1,10)-(1,11) = "}" + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,0)-(3,6)) + │ ├── pattern: + │ │ @ HashPatternNode (location: (2,3)-(2,16)) + │ │ ├── constant: ∅ + │ │ ├── assocs: (length: 2) + │ │ │ ├── @ AssocNode (location: (2,4)-(2,8)) + │ │ │ │ ├── key: + │ │ │ │ │ @ SymbolNode (location: (2,4)-(2,6)) + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── value_loc: (2,4)-(2,5) = "a" + │ │ │ │ │ ├── closing_loc: (2,5)-(2,6) = ":" + │ │ │ │ │ └── unescaped: "a" + │ │ │ │ ├── value: + │ │ │ │ │ @ IntegerNode (location: (2,7)-(2,8)) + │ │ │ │ │ └── flags: decimal + │ │ │ │ └── operator_loc: ∅ + │ │ │ └── @ NoKeywordsParameterNode (location: (2,10)-(2,15)) + │ │ │ ├── operator_loc: (2,10)-(2,12) = "**" + │ │ │ └── keyword_loc: (2,12)-(2,15) = "nil" + │ │ ├── kwrest: ∅ + │ │ ├── opening_loc: (2,3)-(2,4) = "{" + │ │ └── closing_loc: (2,15)-(2,16) = "}" + │ ├── statements: + │ │ @ StatementsNode (location: (3,2)-(3,6)) + │ │ └── body: (length: 1) + │ │ └── @ TrueNode (location: (3,2)-(3,6)) + │ ├── in_loc: (2,0)-(2,2) = "in" + │ └── then_loc: ∅ + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (4,0)-(4,3) = "end" diff --git a/test/prism/snapshots/seattlerb/parse_until_not_canonical.txt b/test/prism/snapshots/seattlerb/parse_until_not_canonical.txt new file mode 100644 index 0000000000..a6f6be9789 --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_until_not_canonical.txt @@ -0,0 +1,49 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ UntilNode (location: (1,0)-(3,3)) + ├── keyword_loc: (1,0)-(1,5) = "until" + ├── closing_loc: (3,0)-(3,3) = "end" + ├── predicate: + │ @ CallNode (location: (1,6)-(1,18)) + │ ├── receiver: + │ │ @ CallNode (location: (1,10)-(1,18)) + │ │ ├── receiver: + │ │ │ @ CallNode (location: (1,10)-(1,13)) + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── message_loc: (1,10)-(1,13) = "var" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── block: ∅ + │ │ │ ├── flags: variable_call + │ │ │ └── name: "var" + │ │ ├── call_operator_loc: (1,13)-(1,14) = "." + │ │ ├── message_loc: (1,14)-(1,18) = "nil?" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: ∅ + │ │ └── name: "nil?" + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,6)-(1,9) = "not" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "!" + ├── statements: + │ @ StatementsNode (location: (2,2)-(2,7)) + │ └── body: (length: 1) + │ └── @ StringNode (location: (2,2)-(2,7)) + │ ├── flags: ∅ + │ ├── opening_loc: (2,2)-(2,3) = "'" + │ ├── content_loc: (2,3)-(2,6) = "foo" + │ ├── closing_loc: (2,6)-(2,7) = "'" + │ └── unescaped: "foo" + └── flags: ∅ diff --git a/test/prism/snapshots/seattlerb/parse_until_not_noncanonical.txt b/test/prism/snapshots/seattlerb/parse_until_not_noncanonical.txt new file mode 100644 index 0000000000..a6f6be9789 --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_until_not_noncanonical.txt @@ -0,0 +1,49 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ UntilNode (location: (1,0)-(3,3)) + ├── keyword_loc: (1,0)-(1,5) = "until" + ├── closing_loc: (3,0)-(3,3) = "end" + ├── predicate: + │ @ CallNode (location: (1,6)-(1,18)) + │ ├── receiver: + │ │ @ CallNode (location: (1,10)-(1,18)) + │ │ ├── receiver: + │ │ │ @ CallNode (location: (1,10)-(1,13)) + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── message_loc: (1,10)-(1,13) = "var" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── block: ∅ + │ │ │ ├── flags: variable_call + │ │ │ └── name: "var" + │ │ ├── call_operator_loc: (1,13)-(1,14) = "." + │ │ ├── message_loc: (1,14)-(1,18) = "nil?" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: ∅ + │ │ └── name: "nil?" + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,6)-(1,9) = "not" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "!" + ├── statements: + │ @ StatementsNode (location: (2,2)-(2,7)) + │ └── body: (length: 1) + │ └── @ StringNode (location: (2,2)-(2,7)) + │ ├── flags: ∅ + │ ├── opening_loc: (2,2)-(2,3) = "'" + │ ├── content_loc: (2,3)-(2,6) = "foo" + │ ├── closing_loc: (2,6)-(2,7) = "'" + │ └── unescaped: "foo" + └── flags: ∅ diff --git a/test/prism/snapshots/seattlerb/parse_while_not_canonical.txt b/test/prism/snapshots/seattlerb/parse_while_not_canonical.txt new file mode 100644 index 0000000000..d96f4018d7 --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_while_not_canonical.txt @@ -0,0 +1,49 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ WhileNode (location: (1,0)-(3,3)) + ├── keyword_loc: (1,0)-(1,5) = "while" + ├── closing_loc: (3,0)-(3,3) = "end" + ├── predicate: + │ @ CallNode (location: (1,6)-(1,18)) + │ ├── receiver: + │ │ @ CallNode (location: (1,10)-(1,18)) + │ │ ├── receiver: + │ │ │ @ CallNode (location: (1,10)-(1,13)) + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── message_loc: (1,10)-(1,13) = "var" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── block: ∅ + │ │ │ ├── flags: variable_call + │ │ │ └── name: "var" + │ │ ├── call_operator_loc: (1,13)-(1,14) = "." + │ │ ├── message_loc: (1,14)-(1,18) = "nil?" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: ∅ + │ │ └── name: "nil?" + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,6)-(1,9) = "not" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "!" + ├── statements: + │ @ StatementsNode (location: (2,2)-(2,7)) + │ └── body: (length: 1) + │ └── @ StringNode (location: (2,2)-(2,7)) + │ ├── flags: ∅ + │ ├── opening_loc: (2,2)-(2,3) = "'" + │ ├── content_loc: (2,3)-(2,6) = "foo" + │ ├── closing_loc: (2,6)-(2,7) = "'" + │ └── unescaped: "foo" + └── flags: ∅ diff --git a/test/prism/snapshots/seattlerb/parse_while_not_noncanonical.txt b/test/prism/snapshots/seattlerb/parse_while_not_noncanonical.txt new file mode 100644 index 0000000000..d96f4018d7 --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_while_not_noncanonical.txt @@ -0,0 +1,49 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ WhileNode (location: (1,0)-(3,3)) + ├── keyword_loc: (1,0)-(1,5) = "while" + ├── closing_loc: (3,0)-(3,3) = "end" + ├── predicate: + │ @ CallNode (location: (1,6)-(1,18)) + │ ├── receiver: + │ │ @ CallNode (location: (1,10)-(1,18)) + │ │ ├── receiver: + │ │ │ @ CallNode (location: (1,10)-(1,13)) + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── message_loc: (1,10)-(1,13) = "var" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── block: ∅ + │ │ │ ├── flags: variable_call + │ │ │ └── name: "var" + │ │ ├── call_operator_loc: (1,13)-(1,14) = "." + │ │ ├── message_loc: (1,14)-(1,18) = "nil?" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: ∅ + │ │ └── name: "nil?" + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,6)-(1,9) = "not" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "!" + ├── statements: + │ @ StatementsNode (location: (2,2)-(2,7)) + │ └── body: (length: 1) + │ └── @ StringNode (location: (2,2)-(2,7)) + │ ├── flags: ∅ + │ ├── opening_loc: (2,2)-(2,3) = "'" + │ ├── content_loc: (2,3)-(2,6) = "foo" + │ ├── closing_loc: (2,6)-(2,7) = "'" + │ └── unescaped: "foo" + └── flags: ∅ diff --git a/test/prism/snapshots/seattlerb/pctW_lineno.txt b/test/prism/snapshots/seattlerb/pctW_lineno.txt new file mode 100644 index 0000000000..468150529d --- /dev/null +++ b/test/prism/snapshots/seattlerb/pctW_lineno.txt @@ -0,0 +1,51 @@ +@ ProgramNode (location: (1,0)-(5,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(5,11)) + └── body: (length: 1) + └── @ ArrayNode (location: (1,0)-(5,11)) + ├── elements: (length: 7) + │ ├── @ StringNode (location: (1,3)-(1,7)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (1,3)-(1,7) = "a\\nb" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a\nb" + │ ├── @ StringNode (location: (2,0)-(2,1)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (2,0)-(2,1) = "c" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "c" + │ ├── @ StringNode (location: (2,2)-(2,3)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (2,2)-(2,3) = "d" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "d" + │ ├── @ StringNode (location: (3,0)-(4,1)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (3,0)-(4,1) = "e\\\nf" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "ef" + │ ├── @ StringNode (location: (5,0)-(5,2)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (5,0)-(5,2) = "gy" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "gy" + │ ├── @ StringNode (location: (5,3)-(5,6)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (5,3)-(5,6) = "h\\y" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "hy" + │ └── @ StringNode (location: (5,7)-(5,10)) + │ ├── flags: ∅ + │ ├── opening_loc: ∅ + │ ├── content_loc: (5,7)-(5,10) = "i\\y" + │ ├── closing_loc: ∅ + │ └── unescaped: "iy" + ├── opening_loc: (1,0)-(1,3) = "%W(" + └── closing_loc: (5,10)-(5,11) = ")" diff --git a/test/prism/snapshots/seattlerb/pct_Q_backslash_nl.txt b/test/prism/snapshots/seattlerb/pct_Q_backslash_nl.txt new file mode 100644 index 0000000000..02830644e3 --- /dev/null +++ b/test/prism/snapshots/seattlerb/pct_Q_backslash_nl.txt @@ -0,0 +1,11 @@ +@ ProgramNode (location: (1,0)-(2,1)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,1)) + └── body: (length: 1) + └── @ StringNode (location: (1,0)-(2,1)) + ├── flags: ∅ + ├── opening_loc: (1,0)-(1,3) = "%q{" + ├── content_loc: (1,3)-(1,0) = " \\\n" + ├── closing_loc: (2,0)-(2,1) = "}" + └── unescaped: " \\\n" diff --git a/test/prism/snapshots/seattlerb/pct_nl.txt b/test/prism/snapshots/seattlerb/pct_nl.txt new file mode 100644 index 0000000000..147f8d4ce8 --- /dev/null +++ b/test/prism/snapshots/seattlerb/pct_nl.txt @@ -0,0 +1,17 @@ +@ ProgramNode (location: (1,0)-(2,0)) +├── locals: [:x] +└── statements: + @ StatementsNode (location: (1,0)-(2,0)) + └── body: (length: 1) + └── @ LocalVariableWriteNode (location: (1,0)-(2,0)) + ├── name: :x + ├── depth: 0 + ├── name_loc: (1,0)-(1,1) = "x" + ├── value: + │ @ StringNode (location: (1,4)-(2,0)) + │ ├── flags: ∅ + │ ├── opening_loc: (1,4)-(1,0) = "%\n" + │ ├── content_loc: (2,0)-(1,0) = "" + │ ├── closing_loc: (2,0)-(2,0) = "\n" + │ └── unescaped: "" + └── operator_loc: (1,2)-(1,3) = "=" diff --git a/test/prism/snapshots/seattlerb/pct_w_heredoc_interp_nested.txt b/test/prism/snapshots/seattlerb/pct_w_heredoc_interp_nested.txt new file mode 100644 index 0000000000..0b1fd48eca --- /dev/null +++ b/test/prism/snapshots/seattlerb/pct_w_heredoc_interp_nested.txt @@ -0,0 +1,49 @@ +@ ProgramNode (location: (1,0)-(4,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,11)) + └── body: (length: 1) + └── @ ArrayNode (location: (1,0)-(4,11)) + ├── elements: (length: 5) + │ ├── @ StringNode (location: (1,4)-(1,5)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (1,4)-(1,5) = "1" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "1" + │ ├── @ InterpolatedStringNode (location: (1,6)-(1,12)) + │ │ ├── opening_loc: ∅ + │ │ ├── parts: (length: 1) + │ │ │ └── @ EmbeddedStatementsNode (location: (1,6)-(1,12)) + │ │ │ ├── opening_loc: (1,6)-(1,8) = "\#{" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (1,8)-(1,11)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ StringNode (location: (1,8)-(1,11)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: (1,8)-(1,11) = "<<A" + │ │ │ │ ├── content_loc: (2,0)-(2,0) = "2\n" + │ │ │ │ ├── closing_loc: (3,0)-(3,0) = "A\n" + │ │ │ │ └── unescaped: "2\n" + │ │ │ └── closing_loc: (1,11)-(1,12) = "}" + │ │ └── closing_loc: ∅ + │ ├── @ StringNode (location: (1,13)-(1,14)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (1,13)-(1,14) = "3" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "3" + │ ├── @ StringNode (location: (4,6)-(4,7)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (4,6)-(4,7) = "4" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "4" + │ └── @ StringNode (location: (4,8)-(4,9)) + │ ├── flags: ∅ + │ ├── opening_loc: ∅ + │ ├── content_loc: (4,8)-(4,9) = "5" + │ ├── closing_loc: ∅ + │ └── unescaped: "5" + ├── opening_loc: (1,0)-(1,3) = "%W(" + └── closing_loc: (4,10)-(4,11) = ")" diff --git a/test/prism/snapshots/seattlerb/pipe_semicolon.txt b/test/prism/snapshots/seattlerb/pipe_semicolon.txt new file mode 100644 index 0000000000..a102fdd0a1 --- /dev/null +++ b/test/prism/snapshots/seattlerb/pipe_semicolon.txt @@ -0,0 +1,38 @@ +@ ProgramNode (location: (1,0)-(1,18)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,18)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,18)) + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "a" + ├── call_operator_loc: (1,1)-(1,2) = "." + ├── message_loc: (1,2)-(1,3) = "b" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,4)-(1,18)) + │ ├── locals: [:c] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,7)-(1,14)) + │ │ ├── parameters: ∅ + │ │ ├── locals: (length: 1) + │ │ │ └── @ BlockLocalVariableNode (location: (1,11)-(1,12)) + │ │ │ └── name: :c + │ │ ├── opening_loc: (1,7)-(1,8) = "|" + │ │ └── closing_loc: (1,13)-(1,14) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,4)-(1,6) = "do" + │ └── closing_loc: (1,15)-(1,18) = "end" + ├── flags: ∅ + └── name: "b" diff --git a/test/prism/snapshots/seattlerb/pipe_space.txt b/test/prism/snapshots/seattlerb/pipe_space.txt new file mode 100644 index 0000000000..7f3738fd5d --- /dev/null +++ b/test/prism/snapshots/seattlerb/pipe_space.txt @@ -0,0 +1,36 @@ +@ ProgramNode (location: (1,0)-(1,14)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,14)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,14)) + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "a" + ├── call_operator_loc: (1,1)-(1,2) = "." + ├── message_loc: (1,2)-(1,3) = "b" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,4)-(1,14)) + │ ├── locals: [] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,7)-(1,10)) + │ │ ├── parameters: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,7)-(1,8) = "|" + │ │ └── closing_loc: (1,9)-(1,10) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (1,4)-(1,6) = "do" + │ └── closing_loc: (1,11)-(1,14) = "end" + ├── flags: ∅ + └── name: "b" diff --git a/test/prism/snapshots/seattlerb/qWords_space.txt b/test/prism/snapshots/seattlerb/qWords_space.txt new file mode 100644 index 0000000000..db2a56632f --- /dev/null +++ b/test/prism/snapshots/seattlerb/qWords_space.txt @@ -0,0 +1,9 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ ArrayNode (location: (1,0)-(1,5)) + ├── elements: (length: 0) + ├── opening_loc: (1,0)-(1,3) = "%W(" + └── closing_loc: (1,4)-(1,5) = ")" diff --git a/test/prism/snapshots/seattlerb/qsymbols.txt b/test/prism/snapshots/seattlerb/qsymbols.txt new file mode 100644 index 0000000000..ba50680a43 --- /dev/null +++ b/test/prism/snapshots/seattlerb/qsymbols.txt @@ -0,0 +1,24 @@ +@ ProgramNode (location: (1,0)-(1,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,9)) + └── body: (length: 1) + └── @ ArrayNode (location: (1,0)-(1,9)) + ├── elements: (length: 3) + │ ├── @ SymbolNode (location: (1,3)-(1,4)) + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (1,3)-(1,4) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── @ SymbolNode (location: (1,5)-(1,6)) + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (1,5)-(1,6) = "b" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "b" + │ └── @ SymbolNode (location: (1,7)-(1,8)) + │ ├── opening_loc: ∅ + │ ├── value_loc: (1,7)-(1,8) = "c" + │ ├── closing_loc: ∅ + │ └── unescaped: "c" + ├── opening_loc: (1,0)-(1,3) = "%I(" + └── closing_loc: (1,8)-(1,9) = ")" diff --git a/test/prism/snapshots/seattlerb/qsymbols_empty.txt b/test/prism/snapshots/seattlerb/qsymbols_empty.txt new file mode 100644 index 0000000000..dd94a36cc8 --- /dev/null +++ b/test/prism/snapshots/seattlerb/qsymbols_empty.txt @@ -0,0 +1,9 @@ +@ ProgramNode (location: (1,0)-(1,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,4)) + └── body: (length: 1) + └── @ ArrayNode (location: (1,0)-(1,4)) + ├── elements: (length: 0) + ├── opening_loc: (1,0)-(1,3) = "%I(" + └── closing_loc: (1,3)-(1,4) = ")" diff --git a/test/prism/snapshots/seattlerb/qsymbols_empty_space.txt b/test/prism/snapshots/seattlerb/qsymbols_empty_space.txt new file mode 100644 index 0000000000..e851b377d9 --- /dev/null +++ b/test/prism/snapshots/seattlerb/qsymbols_empty_space.txt @@ -0,0 +1,9 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ ArrayNode (location: (1,0)-(1,5)) + ├── elements: (length: 0) + ├── opening_loc: (1,0)-(1,3) = "%I(" + └── closing_loc: (1,4)-(1,5) = ")" diff --git a/test/prism/snapshots/seattlerb/qsymbols_interp.txt b/test/prism/snapshots/seattlerb/qsymbols_interp.txt new file mode 100644 index 0000000000..4c2ffb3393 --- /dev/null +++ b/test/prism/snapshots/seattlerb/qsymbols_interp.txt @@ -0,0 +1,51 @@ +@ ProgramNode (location: (1,0)-(1,15)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,15)) + └── body: (length: 1) + └── @ ArrayNode (location: (1,0)-(1,15)) + ├── elements: (length: 3) + │ ├── @ SymbolNode (location: (1,3)-(1,4)) + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (1,3)-(1,4) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── @ InterpolatedSymbolNode (location: (1,5)-(1,12)) + │ │ ├── opening_loc: ∅ + │ │ ├── parts: (length: 2) + │ │ │ ├── @ StringNode (location: (1,5)-(1,6)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── content_loc: (1,5)-(1,6) = "b" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "b" + │ │ │ └── @ EmbeddedStatementsNode (location: (1,6)-(1,12)) + │ │ │ ├── opening_loc: (1,6)-(1,8) = "\#{" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (1,8)-(1,11)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (1,8)-(1,11)) + │ │ │ │ ├── receiver: + │ │ │ │ │ @ IntegerNode (location: (1,8)-(1,9)) + │ │ │ │ │ └── flags: decimal + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── message_loc: (1,9)-(1,10) = "+" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: + │ │ │ │ │ @ ArgumentsNode (location: (1,10)-(1,11)) + │ │ │ │ │ └── arguments: (length: 1) + │ │ │ │ │ └── @ IntegerNode (location: (1,10)-(1,11)) + │ │ │ │ │ └── flags: decimal + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── block: ∅ + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: "+" + │ │ │ └── closing_loc: (1,11)-(1,12) = "}" + │ │ └── closing_loc: ∅ + │ └── @ SymbolNode (location: (1,13)-(1,14)) + │ ├── opening_loc: ∅ + │ ├── value_loc: (1,13)-(1,14) = "c" + │ ├── closing_loc: ∅ + │ └── unescaped: "c" + ├── opening_loc: (1,0)-(1,3) = "%I(" + └── closing_loc: (1,14)-(1,15) = ")" diff --git a/test/prism/snapshots/seattlerb/quoted_symbol_hash_arg.txt b/test/prism/snapshots/seattlerb/quoted_symbol_hash_arg.txt new file mode 100644 index 0000000000..a5877fac0c --- /dev/null +++ b/test/prism/snapshots/seattlerb/quoted_symbol_hash_arg.txt @@ -0,0 +1,32 @@ +@ ProgramNode (location: (1,0)-(1,12)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,12)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,12)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,4) = "puts" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,5)-(1,12)) + │ └── arguments: (length: 1) + │ └── @ KeywordHashNode (location: (1,5)-(1,12)) + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (1,5)-(1,12)) + │ ├── key: + │ │ @ SymbolNode (location: (1,5)-(1,9)) + │ │ ├── opening_loc: (1,5)-(1,6) = "'" + │ │ ├── value_loc: (1,6)-(1,7) = "a" + │ │ ├── closing_loc: (1,7)-(1,9) = "':" + │ │ └── unescaped: "a" + │ ├── value: + │ │ @ HashNode (location: (1,10)-(1,12)) + │ │ ├── opening_loc: (1,10)-(1,11) = "{" + │ │ ├── elements: (length: 0) + │ │ └── closing_loc: (1,11)-(1,12) = "}" + │ └── operator_loc: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "puts" diff --git a/test/prism/snapshots/seattlerb/quoted_symbol_keys.txt b/test/prism/snapshots/seattlerb/quoted_symbol_keys.txt new file mode 100644 index 0000000000..f7dc2289f3 --- /dev/null +++ b/test/prism/snapshots/seattlerb/quoted_symbol_keys.txt @@ -0,0 +1,23 @@ +@ ProgramNode (location: (1,0)-(1,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,11)) + └── body: (length: 1) + └── @ HashNode (location: (1,0)-(1,11)) + ├── opening_loc: (1,0)-(1,1) = "{" + ├── elements: (length: 1) + │ └── @ AssocNode (location: (1,2)-(1,9)) + │ ├── key: + │ │ @ SymbolNode (location: (1,2)-(1,6)) + │ │ ├── opening_loc: (1,2)-(1,3) = "'" + │ │ ├── value_loc: (1,3)-(1,4) = "a" + │ │ ├── closing_loc: (1,4)-(1,6) = "':" + │ │ └── unescaped: "a" + │ ├── value: + │ │ @ SymbolNode (location: (1,7)-(1,9)) + │ │ ├── opening_loc: (1,7)-(1,8) = ":" + │ │ ├── value_loc: (1,8)-(1,9) = "b" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "b" + │ └── operator_loc: ∅ + └── closing_loc: (1,10)-(1,11) = "}" diff --git a/test/prism/snapshots/seattlerb/qw_escape.txt b/test/prism/snapshots/seattlerb/qw_escape.txt new file mode 100644 index 0000000000..ef60ee32c4 --- /dev/null +++ b/test/prism/snapshots/seattlerb/qw_escape.txt @@ -0,0 +1,11 @@ +@ ProgramNode (location: (1,0)-(1,7)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,7)) + └── body: (length: 1) + └── @ StringNode (location: (1,0)-(1,7)) + ├── flags: ∅ + ├── opening_loc: (1,0)-(1,3) = "%q(" + ├── content_loc: (1,3)-(1,6) = "\u0001\\'" + ├── closing_loc: (1,6)-(1,7) = ")" + └── unescaped: "\u0001'" diff --git a/test/prism/snapshots/seattlerb/qw_escape_term.txt b/test/prism/snapshots/seattlerb/qw_escape_term.txt new file mode 100644 index 0000000000..0677055ad6 --- /dev/null +++ b/test/prism/snapshots/seattlerb/qw_escape_term.txt @@ -0,0 +1,11 @@ +@ ProgramNode (location: (1,0)-(1,26)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,26)) + └── body: (length: 1) + └── @ StringNode (location: (1,0)-(1,26)) + ├── flags: ∅ + ├── opening_loc: (1,0)-(1,3) = "%q|" + ├── content_loc: (1,3)-(1,25) = "blah blah \\| blah blah" + ├── closing_loc: (1,25)-(1,26) = "|" + └── unescaped: "blah blah \\| blah blah" diff --git a/test/prism/snapshots/seattlerb/qwords_empty.txt b/test/prism/snapshots/seattlerb/qwords_empty.txt new file mode 100644 index 0000000000..17ebaf21d9 --- /dev/null +++ b/test/prism/snapshots/seattlerb/qwords_empty.txt @@ -0,0 +1,9 @@ +@ ProgramNode (location: (1,0)-(1,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,4)) + └── body: (length: 1) + └── @ ArrayNode (location: (1,0)-(1,4)) + ├── elements: (length: 0) + ├── opening_loc: (1,0)-(1,3) = "%w(" + └── closing_loc: (1,3)-(1,4) = ")" diff --git a/test/prism/snapshots/seattlerb/read_escape_unicode_curlies.txt b/test/prism/snapshots/seattlerb/read_escape_unicode_curlies.txt new file mode 100644 index 0000000000..4c4b6b9528 --- /dev/null +++ b/test/prism/snapshots/seattlerb/read_escape_unicode_curlies.txt @@ -0,0 +1,11 @@ +@ ProgramNode (location: (1,0)-(1,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,9)) + └── body: (length: 1) + └── @ StringNode (location: (1,0)-(1,9)) + ├── flags: ∅ + ├── opening_loc: (1,0)-(1,1) = "?" + ├── content_loc: (1,1)-(1,9) = "\\u{00a0}" + ├── closing_loc: ∅ + └── unescaped: " " diff --git a/test/prism/snapshots/seattlerb/read_escape_unicode_h4.txt b/test/prism/snapshots/seattlerb/read_escape_unicode_h4.txt new file mode 100644 index 0000000000..4bdf2cd2f9 --- /dev/null +++ b/test/prism/snapshots/seattlerb/read_escape_unicode_h4.txt @@ -0,0 +1,11 @@ +@ ProgramNode (location: (1,0)-(1,7)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,7)) + └── body: (length: 1) + └── @ StringNode (location: (1,0)-(1,7)) + ├── flags: ∅ + ├── opening_loc: (1,0)-(1,1) = "?" + ├── content_loc: (1,1)-(1,7) = "\\u00a0" + ├── closing_loc: ∅ + └── unescaped: " " diff --git a/test/prism/snapshots/seattlerb/regexp.txt b/test/prism/snapshots/seattlerb/regexp.txt new file mode 100644 index 0000000000..fead46a8be --- /dev/null +++ b/test/prism/snapshots/seattlerb/regexp.txt @@ -0,0 +1,35 @@ +@ ProgramNode (location: (1,0)-(9,13)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(9,13)) + └── body: (length: 5) + ├── @ RegularExpressionNode (location: (1,0)-(1,5)) + │ ├── opening_loc: (1,0)-(1,1) = "/" + │ ├── content_loc: (1,1)-(1,4) = "wtf" + │ ├── closing_loc: (1,4)-(1,5) = "/" + │ ├── unescaped: "wtf" + │ └── flags: ∅ + ├── @ RegularExpressionNode (location: (3,0)-(3,6)) + │ ├── opening_loc: (3,0)-(3,1) = "/" + │ ├── content_loc: (3,1)-(3,4) = "wtf" + │ ├── closing_loc: (3,4)-(3,6) = "/m" + │ ├── unescaped: "wtf" + │ └── flags: multi_line + ├── @ RegularExpressionNode (location: (5,0)-(5,6)) + │ ├── opening_loc: (5,0)-(5,1) = "/" + │ ├── content_loc: (5,1)-(5,4) = "wtf" + │ ├── closing_loc: (5,4)-(5,6) = "/n" + │ ├── unescaped: "wtf" + │ └── flags: ascii_8bit + ├── @ RegularExpressionNode (location: (7,0)-(7,7)) + │ ├── opening_loc: (7,0)-(7,1) = "/" + │ ├── content_loc: (7,1)-(7,4) = "wtf" + │ ├── closing_loc: (7,4)-(7,7) = "/nm" + │ ├── unescaped: "wtf" + │ └── flags: multi_line, ascii_8bit + └── @ RegularExpressionNode (location: (9,0)-(9,13)) + ├── opening_loc: (9,0)-(9,1) = "/" + ├── content_loc: (9,1)-(9,4) = "wtf" + ├── closing_loc: (9,4)-(9,13) = "/nmnmnmnm" + ├── unescaped: "wtf" + └── flags: multi_line, ascii_8bit diff --git a/test/prism/snapshots/seattlerb/regexp_esc_C_slash.txt b/test/prism/snapshots/seattlerb/regexp_esc_C_slash.txt new file mode 100644 index 0000000000..3bc991033c --- /dev/null +++ b/test/prism/snapshots/seattlerb/regexp_esc_C_slash.txt @@ -0,0 +1,11 @@ +@ ProgramNode (location: (1,0)-(1,7)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,7)) + └── body: (length: 1) + └── @ RegularExpressionNode (location: (1,0)-(1,7)) + ├── opening_loc: (1,0)-(1,1) = "/" + ├── content_loc: (1,1)-(1,6) = "\\cC\\d" + ├── closing_loc: (1,6)-(1,7) = "/" + ├── unescaped: "\u0003d" + └── flags: ∅ diff --git a/test/prism/snapshots/seattlerb/regexp_esc_u.txt b/test/prism/snapshots/seattlerb/regexp_esc_u.txt new file mode 100644 index 0000000000..adbfe36880 --- /dev/null +++ b/test/prism/snapshots/seattlerb/regexp_esc_u.txt @@ -0,0 +1,11 @@ +@ ProgramNode (location: (1,0)-(1,17)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,17)) + └── body: (length: 1) + └── @ RegularExpressionNode (location: (1,0)-(1,17)) + ├── opening_loc: (1,0)-(1,1) = "/" + ├── content_loc: (1,1)-(1,16) = "[\\u0021-\\u0027]" + ├── closing_loc: (1,16)-(1,17) = "/" + ├── unescaped: "[!-']" + └── flags: ∅ diff --git a/test/prism/snapshots/seattlerb/regexp_escape_extended.txt b/test/prism/snapshots/seattlerb/regexp_escape_extended.txt new file mode 100644 index 0000000000..a8fb9a56f0 --- /dev/null +++ b/test/prism/snapshots/seattlerb/regexp_escape_extended.txt @@ -0,0 +1,11 @@ +@ ProgramNode (location: (1,0)-(1,6)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,6)) + └── body: (length: 1) + └── @ RegularExpressionNode (location: (1,0)-(1,6)) + ├── opening_loc: (1,0)-(1,1) = "/" + ├── content_loc: (1,1)-(1,5) = "\\“" + ├── closing_loc: (1,5)-(1,6) = "/" + ├── unescaped: "“" + └── flags: ∅ diff --git a/test/prism/snapshots/seattlerb/regexp_unicode_curlies.txt b/test/prism/snapshots/seattlerb/regexp_unicode_curlies.txt new file mode 100644 index 0000000000..5e039bd16e --- /dev/null +++ b/test/prism/snapshots/seattlerb/regexp_unicode_curlies.txt @@ -0,0 +1,17 @@ +@ ProgramNode (location: (1,0)-(3,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,8)) + └── body: (length: 2) + ├── @ RegularExpressionNode (location: (1,0)-(1,15)) + │ ├── opening_loc: (1,0)-(1,1) = "/" + │ ├── content_loc: (1,1)-(1,14) = "\\u{c0de babe}" + │ ├── closing_loc: (1,14)-(1,15) = "/" + │ ├── unescaped: "샞몾" + │ └── flags: ∅ + └── @ RegularExpressionNode (location: (3,0)-(3,8)) + ├── opening_loc: (3,0)-(3,1) = "/" + ├── content_loc: (3,1)-(3,7) = "\\u{df}" + ├── closing_loc: (3,7)-(3,8) = "/" + ├── unescaped: "ß" + └── flags: ∅ diff --git a/test/prism/snapshots/seattlerb/required_kwarg_no_value.txt b/test/prism/snapshots/seattlerb/required_kwarg_no_value.txt new file mode 100644 index 0000000000..ccfdab2a14 --- /dev/null +++ b/test/prism/snapshots/seattlerb/required_kwarg_no_value.txt @@ -0,0 +1,34 @@ +@ ProgramNode (location: (1,0)-(2,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,3)) + └── body: (length: 1) + └── @ DefNode (location: (1,0)-(2,3)) + ├── name: :x + ├── name_loc: (1,4)-(1,5) = "x" + ├── receiver: ∅ + ├── parameters: + │ @ ParametersNode (location: (1,6)-(1,12)) + │ ├── requireds: (length: 0) + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 2) + │ │ ├── @ KeywordParameterNode (location: (1,6)-(1,8)) + │ │ │ ├── name: :a + │ │ │ ├── name_loc: (1,6)-(1,8) = "a:" + │ │ │ └── value: ∅ + │ │ └── @ KeywordParameterNode (location: (1,10)-(1,12)) + │ │ ├── name: :b + │ │ ├── name_loc: (1,10)-(1,12) = "b:" + │ │ └── value: ∅ + │ ├── keyword_rest: ∅ + │ └── block: ∅ + ├── body: ∅ + ├── locals: [:a, :b] + ├── def_keyword_loc: (1,0)-(1,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── equal_loc: ∅ + └── end_keyword_loc: (2,0)-(2,3) = "end" diff --git a/test/prism/snapshots/seattlerb/rescue_do_end_ensure_result.txt b/test/prism/snapshots/seattlerb/rescue_do_end_ensure_result.txt new file mode 100644 index 0000000000..e5f1a1e2ab --- /dev/null +++ b/test/prism/snapshots/seattlerb/rescue_do_end_ensure_result.txt @@ -0,0 +1,56 @@ +@ ProgramNode (location: (1,0)-(5,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(5,8)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(5,8)) + ├── receiver: + │ @ CallNode (location: (1,0)-(5,3)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,0)-(1,4) = "proc" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: + │ │ @ BlockNode (location: (1,5)-(5,3)) + │ │ ├── locals: [] + │ │ ├── parameters: ∅ + │ │ ├── body: + │ │ │ @ BeginNode (location: (2,2)-(5,3)) + │ │ │ ├── begin_keyword_loc: ∅ + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (2,2)-(2,8)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ SymbolNode (location: (2,2)-(2,8)) + │ │ │ │ ├── opening_loc: (2,2)-(2,3) = ":" + │ │ │ │ ├── value_loc: (2,3)-(2,8) = "begin" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "begin" + │ │ │ ├── rescue_clause: ∅ + │ │ │ ├── else_clause: ∅ + │ │ │ ├── ensure_clause: + │ │ │ │ @ EnsureNode (location: (3,0)-(5,3)) + │ │ │ │ ├── ensure_keyword_loc: (3,0)-(3,6) = "ensure" + │ │ │ │ ├── statements: + │ │ │ │ │ @ StatementsNode (location: (4,2)-(4,9)) + │ │ │ │ │ └── body: (length: 1) + │ │ │ │ │ └── @ SymbolNode (location: (4,2)-(4,9)) + │ │ │ │ │ ├── opening_loc: (4,2)-(4,3) = ":" + │ │ │ │ │ ├── value_loc: (4,3)-(4,9) = "ensure" + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── unescaped: "ensure" + │ │ │ │ └── end_keyword_loc: (5,0)-(5,3) = "end" + │ │ │ └── end_keyword_loc: (5,0)-(5,3) = "end" + │ │ ├── opening_loc: (1,5)-(1,7) = "do" + │ │ └── closing_loc: (5,0)-(5,3) = "end" + │ ├── flags: ∅ + │ └── name: "proc" + ├── call_operator_loc: (5,3)-(5,4) = "." + ├── message_loc: (5,4)-(5,8) = "call" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "call" diff --git a/test/prism/snapshots/seattlerb/rescue_do_end_no_raise.txt b/test/prism/snapshots/seattlerb/rescue_do_end_no_raise.txt new file mode 100644 index 0000000000..88907d510d --- /dev/null +++ b/test/prism/snapshots/seattlerb/rescue_do_end_no_raise.txt @@ -0,0 +1,71 @@ +@ ProgramNode (location: (1,0)-(9,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(9,3)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(9,3)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,3) = "tap" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,4)-(9,3)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ BeginNode (location: (2,2)-(9,3)) + │ │ ├── begin_keyword_loc: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (2,2)-(2,8)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ SymbolNode (location: (2,2)-(2,8)) + │ │ │ ├── opening_loc: (2,2)-(2,3) = ":" + │ │ │ ├── value_loc: (2,3)-(2,8) = "begin" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "begin" + │ │ ├── rescue_clause: + │ │ │ @ RescueNode (location: (3,0)-(4,9)) + │ │ │ ├── keyword_loc: (3,0)-(3,6) = "rescue" + │ │ │ ├── exceptions: (length: 0) + │ │ │ ├── operator_loc: ∅ + │ │ │ ├── reference: ∅ + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (4,2)-(4,9)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ SymbolNode (location: (4,2)-(4,9)) + │ │ │ │ ├── opening_loc: (4,2)-(4,3) = ":" + │ │ │ │ ├── value_loc: (4,3)-(4,9) = "rescue" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "rescue" + │ │ │ └── consequent: ∅ + │ │ ├── else_clause: + │ │ │ @ ElseNode (location: (5,0)-(7,6)) + │ │ │ ├── else_keyword_loc: (5,0)-(5,4) = "else" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (6,2)-(6,7)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ SymbolNode (location: (6,2)-(6,7)) + │ │ │ │ ├── opening_loc: (6,2)-(6,3) = ":" + │ │ │ │ ├── value_loc: (6,3)-(6,7) = "else" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "else" + │ │ │ └── end_keyword_loc: (7,0)-(7,6) = "ensure" + │ │ ├── ensure_clause: + │ │ │ @ EnsureNode (location: (7,0)-(9,3)) + │ │ │ ├── ensure_keyword_loc: (7,0)-(7,6) = "ensure" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (8,2)-(8,9)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ SymbolNode (location: (8,2)-(8,9)) + │ │ │ │ ├── opening_loc: (8,2)-(8,3) = ":" + │ │ │ │ ├── value_loc: (8,3)-(8,9) = "ensure" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "ensure" + │ │ │ └── end_keyword_loc: (9,0)-(9,3) = "end" + │ │ └── end_keyword_loc: (9,0)-(9,3) = "end" + │ ├── opening_loc: (1,4)-(1,6) = "do" + │ └── closing_loc: (9,0)-(9,3) = "end" + ├── flags: ∅ + └── name: "tap" diff --git a/test/prism/snapshots/seattlerb/rescue_do_end_raised.txt b/test/prism/snapshots/seattlerb/rescue_do_end_raised.txt new file mode 100644 index 0000000000..c0fd317c9e --- /dev/null +++ b/test/prism/snapshots/seattlerb/rescue_do_end_raised.txt @@ -0,0 +1,51 @@ +@ ProgramNode (location: (1,0)-(5,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(5,3)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(5,3)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,3) = "tap" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,4)-(5,3)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ BeginNode (location: (2,2)-(5,3)) + │ │ ├── begin_keyword_loc: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (2,2)-(2,7)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (2,2)-(2,7)) + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── message_loc: (2,2)-(2,7) = "raise" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── block: ∅ + │ │ │ ├── flags: variable_call + │ │ │ └── name: "raise" + │ │ ├── rescue_clause: ∅ + │ │ ├── else_clause: ∅ + │ │ ├── ensure_clause: + │ │ │ @ EnsureNode (location: (3,0)-(5,3)) + │ │ │ ├── ensure_keyword_loc: (3,0)-(3,6) = "ensure" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (4,2)-(4,9)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ SymbolNode (location: (4,2)-(4,9)) + │ │ │ │ ├── opening_loc: (4,2)-(4,3) = ":" + │ │ │ │ ├── value_loc: (4,3)-(4,9) = "ensure" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "ensure" + │ │ │ └── end_keyword_loc: (5,0)-(5,3) = "end" + │ │ └── end_keyword_loc: (5,0)-(5,3) = "end" + │ ├── opening_loc: (1,4)-(1,6) = "do" + │ └── closing_loc: (5,0)-(5,3) = "end" + ├── flags: ∅ + └── name: "tap" diff --git a/test/prism/snapshots/seattlerb/rescue_do_end_rescued.txt b/test/prism/snapshots/seattlerb/rescue_do_end_rescued.txt new file mode 100644 index 0000000000..91e8062ae3 --- /dev/null +++ b/test/prism/snapshots/seattlerb/rescue_do_end_rescued.txt @@ -0,0 +1,76 @@ +@ ProgramNode (location: (1,0)-(9,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(9,3)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(9,3)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,3) = "tap" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,4)-(9,3)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ BeginNode (location: (2,2)-(9,3)) + │ │ ├── begin_keyword_loc: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (2,2)-(2,7)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (2,2)-(2,7)) + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── message_loc: (2,2)-(2,7) = "raise" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── block: ∅ + │ │ │ ├── flags: variable_call + │ │ │ └── name: "raise" + │ │ ├── rescue_clause: + │ │ │ @ RescueNode (location: (3,0)-(4,9)) + │ │ │ ├── keyword_loc: (3,0)-(3,6) = "rescue" + │ │ │ ├── exceptions: (length: 0) + │ │ │ ├── operator_loc: ∅ + │ │ │ ├── reference: ∅ + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (4,2)-(4,9)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ SymbolNode (location: (4,2)-(4,9)) + │ │ │ │ ├── opening_loc: (4,2)-(4,3) = ":" + │ │ │ │ ├── value_loc: (4,3)-(4,9) = "rescue" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "rescue" + │ │ │ └── consequent: ∅ + │ │ ├── else_clause: + │ │ │ @ ElseNode (location: (5,0)-(7,6)) + │ │ │ ├── else_keyword_loc: (5,0)-(5,4) = "else" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (6,2)-(6,7)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ SymbolNode (location: (6,2)-(6,7)) + │ │ │ │ ├── opening_loc: (6,2)-(6,3) = ":" + │ │ │ │ ├── value_loc: (6,3)-(6,7) = "else" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "else" + │ │ │ └── end_keyword_loc: (7,0)-(7,6) = "ensure" + │ │ ├── ensure_clause: + │ │ │ @ EnsureNode (location: (7,0)-(9,3)) + │ │ │ ├── ensure_keyword_loc: (7,0)-(7,6) = "ensure" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (8,2)-(8,9)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ SymbolNode (location: (8,2)-(8,9)) + │ │ │ │ ├── opening_loc: (8,2)-(8,3) = ":" + │ │ │ │ ├── value_loc: (8,3)-(8,9) = "ensure" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "ensure" + │ │ │ └── end_keyword_loc: (9,0)-(9,3) = "end" + │ │ └── end_keyword_loc: (9,0)-(9,3) = "end" + │ ├── opening_loc: (1,4)-(1,6) = "do" + │ └── closing_loc: (9,0)-(9,3) = "end" + ├── flags: ∅ + └── name: "tap" diff --git a/test/prism/snapshots/seattlerb/rescue_in_block.txt b/test/prism/snapshots/seattlerb/rescue_in_block.txt new file mode 100644 index 0000000000..58f6282558 --- /dev/null +++ b/test/prism/snapshots/seattlerb/rescue_in_block.txt @@ -0,0 +1,47 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(4,3)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,4) = "blah" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (1,5)-(4,3)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ BeginNode (location: (2,0)-(4,3)) + │ │ ├── begin_keyword_loc: ∅ + │ │ ├── statements: ∅ + │ │ ├── rescue_clause: + │ │ │ @ RescueNode (location: (2,0)-(3,7)) + │ │ │ ├── keyword_loc: (2,0)-(2,6) = "rescue" + │ │ │ ├── exceptions: (length: 0) + │ │ │ ├── operator_loc: ∅ + │ │ │ ├── reference: ∅ + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (3,2)-(3,7)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (3,2)-(3,7)) + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── message_loc: (3,2)-(3,7) = "stuff" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── block: ∅ + │ │ │ │ ├── flags: variable_call + │ │ │ │ └── name: "stuff" + │ │ │ └── consequent: ∅ + │ │ ├── else_clause: ∅ + │ │ ├── ensure_clause: ∅ + │ │ └── end_keyword_loc: (4,0)-(4,3) = "end" + │ ├── opening_loc: (1,5)-(1,7) = "do" + │ └── closing_loc: (4,0)-(4,3) = "end" + ├── flags: ∅ + └── name: "blah" diff --git a/test/prism/snapshots/seattlerb/rescue_parens.txt b/test/prism/snapshots/seattlerb/rescue_parens.txt new file mode 100644 index 0000000000..e97a46a8ec --- /dev/null +++ b/test/prism/snapshots/seattlerb/rescue_parens.txt @@ -0,0 +1,47 @@ +@ ProgramNode (location: (1,0)-(1,14)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,14)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,14)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,14)) + │ └── arguments: (length: 1) + │ └── @ ParenthesesNode (location: (1,2)-(1,14)) + │ ├── body: + │ │ @ StatementsNode (location: (1,3)-(1,13)) + │ │ └── body: (length: 1) + │ │ └── @ RescueModifierNode (location: (1,3)-(1,13)) + │ │ ├── expression: + │ │ │ @ CallNode (location: (1,3)-(1,4)) + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── message_loc: (1,3)-(1,4) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── block: ∅ + │ │ │ ├── flags: variable_call + │ │ │ └── name: "b" + │ │ ├── keyword_loc: (1,5)-(1,11) = "rescue" + │ │ └── rescue_expression: + │ │ @ CallNode (location: (1,12)-(1,13)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,12)-(1,13) = "c" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "c" + │ ├── opening_loc: (1,2)-(1,3) = "(" + │ └── closing_loc: (1,13)-(1,14) = ")" + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "a" diff --git a/test/prism/snapshots/seattlerb/return_call_assocs.txt b/test/prism/snapshots/seattlerb/return_call_assocs.txt new file mode 100644 index 0000000000..cfbf7fda5c --- /dev/null +++ b/test/prism/snapshots/seattlerb/return_call_assocs.txt @@ -0,0 +1,181 @@ +@ ProgramNode (location: (1,0)-(11,14)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(11,14)) + └── body: (length: 6) + ├── @ ReturnNode (location: (1,0)-(1,17)) + │ ├── keyword_loc: (1,0)-(1,6) = "return" + │ └── arguments: + │ @ ArgumentsNode (location: (1,7)-(1,17)) + │ └── arguments: (length: 2) + │ ├── @ IntegerNode (location: (1,7)-(1,8)) + │ │ └── flags: decimal + │ └── @ KeywordHashNode (location: (1,10)-(1,17)) + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (1,10)-(1,17)) + │ ├── key: + │ │ @ SymbolNode (location: (1,10)-(1,12)) + │ │ ├── opening_loc: (1,10)-(1,11) = ":" + │ │ ├── value_loc: (1,11)-(1,12) = "z" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "z" + │ ├── value: + │ │ @ IntegerNode (location: (1,16)-(1,17)) + │ │ └── flags: decimal + │ └── operator_loc: (1,13)-(1,15) = "=>" + ├── @ ReturnNode (location: (3,0)-(3,26)) + │ ├── keyword_loc: (3,0)-(3,6) = "return" + │ └── arguments: + │ @ ArgumentsNode (location: (3,7)-(3,26)) + │ └── arguments: (length: 2) + │ ├── @ IntegerNode (location: (3,7)-(3,8)) + │ │ └── flags: decimal + │ └── @ KeywordHashNode (location: (3,10)-(3,26)) + │ └── elements: (length: 2) + │ ├── @ AssocNode (location: (3,10)-(3,17)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (3,10)-(3,12)) + │ │ │ ├── opening_loc: (3,10)-(3,11) = ":" + │ │ │ ├── value_loc: (3,11)-(3,12) = "z" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "z" + │ │ ├── value: + │ │ │ @ IntegerNode (location: (3,16)-(3,17)) + │ │ │ └── flags: decimal + │ │ └── operator_loc: (3,13)-(3,15) = "=>" + │ └── @ AssocNode (location: (3,19)-(3,26)) + │ ├── key: + │ │ @ SymbolNode (location: (3,19)-(3,21)) + │ │ ├── opening_loc: (3,19)-(3,20) = ":" + │ │ ├── value_loc: (3,20)-(3,21) = "w" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "w" + │ ├── value: + │ │ @ IntegerNode (location: (3,25)-(3,26)) + │ │ └── flags: decimal + │ └── operator_loc: (3,22)-(3,24) = "=>" + ├── @ ReturnNode (location: (5,0)-(5,14)) + │ ├── keyword_loc: (5,0)-(5,6) = "return" + │ └── arguments: + │ @ ArgumentsNode (location: (5,7)-(5,14)) + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (5,7)-(5,14)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (5,7)-(5,8) = "y" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (5,9)-(5,14)) + │ │ └── arguments: (length: 1) + │ │ └── @ KeywordHashNode (location: (5,9)-(5,14)) + │ │ └── elements: (length: 1) + │ │ └── @ AssocNode (location: (5,9)-(5,14)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (5,9)-(5,11)) + │ │ │ ├── opening_loc: (5,9)-(5,10) = ":" + │ │ │ ├── value_loc: (5,10)-(5,11) = "z" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "z" + │ │ ├── value: + │ │ │ @ IntegerNode (location: (5,13)-(5,14)) + │ │ │ └── flags: decimal + │ │ └── operator_loc: (5,11)-(5,13) = "=>" + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "y" + ├── @ ReturnNode (location: (7,0)-(7,12)) + │ ├── keyword_loc: (7,0)-(7,6) = "return" + │ └── arguments: + │ @ ArgumentsNode (location: (7,7)-(7,12)) + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (7,7)-(7,12)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (7,7)-(7,8) = "y" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (7,9)-(7,12)) + │ │ └── arguments: (length: 1) + │ │ └── @ KeywordHashNode (location: (7,9)-(7,12)) + │ │ └── elements: (length: 1) + │ │ └── @ AssocNode (location: (7,9)-(7,12)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (7,9)-(7,11)) + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (7,9)-(7,10) = "z" + │ │ │ ├── closing_loc: (7,10)-(7,11) = ":" + │ │ │ └── unescaped: "z" + │ │ ├── value: + │ │ │ @ IntegerNode (location: (7,11)-(7,12)) + │ │ │ └── flags: decimal + │ │ └── operator_loc: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "y" + ├── @ ReturnNode (location: (9,0)-(9,13)) + │ ├── keyword_loc: (9,0)-(9,6) = "return" + │ └── arguments: + │ @ ArgumentsNode (location: (9,7)-(9,13)) + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (9,7)-(9,13)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (9,7)-(9,8) = "y" + │ ├── opening_loc: (9,8)-(9,9) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (9,9)-(9,12)) + │ │ └── arguments: (length: 1) + │ │ └── @ KeywordHashNode (location: (9,9)-(9,12)) + │ │ └── elements: (length: 1) + │ │ └── @ AssocNode (location: (9,9)-(9,12)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (9,9)-(9,11)) + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (9,9)-(9,10) = "z" + │ │ │ ├── closing_loc: (9,10)-(9,11) = ":" + │ │ │ └── unescaped: "z" + │ │ ├── value: + │ │ │ @ IntegerNode (location: (9,11)-(9,12)) + │ │ │ └── flags: decimal + │ │ └── operator_loc: ∅ + │ ├── closing_loc: (9,12)-(9,13) = ")" + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "y" + └── @ ReturnNode (location: (11,0)-(11,14)) + ├── keyword_loc: (11,0)-(11,6) = "return" + └── arguments: + @ ArgumentsNode (location: (11,7)-(11,14)) + └── arguments: (length: 1) + └── @ CallNode (location: (11,7)-(11,14)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (11,7)-(11,8) = "y" + ├── opening_loc: (11,8)-(11,9) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (11,9)-(11,13)) + │ └── arguments: (length: 1) + │ └── @ KeywordHashNode (location: (11,9)-(11,13)) + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (11,9)-(11,13)) + │ ├── key: + │ │ @ CallNode (location: (11,9)-(11,10)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (11,9)-(11,10) = "z" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "z" + │ ├── value: + │ │ @ IntegerNode (location: (11,12)-(11,13)) + │ │ └── flags: decimal + │ └── operator_loc: (11,10)-(11,12) = "=>" + ├── closing_loc: (11,13)-(11,14) = ")" + ├── block: ∅ + ├── flags: ∅ + └── name: "y" diff --git a/test/prism/snapshots/seattlerb/rhs_asgn.txt b/test/prism/snapshots/seattlerb/rhs_asgn.txt new file mode 100644 index 0000000000..61ed05f4e1 --- /dev/null +++ b/test/prism/snapshots/seattlerb/rhs_asgn.txt @@ -0,0 +1,14 @@ +@ ProgramNode (location: (1,0)-(1,7)) +├── locals: [:n] +└── statements: + @ StatementsNode (location: (1,0)-(1,7)) + └── body: (length: 1) + └── @ MatchRequiredNode (location: (1,0)-(1,7)) + ├── value: + │ @ IntegerNode (location: (1,0)-(1,2)) + │ └── flags: decimal + ├── pattern: + │ @ LocalVariableTargetNode (location: (1,6)-(1,7)) + │ ├── name: :n + │ └── depth: 0 + └── operator_loc: (1,3)-(1,5) = "=>" diff --git a/test/prism/snapshots/seattlerb/ruby21_numbers.txt b/test/prism/snapshots/seattlerb/ruby21_numbers.txt new file mode 100644 index 0000000000..d855195ca6 --- /dev/null +++ b/test/prism/snapshots/seattlerb/ruby21_numbers.txt @@ -0,0 +1,23 @@ +@ ProgramNode (location: (1,0)-(1,13)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,13)) + └── body: (length: 1) + └── @ ArrayNode (location: (1,0)-(1,13)) + ├── elements: (length: 3) + │ ├── @ ImaginaryNode (location: (1,1)-(1,3)) + │ │ └── numeric: + │ │ @ IntegerNode (location: (1,1)-(1,2)) + │ │ └── flags: decimal + │ ├── @ RationalNode (location: (1,5)-(1,7)) + │ │ └── numeric: + │ │ @ IntegerNode (location: (1,5)-(1,6)) + │ │ └── flags: decimal + │ └── @ ImaginaryNode (location: (1,9)-(1,12)) + │ └── numeric: + │ @ RationalNode (location: (1,9)-(1,11)) + │ └── numeric: + │ @ IntegerNode (location: (1,9)-(1,10)) + │ └── flags: decimal + ├── opening_loc: (1,0)-(1,1) = "[" + └── closing_loc: (1,12)-(1,13) = "]" diff --git a/test/prism/snapshots/seattlerb/safe_attrasgn.txt b/test/prism/snapshots/seattlerb/safe_attrasgn.txt new file mode 100644 index 0000000000..e6ea102a26 --- /dev/null +++ b/test/prism/snapshots/seattlerb/safe_attrasgn.txt @@ -0,0 +1,29 @@ +@ ProgramNode (location: (1,0)-(1,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,8)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,8)) + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "a" + ├── call_operator_loc: (1,1)-(1,3) = "&." + ├── message_loc: (1,3)-(1,4) = "b" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,7)-(1,8)) + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,7)-(1,8)) + │ └── flags: decimal + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: safe_navigation + └── name: "b=" diff --git a/test/prism/snapshots/seattlerb/safe_attrasgn_constant.txt b/test/prism/snapshots/seattlerb/safe_attrasgn_constant.txt new file mode 100644 index 0000000000..3bf82ed234 --- /dev/null +++ b/test/prism/snapshots/seattlerb/safe_attrasgn_constant.txt @@ -0,0 +1,29 @@ +@ ProgramNode (location: (1,0)-(1,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,8)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,8)) + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "a" + ├── call_operator_loc: (1,1)-(1,3) = "&." + ├── message_loc: (1,3)-(1,4) = "B" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,7)-(1,8)) + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,7)-(1,8)) + │ └── flags: decimal + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: safe_navigation + └── name: "B=" diff --git a/test/prism/snapshots/seattlerb/safe_call.txt b/test/prism/snapshots/seattlerb/safe_call.txt new file mode 100644 index 0000000000..cf7412a9fa --- /dev/null +++ b/test/prism/snapshots/seattlerb/safe_call.txt @@ -0,0 +1,25 @@ +@ ProgramNode (location: (1,0)-(1,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,4)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,4)) + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "a" + ├── call_operator_loc: (1,1)-(1,3) = "&." + ├── message_loc: (1,3)-(1,4) = "b" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: safe_navigation + └── name: "b" diff --git a/test/prism/snapshots/seattlerb/safe_call_after_newline.txt b/test/prism/snapshots/seattlerb/safe_call_after_newline.txt new file mode 100644 index 0000000000..ef16c63d2b --- /dev/null +++ b/test/prism/snapshots/seattlerb/safe_call_after_newline.txt @@ -0,0 +1,25 @@ +@ ProgramNode (location: (1,0)-(2,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,3)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(2,3)) + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "a" + ├── call_operator_loc: (2,0)-(2,2) = "&." + ├── message_loc: (2,2)-(2,3) = "b" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: safe_navigation + └── name: "b" diff --git a/test/prism/snapshots/seattlerb/safe_call_dot_parens.txt b/test/prism/snapshots/seattlerb/safe_call_dot_parens.txt new file mode 100644 index 0000000000..b152d6230b --- /dev/null +++ b/test/prism/snapshots/seattlerb/safe_call_dot_parens.txt @@ -0,0 +1,25 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,5)) + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "a" + ├── call_operator_loc: (1,1)-(1,3) = "&." + ├── message_loc: ∅ + ├── opening_loc: (1,3)-(1,4) = "(" + ├── arguments: ∅ + ├── closing_loc: (1,4)-(1,5) = ")" + ├── block: ∅ + ├── flags: safe_navigation + └── name: "call" diff --git a/test/prism/snapshots/seattlerb/safe_call_newline.txt b/test/prism/snapshots/seattlerb/safe_call_newline.txt new file mode 100644 index 0000000000..cf7412a9fa --- /dev/null +++ b/test/prism/snapshots/seattlerb/safe_call_newline.txt @@ -0,0 +1,25 @@ +@ ProgramNode (location: (1,0)-(1,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,4)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,4)) + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "a" + ├── call_operator_loc: (1,1)-(1,3) = "&." + ├── message_loc: (1,3)-(1,4) = "b" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: safe_navigation + └── name: "b" diff --git a/test/prism/snapshots/seattlerb/safe_call_operator.txt b/test/prism/snapshots/seattlerb/safe_call_operator.txt new file mode 100644 index 0000000000..d24465ef89 --- /dev/null +++ b/test/prism/snapshots/seattlerb/safe_call_operator.txt @@ -0,0 +1,29 @@ +@ ProgramNode (location: (1,0)-(1,6)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,6)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,6)) + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "a" + ├── call_operator_loc: (1,1)-(1,3) = "&." + ├── message_loc: (1,3)-(1,4) = ">" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,5)-(1,6)) + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,5)-(1,6)) + │ └── flags: decimal + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: safe_navigation + └── name: ">" diff --git a/test/prism/snapshots/seattlerb/safe_call_rhs_newline.txt b/test/prism/snapshots/seattlerb/safe_call_rhs_newline.txt new file mode 100644 index 0000000000..779a26b9a4 --- /dev/null +++ b/test/prism/snapshots/seattlerb/safe_call_rhs_newline.txt @@ -0,0 +1,31 @@ +@ ProgramNode (location: (1,0)-(1,8)) +├── locals: [:c] +└── statements: + @ StatementsNode (location: (1,0)-(1,8)) + └── body: (length: 1) + └── @ LocalVariableWriteNode (location: (1,0)-(1,8)) + ├── name: :c + ├── depth: 0 + ├── name_loc: (1,0)-(1,1) = "c" + ├── value: + │ @ CallNode (location: (1,4)-(1,8)) + │ ├── receiver: + │ │ @ CallNode (location: (1,4)-(1,5)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,4)-(1,5) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "a" + │ ├── call_operator_loc: (1,5)-(1,7) = "&." + │ ├── message_loc: (1,7)-(1,8) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: safe_navigation + │ └── name: "b" + └── operator_loc: (1,2)-(1,3) = "=" diff --git a/test/prism/snapshots/seattlerb/safe_calls.txt b/test/prism/snapshots/seattlerb/safe_calls.txt new file mode 100644 index 0000000000..f4f9644f12 --- /dev/null +++ b/test/prism/snapshots/seattlerb/safe_calls.txt @@ -0,0 +1,39 @@ +@ ProgramNode (location: (1,0)-(1,10)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,10)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,10)) + ├── receiver: + │ @ CallNode (location: (1,0)-(1,4)) + │ ├── receiver: + │ │ @ CallNode (location: (1,0)-(1,1)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,0)-(1,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "a" + │ ├── call_operator_loc: (1,1)-(1,3) = "&." + │ ├── message_loc: (1,3)-(1,4) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: safe_navigation + │ └── name: "b" + ├── call_operator_loc: (1,4)-(1,6) = "&." + ├── message_loc: (1,6)-(1,7) = "c" + ├── opening_loc: (1,7)-(1,8) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,8)-(1,9)) + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,8)-(1,9)) + │ └── flags: decimal + ├── closing_loc: (1,9)-(1,10) = ")" + ├── block: ∅ + ├── flags: safe_navigation + └── name: "c" diff --git a/test/prism/snapshots/seattlerb/safe_op_asgn.txt b/test/prism/snapshots/seattlerb/safe_op_asgn.txt new file mode 100644 index 0000000000..eee4cd1b42 --- /dev/null +++ b/test/prism/snapshots/seattlerb/safe_op_asgn.txt @@ -0,0 +1,42 @@ +@ ProgramNode (location: (1,0)-(1,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,11)) + └── body: (length: 1) + └── @ CallOperatorWriteNode (location: (1,0)-(1,11)) + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "a" + ├── call_operator_loc: (1,1)-(1,3) = "&." + ├── message_loc: (1,3)-(1,4) = "b" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── flags: safe_navigation + ├── read_name: "b" + ├── write_name: "b=" + ├── operator: :+ + ├── operator_loc: (1,5)-(1,7) = "+=" + └── value: + @ CallNode (location: (1,8)-(1,11)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,8)-(1,9) = "x" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,10)-(1,11)) + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,10)-(1,11)) + │ └── flags: decimal + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "x" diff --git a/test/prism/snapshots/seattlerb/safe_op_asgn2.txt b/test/prism/snapshots/seattlerb/safe_op_asgn2.txt new file mode 100644 index 0000000000..f7d02d3e55 --- /dev/null +++ b/test/prism/snapshots/seattlerb/safe_op_asgn2.txt @@ -0,0 +1,37 @@ +@ ProgramNode (location: (1,0)-(2,1)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,1)) + └── body: (length: 1) + └── @ CallOrWriteNode (location: (1,0)-(2,1)) + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "a" + ├── call_operator_loc: (1,1)-(1,3) = "&." + ├── message_loc: (1,3)-(1,4) = "b" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── flags: safe_navigation + ├── read_name: "b" + ├── write_name: "b=" + ├── operator_loc: (1,5)-(1,8) = "||=" + └── value: + @ CallNode (location: (2,0)-(2,1)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (2,0)-(2,1) = "x" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: variable_call + └── name: "x" diff --git a/test/prism/snapshots/seattlerb/slashy_newlines_within_string.txt b/test/prism/snapshots/seattlerb/slashy_newlines_within_string.txt new file mode 100644 index 0000000000..49e5265871 --- /dev/null +++ b/test/prism/snapshots/seattlerb/slashy_newlines_within_string.txt @@ -0,0 +1,55 @@ +@ ProgramNode (location: (1,0)-(6,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(6,5)) + └── body: (length: 2) + ├── @ CallNode (location: (1,0)-(4,8)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,0)-(1,4) = "puts" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,5)-(4,8)) + │ │ └── arguments: (length: 1) + │ │ └── @ StringNode (location: (1,5)-(4,8)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (1,5)-(1,6) = "\"" + │ │ ├── content_loc: (1,6)-(4,7) = "hello\\\n my\\\n dear\\\n friend" + │ │ ├── closing_loc: (4,7)-(4,8) = "\"" + │ │ └── unescaped: "hello my dear friend" + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "puts" + └── @ CallNode (location: (6,0)-(6,5)) + ├── receiver: + │ @ CallNode (location: (6,0)-(6,1)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (6,0)-(6,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "a" + ├── call_operator_loc: ∅ + ├── message_loc: (6,2)-(6,3) = "+" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (6,4)-(6,5)) + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (6,4)-(6,5)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (6,4)-(6,5) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "b" + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "+" diff --git a/test/prism/snapshots/seattlerb/stabby_arg_no_paren.txt b/test/prism/snapshots/seattlerb/stabby_arg_no_paren.txt new file mode 100644 index 0000000000..7392e71525 --- /dev/null +++ b/test/prism/snapshots/seattlerb/stabby_arg_no_paren.txt @@ -0,0 +1,27 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ LambdaNode (location: (1,0)-(1,5)) + ├── locals: [:a] + ├── operator_loc: (1,0)-(1,2) = "->" + ├── opening_loc: (1,3)-(1,4) = "{" + ├── closing_loc: (1,4)-(1,5) = "}" + ├── parameters: + │ @ BlockParametersNode (location: (1,2)-(1,3)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,2)-(1,3)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,2)-(1,3)) + │ │ │ └── name: :a + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: ∅ + │ └── closing_loc: ∅ + └── body: ∅ diff --git a/test/prism/snapshots/seattlerb/stabby_arg_opt_splat_arg_block_omfg.txt b/test/prism/snapshots/seattlerb/stabby_arg_opt_splat_arg_block_omfg.txt new file mode 100644 index 0000000000..0661b2a2aa --- /dev/null +++ b/test/prism/snapshots/seattlerb/stabby_arg_opt_splat_arg_block_omfg.txt @@ -0,0 +1,44 @@ +@ ProgramNode (location: (1,0)-(1,23)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,23)) + └── body: (length: 1) + └── @ LambdaNode (location: (1,0)-(1,23)) + ├── locals: [:b, :c, :d, :e, :f] + ├── operator_loc: (1,0)-(1,2) = "->" + ├── opening_loc: (1,21)-(1,22) = "{" + ├── closing_loc: (1,22)-(1,23) = "}" + ├── parameters: + │ @ BlockParametersNode (location: (1,2)-(1,21)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,3)-(1,20)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,3)-(1,4)) + │ │ │ └── name: :b + │ │ ├── optionals: (length: 1) + │ │ │ └── @ OptionalParameterNode (location: (1,6)-(1,9)) + │ │ │ ├── name: :c + │ │ │ ├── name_loc: (1,6)-(1,7) = "c" + │ │ │ ├── operator_loc: (1,7)-(1,8) = "=" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (1,8)-(1,9)) + │ │ │ └── flags: decimal + │ │ ├── rest: + │ │ │ @ RestParameterNode (location: (1,11)-(1,13)) + │ │ │ ├── name: :d + │ │ │ ├── name_loc: (1,12)-(1,13) = "d" + │ │ │ └── operator_loc: (1,11)-(1,12) = "*" + │ │ ├── posts: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,15)-(1,16)) + │ │ │ └── name: :e + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: + │ │ @ BlockParameterNode (location: (1,18)-(1,20)) + │ │ ├── name: :f + │ │ ├── name_loc: (1,19)-(1,20) = "f" + │ │ └── operator_loc: (1,18)-(1,19) = "&" + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,2)-(1,3) = "(" + │ └── closing_loc: (1,20)-(1,21) = ")" + └── body: ∅ diff --git a/test/prism/snapshots/seattlerb/stabby_block_iter_call.txt b/test/prism/snapshots/seattlerb/stabby_block_iter_call.txt new file mode 100644 index 0000000000..4cce284497 --- /dev/null +++ b/test/prism/snapshots/seattlerb/stabby_block_iter_call.txt @@ -0,0 +1,57 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(4,3)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "x" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(4,3)) + │ └── arguments: (length: 1) + │ └── @ LambdaNode (location: (1,2)-(4,3)) + │ ├── locals: [] + │ ├── operator_loc: (1,2)-(1,4) = "->" + │ ├── opening_loc: (1,8)-(1,10) = "do" + │ ├── closing_loc: (4,0)-(4,3) = "end" + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,5)-(1,7)) + │ │ ├── parameters: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,5)-(1,6) = "(" + │ │ └── closing_loc: (1,6)-(1,7) = ")" + │ └── body: + │ @ StatementsNode (location: (2,0)-(3,3)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (2,0)-(3,3)) + │ ├── receiver: + │ │ @ CallNode (location: (2,0)-(2,1)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (2,0)-(2,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "a" + │ ├── call_operator_loc: (2,1)-(2,2) = "." + │ ├── message_loc: (2,2)-(2,3) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: + │ │ @ BlockNode (location: (2,4)-(3,3)) + │ │ ├── locals: [] + │ │ ├── parameters: ∅ + │ │ ├── body: ∅ + │ │ ├── opening_loc: (2,4)-(2,6) = "do" + │ │ └── closing_loc: (3,0)-(3,3) = "end" + │ ├── flags: ∅ + │ └── name: "b" + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "x" diff --git a/test/prism/snapshots/seattlerb/stabby_block_iter_call_no_target_with_arg.txt b/test/prism/snapshots/seattlerb/stabby_block_iter_call_no_target_with_arg.txt new file mode 100644 index 0000000000..46f401eb5a --- /dev/null +++ b/test/prism/snapshots/seattlerb/stabby_block_iter_call_no_target_with_arg.txt @@ -0,0 +1,51 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(4,3)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "x" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(4,3)) + │ └── arguments: (length: 1) + │ └── @ LambdaNode (location: (1,2)-(4,3)) + │ ├── locals: [] + │ ├── operator_loc: (1,2)-(1,4) = "->" + │ ├── opening_loc: (1,8)-(1,10) = "do" + │ ├── closing_loc: (4,0)-(4,3) = "end" + │ ├── parameters: + │ │ @ BlockParametersNode (location: (1,5)-(1,7)) + │ │ ├── parameters: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (1,5)-(1,6) = "(" + │ │ └── closing_loc: (1,6)-(1,7) = ")" + │ └── body: + │ @ StatementsNode (location: (2,0)-(3,3)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (2,0)-(3,3)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (2,0)-(2,1) = "a" + │ ├── opening_loc: (2,1)-(2,2) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (2,2)-(2,3)) + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (2,2)-(2,3)) + │ │ └── flags: decimal + │ ├── closing_loc: (2,3)-(2,4) = ")" + │ ├── block: + │ │ @ BlockNode (location: (2,5)-(3,3)) + │ │ ├── locals: [] + │ │ ├── parameters: ∅ + │ │ ├── body: ∅ + │ │ ├── opening_loc: (2,5)-(2,7) = "do" + │ │ └── closing_loc: (3,0)-(3,3) = "end" + │ ├── flags: ∅ + │ └── name: "a" + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "x" diff --git a/test/prism/snapshots/seattlerb/stabby_block_kw.txt b/test/prism/snapshots/seattlerb/stabby_block_kw.txt new file mode 100644 index 0000000000..e3613e4b36 --- /dev/null +++ b/test/prism/snapshots/seattlerb/stabby_block_kw.txt @@ -0,0 +1,31 @@ +@ ProgramNode (location: (1,0)-(1,13)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,13)) + └── body: (length: 1) + └── @ LambdaNode (location: (1,0)-(1,13)) + ├── locals: [:k] + ├── operator_loc: (1,0)-(1,2) = "->" + ├── opening_loc: (1,10)-(1,11) = "{" + ├── closing_loc: (1,12)-(1,13) = "}" + ├── parameters: + │ @ BlockParametersNode (location: (1,3)-(1,9)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,4)-(1,8)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 1) + │ │ │ └── @ KeywordParameterNode (location: (1,4)-(1,8)) + │ │ │ ├── name: :k + │ │ │ ├── name_loc: (1,4)-(1,6) = "k:" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (1,6)-(1,8)) + │ │ │ └── flags: decimal + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,3)-(1,4) = "(" + │ └── closing_loc: (1,8)-(1,9) = ")" + └── body: ∅ diff --git a/test/prism/snapshots/seattlerb/stabby_block_kw__required.txt b/test/prism/snapshots/seattlerb/stabby_block_kw__required.txt new file mode 100644 index 0000000000..0139100071 --- /dev/null +++ b/test/prism/snapshots/seattlerb/stabby_block_kw__required.txt @@ -0,0 +1,29 @@ +@ ProgramNode (location: (1,0)-(1,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,11)) + └── body: (length: 1) + └── @ LambdaNode (location: (1,0)-(1,11)) + ├── locals: [:k] + ├── operator_loc: (1,0)-(1,2) = "->" + ├── opening_loc: (1,8)-(1,9) = "{" + ├── closing_loc: (1,10)-(1,11) = "}" + ├── parameters: + │ @ BlockParametersNode (location: (1,3)-(1,7)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,4)-(1,6)) + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 1) + │ │ │ └── @ KeywordParameterNode (location: (1,4)-(1,6)) + │ │ │ ├── name: :k + │ │ │ ├── name_loc: (1,4)-(1,6) = "k:" + │ │ │ └── value: ∅ + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,3)-(1,4) = "(" + │ └── closing_loc: (1,6)-(1,7) = ")" + └── body: ∅ diff --git a/test/prism/snapshots/seattlerb/stabby_proc_scope.txt b/test/prism/snapshots/seattlerb/stabby_proc_scope.txt new file mode 100644 index 0000000000..059192d67f --- /dev/null +++ b/test/prism/snapshots/seattlerb/stabby_proc_scope.txt @@ -0,0 +1,29 @@ +@ ProgramNode (location: (1,0)-(1,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,11)) + └── body: (length: 1) + └── @ LambdaNode (location: (1,0)-(1,11)) + ├── locals: [:a, :b] + ├── operator_loc: (1,0)-(1,2) = "->" + ├── opening_loc: (1,9)-(1,10) = "{" + ├── closing_loc: (1,10)-(1,11) = "}" + ├── parameters: + │ @ BlockParametersNode (location: (1,2)-(1,8)) + │ ├── parameters: + │ │ @ ParametersNode (location: (1,3)-(1,4)) + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,3)-(1,4)) + │ │ │ └── name: :a + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 1) + │ │ └── @ BlockLocalVariableNode (location: (1,6)-(1,7)) + │ │ └── name: :b + │ ├── opening_loc: (1,2)-(1,3) = "(" + │ └── closing_loc: (1,7)-(1,8) = ")" + └── body: ∅ diff --git a/test/prism/snapshots/seattlerb/str_backslashes.txt b/test/prism/snapshots/seattlerb/str_backslashes.txt new file mode 100644 index 0000000000..09e8628e8b --- /dev/null +++ b/test/prism/snapshots/seattlerb/str_backslashes.txt @@ -0,0 +1,23 @@ +@ ProgramNode (location: (1,0)-(1,204)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,204)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,204)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "x" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,204)) + │ └── arguments: (length: 1) + │ └── @ StringNode (location: (1,2)-(1,204)) + │ ├── flags: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "'" + │ ├── content_loc: (1,3)-(1,203) = "\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n" + │ ├── closing_loc: (1,203)-(1,204) = "'" + │ └── unescaped: "\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n" + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "x" diff --git a/test/prism/snapshots/seattlerb/str_double_double_escaped_newline.txt b/test/prism/snapshots/seattlerb/str_double_double_escaped_newline.txt new file mode 100644 index 0000000000..56fdd6cd7d --- /dev/null +++ b/test/prism/snapshots/seattlerb/str_double_double_escaped_newline.txt @@ -0,0 +1,33 @@ +@ ProgramNode (location: (1,0)-(1,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,9)) + └── body: (length: 2) + ├── @ CallNode (location: (1,0)-(1,7)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,2)-(1,7)) + │ │ └── arguments: (length: 1) + │ │ └── @ StringNode (location: (1,2)-(1,7)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (1,2)-(1,3) = "\"" + │ │ ├── content_loc: (1,3)-(1,6) = "\\\\n" + │ │ ├── closing_loc: (1,6)-(1,7) = "\"" + │ │ └── unescaped: "\\n" + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "a" + └── @ CallNode (location: (1,8)-(1,9)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,8)-(1,9) = "b" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: variable_call + └── name: "b" diff --git a/test/prism/snapshots/seattlerb/str_double_escaped_newline.txt b/test/prism/snapshots/seattlerb/str_double_escaped_newline.txt new file mode 100644 index 0000000000..906ef18d65 --- /dev/null +++ b/test/prism/snapshots/seattlerb/str_double_escaped_newline.txt @@ -0,0 +1,33 @@ +@ ProgramNode (location: (1,0)-(1,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,8)) + └── body: (length: 2) + ├── @ CallNode (location: (1,0)-(1,6)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,2)-(1,6)) + │ │ └── arguments: (length: 1) + │ │ └── @ StringNode (location: (1,2)-(1,6)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (1,2)-(1,3) = "\"" + │ │ ├── content_loc: (1,3)-(1,5) = "\\n" + │ │ ├── closing_loc: (1,5)-(1,6) = "\"" + │ │ └── unescaped: "\n" + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "a" + └── @ CallNode (location: (1,7)-(1,8)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,7)-(1,8) = "b" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: variable_call + └── name: "b" diff --git a/test/prism/snapshots/seattlerb/str_double_newline.txt b/test/prism/snapshots/seattlerb/str_double_newline.txt new file mode 100644 index 0000000000..67953d770f --- /dev/null +++ b/test/prism/snapshots/seattlerb/str_double_newline.txt @@ -0,0 +1,33 @@ +@ ProgramNode (location: (1,0)-(2,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,3)) + └── body: (length: 2) + ├── @ CallNode (location: (1,0)-(2,1)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,2)-(2,1)) + │ │ └── arguments: (length: 1) + │ │ └── @ StringNode (location: (1,2)-(2,1)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (1,2)-(1,3) = "\"" + │ │ ├── content_loc: (1,3)-(1,0) = "\n" + │ │ ├── closing_loc: (2,0)-(2,1) = "\"" + │ │ └── unescaped: "\n" + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "a" + └── @ CallNode (location: (2,2)-(2,3)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (2,2)-(2,3) = "b" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: variable_call + └── name: "b" diff --git a/test/prism/snapshots/seattlerb/str_evstr.txt b/test/prism/snapshots/seattlerb/str_evstr.txt new file mode 100644 index 0000000000..8062024ed4 --- /dev/null +++ b/test/prism/snapshots/seattlerb/str_evstr.txt @@ -0,0 +1,31 @@ +@ ProgramNode (location: (1,0)-(1,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,8)) + └── body: (length: 1) + └── @ InterpolatedStringNode (location: (1,0)-(1,8)) + ├── opening_loc: (1,0)-(1,1) = "\"" + ├── parts: (length: 2) + │ ├── @ StringNode (location: (1,1)-(1,3)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (1,1)-(1,3) = "a " + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a " + │ └── @ EmbeddedStatementsNode (location: (1,3)-(1,7)) + │ ├── opening_loc: (1,3)-(1,5) = "\#{" + │ ├── statements: + │ │ @ StatementsNode (location: (1,5)-(1,6)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (1,5)-(1,6)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,5)-(1,6) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "b" + │ └── closing_loc: (1,6)-(1,7) = "}" + └── closing_loc: (1,7)-(1,8) = "\"" diff --git a/test/prism/snapshots/seattlerb/str_evstr_escape.txt b/test/prism/snapshots/seattlerb/str_evstr_escape.txt new file mode 100644 index 0000000000..9dd987d226 --- /dev/null +++ b/test/prism/snapshots/seattlerb/str_evstr_escape.txt @@ -0,0 +1,37 @@ +@ ProgramNode (location: (1,0)-(1,16)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,16)) + └── body: (length: 1) + └── @ InterpolatedStringNode (location: (1,0)-(1,16)) + ├── opening_loc: (1,0)-(1,1) = "\"" + ├── parts: (length: 3) + │ ├── @ StringNode (location: (1,1)-(1,3)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (1,1)-(1,3) = "a " + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a " + │ ├── @ EmbeddedStatementsNode (location: (1,3)-(1,7)) + │ │ ├── opening_loc: (1,3)-(1,5) = "\#{" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (1,5)-(1,6)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (1,5)-(1,6)) + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── message_loc: (1,5)-(1,6) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── block: ∅ + │ │ │ ├── flags: variable_call + │ │ │ └── name: "b" + │ │ └── closing_loc: (1,6)-(1,7) = "}" + │ └── @ StringNode (location: (1,7)-(1,15)) + │ ├── flags: ∅ + │ ├── opening_loc: ∅ + │ ├── content_loc: (1,7)-(1,15) = "\\302\\275" + │ ├── closing_loc: ∅ + │ └── unescaped: "½" + └── closing_loc: (1,15)-(1,16) = "\"" diff --git a/test/prism/snapshots/seattlerb/str_heredoc_interp.txt b/test/prism/snapshots/seattlerb/str_heredoc_interp.txt new file mode 100644 index 0000000000..465469430c --- /dev/null +++ b/test/prism/snapshots/seattlerb/str_heredoc_interp.txt @@ -0,0 +1,31 @@ +@ ProgramNode (location: (1,0)-(1,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,4)) + └── body: (length: 1) + └── @ InterpolatedStringNode (location: (1,0)-(1,4)) + ├── opening_loc: (1,0)-(1,4) = "<<\"\"" + ├── parts: (length: 2) + │ ├── @ EmbeddedStatementsNode (location: (2,0)-(2,4)) + │ │ ├── opening_loc: (2,0)-(2,2) = "\#{" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (2,2)-(2,3)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (2,2)-(2,3)) + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── message_loc: (2,2)-(2,3) = "x" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── block: ∅ + │ │ │ ├── flags: variable_call + │ │ │ └── name: "x" + │ │ └── closing_loc: (2,3)-(2,4) = "}" + │ └── @ StringNode (location: (2,4)-(3,0)) + │ ├── flags: ∅ + │ ├── opening_loc: ∅ + │ ├── content_loc: (2,4)-(3,0) = "\nblah2\n" + │ ├── closing_loc: ∅ + │ └── unescaped: "\nblah2\n" + └── closing_loc: (4,0)-(4,0) = "\n" diff --git a/test/prism/snapshots/seattlerb/str_interp_ternary_or_label.txt b/test/prism/snapshots/seattlerb/str_interp_ternary_or_label.txt new file mode 100644 index 0000000000..c168afca2d --- /dev/null +++ b/test/prism/snapshots/seattlerb/str_interp_ternary_or_label.txt @@ -0,0 +1,101 @@ +@ ProgramNode (location: (1,0)-(1,23)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,23)) + └── body: (length: 1) + └── @ InterpolatedStringNode (location: (1,0)-(1,23)) + ├── opening_loc: (1,0)-(1,1) = "\"" + ├── parts: (length: 1) + │ └── @ EmbeddedStatementsNode (location: (1,1)-(1,22)) + │ ├── opening_loc: (1,1)-(1,3) = "\#{" + │ ├── statements: + │ │ @ StatementsNode (location: (1,3)-(1,21)) + │ │ └── body: (length: 1) + │ │ └── @ IfNode (location: (1,3)-(1,21)) + │ │ ├── if_keyword_loc: ∅ + │ │ ├── predicate: + │ │ │ @ CallNode (location: (1,3)-(1,7)) + │ │ │ ├── receiver: + │ │ │ │ @ CallNode (location: (1,3)-(1,4)) + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── message_loc: (1,3)-(1,4) = "a" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── block: ∅ + │ │ │ │ ├── flags: variable_call + │ │ │ │ └── name: "a" + │ │ │ ├── call_operator_loc: (1,4)-(1,5) = "." + │ │ │ ├── message_loc: (1,5)-(1,7) = "b?" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── block: ∅ + │ │ │ ├── flags: ∅ + │ │ │ └── name: "b?" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (1,10)-(1,17)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (1,10)-(1,17)) + │ │ │ ├── receiver: + │ │ │ │ @ CallNode (location: (1,10)-(1,14)) + │ │ │ │ ├── receiver: + │ │ │ │ │ @ StringNode (location: (1,10)-(1,12)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ ├── opening_loc: (1,10)-(1,11) = "\"" + │ │ │ │ │ ├── content_loc: (1,11)-(1,11) = "" + │ │ │ │ │ ├── closing_loc: (1,11)-(1,12) = "\"" + │ │ │ │ │ └── unescaped: "" + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── message_loc: (1,12)-(1,13) = "+" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: + │ │ │ │ │ @ ArgumentsNode (location: (1,13)-(1,14)) + │ │ │ │ │ └── arguments: (length: 1) + │ │ │ │ │ └── @ CallNode (location: (1,13)-(1,14)) + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── message_loc: (1,13)-(1,14) = "a" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── block: ∅ + │ │ │ │ │ ├── flags: variable_call + │ │ │ │ │ └── name: "a" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── block: ∅ + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: "+" + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── message_loc: (1,14)-(1,15) = "+" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (1,15)-(1,17)) + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ StringNode (location: (1,15)-(1,17)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: (1,15)-(1,16) = "\"" + │ │ │ │ ├── content_loc: (1,16)-(1,16) = "" + │ │ │ │ ├── closing_loc: (1,16)-(1,17) = "\"" + │ │ │ │ └── unescaped: "" + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── block: ∅ + │ │ │ ├── flags: ∅ + │ │ │ └── name: "+" + │ │ ├── consequent: + │ │ │ @ ElseNode (location: (1,17)-(1,21)) + │ │ │ ├── else_keyword_loc: (1,17)-(1,18) = ":" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (1,19)-(1,21)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ StringNode (location: (1,19)-(1,21)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: (1,19)-(1,20) = "\"" + │ │ │ │ ├── content_loc: (1,20)-(1,20) = "" + │ │ │ │ ├── closing_loc: (1,20)-(1,21) = "\"" + │ │ │ │ └── unescaped: "" + │ │ │ └── end_keyword_loc: ∅ + │ │ └── end_keyword_loc: ∅ + │ └── closing_loc: (1,21)-(1,22) = "}" + └── closing_loc: (1,22)-(1,23) = "\"" diff --git a/test/prism/snapshots/seattlerb/str_lit_concat_bad_encodings.txt b/test/prism/snapshots/seattlerb/str_lit_concat_bad_encodings.txt new file mode 100644 index 0000000000..7bf71b7858 --- /dev/null +++ b/test/prism/snapshots/seattlerb/str_lit_concat_bad_encodings.txt @@ -0,0 +1,20 @@ +@ ProgramNode (location: (1,0)-(2,66)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,66)) + └── body: (length: 1) + └── @ StringConcatNode (location: (1,0)-(2,66)) + ├── left: + │ @ StringNode (location: (1,0)-(1,62)) + │ ├── flags: ∅ + │ ├── opening_loc: (1,0)-(1,1) = "\"" + │ ├── content_loc: (1,1)-(1,61) = "\\xE3\\xD3\\x8B\\xE3\\x83\\xBC\\x83\\xE3\\x83\\xE3\\x82\\xB3\\xA3\\x82\\x99" + │ ├── closing_loc: (1,61)-(1,62) = "\"" + │ └── unescaped: "\xE3Ӌー\x83\xE3\x83コ\xA3\x82\x99" + └── right: + @ StringNode (location: (2,8)-(2,66)) + ├── flags: ∅ + ├── opening_loc: (2,8)-(2,9) = "\"" + ├── content_loc: (2,9)-(2,65) = "\\xE3\\x83\\xB3\\xE3\\x83\\x8F\\xE3\\x82\\x9A\\xC3\\xBD;foo@bar.com" + ├── closing_loc: (2,65)-(2,66) = "\"" + └── unescaped: "ンパý;foo@bar.com" diff --git a/test/prism/snapshots/seattlerb/str_newline_hash_line_number.txt b/test/prism/snapshots/seattlerb/str_newline_hash_line_number.txt new file mode 100644 index 0000000000..89f20da7b5 --- /dev/null +++ b/test/prism/snapshots/seattlerb/str_newline_hash_line_number.txt @@ -0,0 +1,13 @@ +@ ProgramNode (location: (1,0)-(2,1)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,1)) + └── body: (length: 2) + ├── @ StringNode (location: (1,0)-(1,11)) + │ ├── flags: ∅ + │ ├── opening_loc: (1,0)-(1,1) = "\"" + │ ├── content_loc: (1,1)-(1,10) = "\\n\\n\\n\\n#" + │ ├── closing_loc: (1,10)-(1,11) = "\"" + │ └── unescaped: "\n\n\n\n#" + └── @ IntegerNode (location: (2,0)-(2,1)) + └── flags: decimal diff --git a/test/prism/snapshots/seattlerb/str_pct_Q_nested.txt b/test/prism/snapshots/seattlerb/str_pct_Q_nested.txt new file mode 100644 index 0000000000..6651fcdde0 --- /dev/null +++ b/test/prism/snapshots/seattlerb/str_pct_Q_nested.txt @@ -0,0 +1,37 @@ +@ ProgramNode (location: (1,0)-(1,26)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,26)) + └── body: (length: 1) + └── @ InterpolatedStringNode (location: (1,0)-(1,26)) + ├── opening_loc: (1,0)-(1,3) = "%Q[" + ├── parts: (length: 3) + │ ├── @ StringNode (location: (1,3)-(1,11)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (1,3)-(1,11) = "before [" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "before [" + │ ├── @ EmbeddedStatementsNode (location: (1,11)-(1,18)) + │ │ ├── opening_loc: (1,11)-(1,13) = "\#{" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (1,13)-(1,17)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (1,13)-(1,17)) + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── message_loc: (1,13)-(1,17) = "nest" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── block: ∅ + │ │ │ ├── flags: variable_call + │ │ │ └── name: "nest" + │ │ └── closing_loc: (1,17)-(1,18) = "}" + │ └── @ StringNode (location: (1,18)-(1,25)) + │ ├── flags: ∅ + │ ├── opening_loc: ∅ + │ ├── content_loc: (1,18)-(1,25) = "] after" + │ ├── closing_loc: ∅ + │ └── unescaped: "] after" + └── closing_loc: (1,25)-(1,26) = "]" diff --git a/test/prism/snapshots/seattlerb/str_pct_nested_nested.txt b/test/prism/snapshots/seattlerb/str_pct_nested_nested.txt new file mode 100644 index 0000000000..85ad89bc60 --- /dev/null +++ b/test/prism/snapshots/seattlerb/str_pct_nested_nested.txt @@ -0,0 +1,39 @@ +@ ProgramNode (location: (1,0)-(1,20)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,20)) + └── body: (length: 1) + └── @ InterpolatedStringNode (location: (1,0)-(1,20)) + ├── opening_loc: (1,0)-(1,2) = "%{" + ├── parts: (length: 3) + │ ├── @ StringNode (location: (1,2)-(1,5)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (1,2)-(1,5) = " { " + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: " { " + │ ├── @ EmbeddedStatementsNode (location: (1,5)-(1,16)) + │ │ ├── opening_loc: (1,5)-(1,7) = "\#{" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (1,8)-(1,14)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ InterpolatedStringNode (location: (1,8)-(1,14)) + │ │ │ ├── opening_loc: (1,8)-(1,9) = "\"" + │ │ │ ├── parts: (length: 1) + │ │ │ │ └── @ EmbeddedStatementsNode (location: (1,9)-(1,13)) + │ │ │ │ ├── opening_loc: (1,9)-(1,11) = "\#{" + │ │ │ │ ├── statements: + │ │ │ │ │ @ StatementsNode (location: (1,11)-(1,12)) + │ │ │ │ │ └── body: (length: 1) + │ │ │ │ │ └── @ IntegerNode (location: (1,11)-(1,12)) + │ │ │ │ │ └── flags: decimal + │ │ │ │ └── closing_loc: (1,12)-(1,13) = "}" + │ │ │ └── closing_loc: (1,13)-(1,14) = "\"" + │ │ └── closing_loc: (1,15)-(1,16) = "}" + │ └── @ StringNode (location: (1,16)-(1,19)) + │ ├── flags: ∅ + │ ├── opening_loc: ∅ + │ ├── content_loc: (1,16)-(1,19) = " } " + │ ├── closing_loc: ∅ + │ └── unescaped: " } " + └── closing_loc: (1,19)-(1,20) = "}" diff --git a/test/prism/snapshots/seattlerb/str_pct_q.txt b/test/prism/snapshots/seattlerb/str_pct_q.txt new file mode 100644 index 0000000000..c4dd5bacae --- /dev/null +++ b/test/prism/snapshots/seattlerb/str_pct_q.txt @@ -0,0 +1,11 @@ +@ ProgramNode (location: (1,0)-(1,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,9)) + └── body: (length: 1) + └── @ StringNode (location: (1,0)-(1,9)) + ├── flags: ∅ + ├── opening_loc: (1,0)-(1,3) = "%q{" + ├── content_loc: (1,3)-(1,8) = "a b c" + ├── closing_loc: (1,8)-(1,9) = "}" + └── unescaped: "a b c" diff --git a/test/prism/snapshots/seattlerb/str_single_double_escaped_newline.txt b/test/prism/snapshots/seattlerb/str_single_double_escaped_newline.txt new file mode 100644 index 0000000000..6b155de886 --- /dev/null +++ b/test/prism/snapshots/seattlerb/str_single_double_escaped_newline.txt @@ -0,0 +1,33 @@ +@ ProgramNode (location: (1,0)-(1,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,9)) + └── body: (length: 2) + ├── @ CallNode (location: (1,0)-(1,7)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,2)-(1,7)) + │ │ └── arguments: (length: 1) + │ │ └── @ StringNode (location: (1,2)-(1,7)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (1,2)-(1,3) = "'" + │ │ ├── content_loc: (1,3)-(1,6) = "\\\\n" + │ │ ├── closing_loc: (1,6)-(1,7) = "'" + │ │ └── unescaped: "\\n" + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "a" + └── @ CallNode (location: (1,8)-(1,9)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,8)-(1,9) = "b" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: variable_call + └── name: "b" diff --git a/test/prism/snapshots/seattlerb/str_single_escaped_newline.txt b/test/prism/snapshots/seattlerb/str_single_escaped_newline.txt new file mode 100644 index 0000000000..ba2e204b68 --- /dev/null +++ b/test/prism/snapshots/seattlerb/str_single_escaped_newline.txt @@ -0,0 +1,33 @@ +@ ProgramNode (location: (1,0)-(1,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,8)) + └── body: (length: 2) + ├── @ CallNode (location: (1,0)-(1,6)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,2)-(1,6)) + │ │ └── arguments: (length: 1) + │ │ └── @ StringNode (location: (1,2)-(1,6)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (1,2)-(1,3) = "'" + │ │ ├── content_loc: (1,3)-(1,5) = "\\n" + │ │ ├── closing_loc: (1,5)-(1,6) = "'" + │ │ └── unescaped: "\\n" + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "a" + └── @ CallNode (location: (1,7)-(1,8)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (1,7)-(1,8) = "b" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: variable_call + └── name: "b" diff --git a/test/prism/snapshots/seattlerb/str_single_newline.txt b/test/prism/snapshots/seattlerb/str_single_newline.txt new file mode 100644 index 0000000000..18a96fbee6 --- /dev/null +++ b/test/prism/snapshots/seattlerb/str_single_newline.txt @@ -0,0 +1,33 @@ +@ ProgramNode (location: (1,0)-(2,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,3)) + └── body: (length: 2) + ├── @ CallNode (location: (1,0)-(2,1)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,2)-(2,1)) + │ │ └── arguments: (length: 1) + │ │ └── @ StringNode (location: (1,2)-(2,1)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (1,2)-(1,3) = "'" + │ │ ├── content_loc: (1,3)-(1,0) = "\n" + │ │ ├── closing_loc: (2,0)-(2,1) = "'" + │ │ └── unescaped: "\n" + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "a" + └── @ CallNode (location: (2,2)-(2,3)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (2,2)-(2,3) = "b" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: variable_call + └── name: "b" diff --git a/test/prism/snapshots/seattlerb/str_str.txt b/test/prism/snapshots/seattlerb/str_str.txt new file mode 100644 index 0000000000..f183980f5e --- /dev/null +++ b/test/prism/snapshots/seattlerb/str_str.txt @@ -0,0 +1,27 @@ +@ ProgramNode (location: (1,0)-(1,10)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,10)) + └── body: (length: 1) + └── @ InterpolatedStringNode (location: (1,0)-(1,10)) + ├── opening_loc: (1,0)-(1,1) = "\"" + ├── parts: (length: 2) + │ ├── @ StringNode (location: (1,1)-(1,3)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (1,1)-(1,3) = "a " + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a " + │ └── @ EmbeddedStatementsNode (location: (1,3)-(1,9)) + │ ├── opening_loc: (1,3)-(1,5) = "\#{" + │ ├── statements: + │ │ @ StatementsNode (location: (1,5)-(1,8)) + │ │ └── body: (length: 1) + │ │ └── @ StringNode (location: (1,5)-(1,8)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (1,5)-(1,6) = "'" + │ │ ├── content_loc: (1,6)-(1,7) = "b" + │ │ ├── closing_loc: (1,7)-(1,8) = "'" + │ │ └── unescaped: "b" + │ └── closing_loc: (1,8)-(1,9) = "}" + └── closing_loc: (1,9)-(1,10) = "\"" diff --git a/test/prism/snapshots/seattlerb/str_str_str.txt b/test/prism/snapshots/seattlerb/str_str_str.txt new file mode 100644 index 0000000000..68873d8182 --- /dev/null +++ b/test/prism/snapshots/seattlerb/str_str_str.txt @@ -0,0 +1,33 @@ +@ ProgramNode (location: (1,0)-(1,12)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,12)) + └── body: (length: 1) + └── @ InterpolatedStringNode (location: (1,0)-(1,12)) + ├── opening_loc: (1,0)-(1,1) = "\"" + ├── parts: (length: 3) + │ ├── @ StringNode (location: (1,1)-(1,3)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (1,1)-(1,3) = "a " + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a " + │ ├── @ EmbeddedStatementsNode (location: (1,3)-(1,9)) + │ │ ├── opening_loc: (1,3)-(1,5) = "\#{" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (1,5)-(1,8)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ StringNode (location: (1,5)-(1,8)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (1,5)-(1,6) = "'" + │ │ │ ├── content_loc: (1,6)-(1,7) = "b" + │ │ │ ├── closing_loc: (1,7)-(1,8) = "'" + │ │ │ └── unescaped: "b" + │ │ └── closing_loc: (1,8)-(1,9) = "}" + │ └── @ StringNode (location: (1,9)-(1,11)) + │ ├── flags: ∅ + │ ├── opening_loc: ∅ + │ ├── content_loc: (1,9)-(1,11) = " c" + │ ├── closing_loc: ∅ + │ └── unescaped: " c" + └── closing_loc: (1,11)-(1,12) = "\"" diff --git a/test/prism/snapshots/seattlerb/super_arg.txt b/test/prism/snapshots/seattlerb/super_arg.txt new file mode 100644 index 0000000000..41109adcc3 --- /dev/null +++ b/test/prism/snapshots/seattlerb/super_arg.txt @@ -0,0 +1,15 @@ +@ ProgramNode (location: (1,0)-(1,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,8)) + └── body: (length: 1) + └── @ SuperNode (location: (1,0)-(1,8)) + ├── keyword_loc: (1,0)-(1,5) = "super" + ├── lparen_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,6)-(1,8)) + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,6)-(1,8)) + │ └── flags: decimal + ├── rparen_loc: ∅ + └── block: ∅ diff --git a/test/prism/snapshots/seattlerb/symbol_empty.txt b/test/prism/snapshots/seattlerb/symbol_empty.txt new file mode 100644 index 0000000000..ab423959a0 --- /dev/null +++ b/test/prism/snapshots/seattlerb/symbol_empty.txt @@ -0,0 +1,10 @@ +@ ProgramNode (location: (1,0)-(1,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,3)) + └── body: (length: 1) + └── @ SymbolNode (location: (1,0)-(1,3)) + ├── opening_loc: (1,0)-(1,2) = ":'" + ├── value_loc: (1,2)-(1,2) = "" + ├── closing_loc: (1,2)-(1,3) = "'" + └── unescaped: "" diff --git a/test/prism/snapshots/seattlerb/symbol_list.txt b/test/prism/snapshots/seattlerb/symbol_list.txt new file mode 100644 index 0000000000..834543195d --- /dev/null +++ b/test/prism/snapshots/seattlerb/symbol_list.txt @@ -0,0 +1,49 @@ +@ ProgramNode (location: (1,0)-(1,13)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,13)) + └── body: (length: 1) + └── @ ArrayNode (location: (1,0)-(1,13)) + ├── elements: (length: 2) + │ ├── @ InterpolatedSymbolNode (location: (1,3)-(1,7)) + │ │ ├── opening_loc: ∅ + │ │ ├── parts: (length: 1) + │ │ │ └── @ EmbeddedStatementsNode (location: (1,3)-(1,7)) + │ │ │ ├── opening_loc: (1,3)-(1,5) = "\#{" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (1,5)-(1,6)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (1,5)-(1,6)) + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── message_loc: (1,5)-(1,6) = "a" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── block: ∅ + │ │ │ │ ├── flags: variable_call + │ │ │ │ └── name: "a" + │ │ │ └── closing_loc: (1,6)-(1,7) = "}" + │ │ └── closing_loc: ∅ + │ └── @ InterpolatedSymbolNode (location: (1,8)-(1,12)) + │ ├── opening_loc: ∅ + │ ├── parts: (length: 1) + │ │ └── @ EmbeddedStatementsNode (location: (1,8)-(1,12)) + │ │ ├── opening_loc: (1,8)-(1,10) = "\#{" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (1,10)-(1,11)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (1,10)-(1,11)) + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── message_loc: (1,10)-(1,11) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── block: ∅ + │ │ │ ├── flags: variable_call + │ │ │ └── name: "b" + │ │ └── closing_loc: (1,11)-(1,12) = "}" + │ └── closing_loc: ∅ + ├── opening_loc: (1,0)-(1,3) = "%I[" + └── closing_loc: (1,12)-(1,13) = "]" diff --git a/test/prism/snapshots/seattlerb/symbols.txt b/test/prism/snapshots/seattlerb/symbols.txt new file mode 100644 index 0000000000..1d4eae94aa --- /dev/null +++ b/test/prism/snapshots/seattlerb/symbols.txt @@ -0,0 +1,24 @@ +@ ProgramNode (location: (1,0)-(1,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,9)) + └── body: (length: 1) + └── @ ArrayNode (location: (1,0)-(1,9)) + ├── elements: (length: 3) + │ ├── @ SymbolNode (location: (1,3)-(1,4)) + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (1,3)-(1,4) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── @ SymbolNode (location: (1,5)-(1,6)) + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (1,5)-(1,6) = "b" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "b" + │ └── @ SymbolNode (location: (1,7)-(1,8)) + │ ├── opening_loc: ∅ + │ ├── value_loc: (1,7)-(1,8) = "c" + │ ├── closing_loc: ∅ + │ └── unescaped: "c" + ├── opening_loc: (1,0)-(1,3) = "%i(" + └── closing_loc: (1,8)-(1,9) = ")" diff --git a/test/prism/snapshots/seattlerb/symbols_empty.txt b/test/prism/snapshots/seattlerb/symbols_empty.txt new file mode 100644 index 0000000000..74800d6bc6 --- /dev/null +++ b/test/prism/snapshots/seattlerb/symbols_empty.txt @@ -0,0 +1,9 @@ +@ ProgramNode (location: (1,0)-(1,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,4)) + └── body: (length: 1) + └── @ ArrayNode (location: (1,0)-(1,4)) + ├── elements: (length: 0) + ├── opening_loc: (1,0)-(1,3) = "%i(" + └── closing_loc: (1,3)-(1,4) = ")" diff --git a/test/prism/snapshots/seattlerb/symbols_empty_space.txt b/test/prism/snapshots/seattlerb/symbols_empty_space.txt new file mode 100644 index 0000000000..bff515a6dc --- /dev/null +++ b/test/prism/snapshots/seattlerb/symbols_empty_space.txt @@ -0,0 +1,9 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ ArrayNode (location: (1,0)-(1,5)) + ├── elements: (length: 0) + ├── opening_loc: (1,0)-(1,3) = "%i(" + └── closing_loc: (1,4)-(1,5) = ")" diff --git a/test/prism/snapshots/seattlerb/symbols_interp.txt b/test/prism/snapshots/seattlerb/symbols_interp.txt new file mode 100644 index 0000000000..6d7f614211 --- /dev/null +++ b/test/prism/snapshots/seattlerb/symbols_interp.txt @@ -0,0 +1,24 @@ +@ ProgramNode (location: (1,0)-(1,15)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,15)) + └── body: (length: 1) + └── @ ArrayNode (location: (1,0)-(1,15)) + ├── elements: (length: 3) + │ ├── @ SymbolNode (location: (1,3)-(1,4)) + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (1,3)-(1,4) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── @ SymbolNode (location: (1,5)-(1,12)) + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (1,5)-(1,12) = "b\#{1+1}" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "b\#{1+1}" + │ └── @ SymbolNode (location: (1,13)-(1,14)) + │ ├── opening_loc: ∅ + │ ├── value_loc: (1,13)-(1,14) = "c" + │ ├── closing_loc: ∅ + │ └── unescaped: "c" + ├── opening_loc: (1,0)-(1,3) = "%i(" + └── closing_loc: (1,14)-(1,15) = ")" diff --git a/test/prism/snapshots/seattlerb/thingy.txt b/test/prism/snapshots/seattlerb/thingy.txt new file mode 100644 index 0000000000..96c76e64b6 --- /dev/null +++ b/test/prism/snapshots/seattlerb/thingy.txt @@ -0,0 +1,53 @@ +@ ProgramNode (location: (1,0)-(3,7)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,7)) + └── body: (length: 2) + ├── @ CallNode (location: (1,0)-(1,6)) + │ ├── receiver: + │ │ @ CallNode (location: (1,0)-(1,1)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,0)-(1,1) = "f" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "f" + │ ├── call_operator_loc: (1,1)-(1,2) = "." + │ ├── message_loc: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,3)-(1,5)) + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (1,3)-(1,5)) + │ │ └── flags: decimal + │ ├── closing_loc: (1,5)-(1,6) = ")" + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "call" + └── @ CallNode (location: (3,0)-(3,7)) + ├── receiver: + │ @ CallNode (location: (3,0)-(3,1)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (3,0)-(3,1) = "f" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "f" + ├── call_operator_loc: (3,1)-(3,3) = "::" + ├── message_loc: ∅ + ├── opening_loc: (3,3)-(3,4) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (3,4)-(3,6)) + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (3,4)-(3,6)) + │ └── flags: decimal + ├── closing_loc: (3,6)-(3,7) = ")" + ├── block: ∅ + ├── flags: ∅ + └── name: "call" diff --git a/test/prism/snapshots/seattlerb/uminus_float.txt b/test/prism/snapshots/seattlerb/uminus_float.txt new file mode 100644 index 0000000000..b509e2f7f3 --- /dev/null +++ b/test/prism/snapshots/seattlerb/uminus_float.txt @@ -0,0 +1,6 @@ +@ ProgramNode (location: (1,0)-(1,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,4)) + └── body: (length: 1) + └── @ FloatNode (location: (1,0)-(1,4)) diff --git a/test/prism/snapshots/seattlerb/unary_minus.txt b/test/prism/snapshots/seattlerb/unary_minus.txt new file mode 100644 index 0000000000..e69aaaadec --- /dev/null +++ b/test/prism/snapshots/seattlerb/unary_minus.txt @@ -0,0 +1,25 @@ +@ ProgramNode (location: (1,0)-(1,2)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,2)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,2)) + ├── receiver: + │ @ CallNode (location: (1,1)-(1,2)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,1)-(1,2) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "a" + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "-" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "-@" diff --git a/test/prism/snapshots/seattlerb/unary_plus.txt b/test/prism/snapshots/seattlerb/unary_plus.txt new file mode 100644 index 0000000000..4d6c27805a --- /dev/null +++ b/test/prism/snapshots/seattlerb/unary_plus.txt @@ -0,0 +1,25 @@ +@ ProgramNode (location: (1,0)-(1,2)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,2)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,2)) + ├── receiver: + │ @ CallNode (location: (1,1)-(1,2)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,1)-(1,2) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "a" + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "+" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "+@" diff --git a/test/prism/snapshots/seattlerb/unary_plus_on_literal.txt b/test/prism/snapshots/seattlerb/unary_plus_on_literal.txt new file mode 100644 index 0000000000..9d1cb6a12c --- /dev/null +++ b/test/prism/snapshots/seattlerb/unary_plus_on_literal.txt @@ -0,0 +1,20 @@ +@ ProgramNode (location: (1,0)-(1,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,3)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,3)) + ├── receiver: + │ @ SymbolNode (location: (1,1)-(1,3)) + │ ├── opening_loc: (1,1)-(1,2) = ":" + │ ├── value_loc: (1,2)-(1,3) = "a" + │ ├── closing_loc: ∅ + │ └── unescaped: "a" + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "+" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "+@" diff --git a/test/prism/snapshots/seattlerb/unary_tilde.txt b/test/prism/snapshots/seattlerb/unary_tilde.txt new file mode 100644 index 0000000000..aa413484dc --- /dev/null +++ b/test/prism/snapshots/seattlerb/unary_tilde.txt @@ -0,0 +1,25 @@ +@ ProgramNode (location: (1,0)-(1,2)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,2)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,2)) + ├── receiver: + │ @ CallNode (location: (1,1)-(1,2)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,1)-(1,2) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "a" + ├── call_operator_loc: ∅ + ├── message_loc: (1,0)-(1,1) = "~" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "~" diff --git a/test/prism/snapshots/seattlerb/utf8_bom.txt b/test/prism/snapshots/seattlerb/utf8_bom.txt new file mode 100644 index 0000000000..6e56393521 --- /dev/null +++ b/test/prism/snapshots/seattlerb/utf8_bom.txt @@ -0,0 +1,19 @@ +@ ProgramNode (location: (2,0)-(2,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (2,0)-(2,3)) + └── body: (length: 1) + └── @ CallNode (location: (2,0)-(2,3)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (2,0)-(2,1) = "p" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (2,2)-(2,3)) + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (2,2)-(2,3)) + │ └── flags: decimal + ├── closing_loc: ∅ + ├── block: ∅ + ├── flags: ∅ + └── name: "p" diff --git a/test/prism/snapshots/seattlerb/when_splat.txt b/test/prism/snapshots/seattlerb/when_splat.txt new file mode 100644 index 0000000000..bdeae40fba --- /dev/null +++ b/test/prism/snapshots/seattlerb/when_splat.txt @@ -0,0 +1,38 @@ +@ ProgramNode (location: (1,0)-(1,25)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,25)) + └── body: (length: 1) + └── @ CaseNode (location: (1,0)-(1,25)) + ├── predicate: + │ @ CallNode (location: (1,5)-(1,6)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (1,5)-(1,6) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: variable_call + │ └── name: "a" + ├── conditions: (length: 1) + │ └── @ WhenNode (location: (1,8)-(1,15)) + │ ├── keyword_loc: (1,8)-(1,12) = "when" + │ ├── conditions: (length: 1) + │ │ └── @ SplatNode (location: (1,13)-(1,15)) + │ │ ├── operator_loc: (1,13)-(1,14) = "*" + │ │ └── expression: + │ │ @ CallNode (location: (1,14)-(1,15)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (1,14)-(1,15) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: variable_call + │ │ └── name: "b" + │ └── statements: ∅ + ├── consequent: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (1,22)-(1,25) = "end" diff --git a/test/prism/snapshots/seattlerb/words_interp.txt b/test/prism/snapshots/seattlerb/words_interp.txt new file mode 100644 index 0000000000..eddc835f02 --- /dev/null +++ b/test/prism/snapshots/seattlerb/words_interp.txt @@ -0,0 +1,27 @@ +@ ProgramNode (location: (1,0)-(1,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,9)) + └── body: (length: 1) + └── @ ArrayNode (location: (1,0)-(1,9)) + ├── elements: (length: 1) + │ └── @ InterpolatedStringNode (location: (1,3)-(1,8)) + │ ├── opening_loc: ∅ + │ ├── parts: (length: 2) + │ │ ├── @ EmbeddedStatementsNode (location: (1,3)-(1,7)) + │ │ │ ├── opening_loc: (1,3)-(1,5) = "\#{" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (1,5)-(1,6)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (1,5)-(1,6)) + │ │ │ │ └── flags: decimal + │ │ │ └── closing_loc: (1,6)-(1,7) = "}" + │ │ └── @ StringNode (location: (1,7)-(1,8)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (1,7)-(1,8) = "b" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "b" + │ └── closing_loc: ∅ + ├── opening_loc: (1,0)-(1,3) = "%W(" + └── closing_loc: (1,8)-(1,9) = ")" diff --git a/test/prism/snapshots/seattlerb/yield_arg.txt b/test/prism/snapshots/seattlerb/yield_arg.txt new file mode 100644 index 0000000000..ae6a5d2b0b --- /dev/null +++ b/test/prism/snapshots/seattlerb/yield_arg.txt @@ -0,0 +1,14 @@ +@ ProgramNode (location: (1,0)-(1,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,8)) + └── body: (length: 1) + └── @ YieldNode (location: (1,0)-(1,8)) + ├── keyword_loc: (1,0)-(1,5) = "yield" + ├── lparen_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,6)-(1,8)) + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,6)-(1,8)) + │ └── flags: decimal + └── rparen_loc: ∅ diff --git a/test/prism/snapshots/seattlerb/yield_call_assocs.txt b/test/prism/snapshots/seattlerb/yield_call_assocs.txt new file mode 100644 index 0000000000..6964a034c4 --- /dev/null +++ b/test/prism/snapshots/seattlerb/yield_call_assocs.txt @@ -0,0 +1,193 @@ +@ ProgramNode (location: (1,0)-(11,13)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(11,13)) + └── body: (length: 6) + ├── @ YieldNode (location: (1,0)-(1,16)) + │ ├── keyword_loc: (1,0)-(1,5) = "yield" + │ ├── lparen_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,6)-(1,16)) + │ │ └── arguments: (length: 2) + │ │ ├── @ IntegerNode (location: (1,6)-(1,7)) + │ │ │ └── flags: decimal + │ │ └── @ KeywordHashNode (location: (1,9)-(1,16)) + │ │ └── elements: (length: 1) + │ │ └── @ AssocNode (location: (1,9)-(1,16)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (1,9)-(1,11)) + │ │ │ ├── opening_loc: (1,9)-(1,10) = ":" + │ │ │ ├── value_loc: (1,10)-(1,11) = "z" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "z" + │ │ ├── value: + │ │ │ @ IntegerNode (location: (1,15)-(1,16)) + │ │ │ └── flags: decimal + │ │ └── operator_loc: (1,12)-(1,14) = "=>" + │ └── rparen_loc: ∅ + ├── @ YieldNode (location: (3,0)-(3,25)) + │ ├── keyword_loc: (3,0)-(3,5) = "yield" + │ ├── lparen_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (3,6)-(3,25)) + │ │ └── arguments: (length: 2) + │ │ ├── @ IntegerNode (location: (3,6)-(3,7)) + │ │ │ └── flags: decimal + │ │ └── @ KeywordHashNode (location: (3,9)-(3,25)) + │ │ └── elements: (length: 2) + │ │ ├── @ AssocNode (location: (3,9)-(3,16)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (3,9)-(3,11)) + │ │ │ │ ├── opening_loc: (3,9)-(3,10) = ":" + │ │ │ │ ├── value_loc: (3,10)-(3,11) = "z" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "z" + │ │ │ ├── value: + │ │ │ │ @ IntegerNode (location: (3,15)-(3,16)) + │ │ │ │ └── flags: decimal + │ │ │ └── operator_loc: (3,12)-(3,14) = "=>" + │ │ └── @ AssocNode (location: (3,18)-(3,25)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (3,18)-(3,20)) + │ │ │ ├── opening_loc: (3,18)-(3,19) = ":" + │ │ │ ├── value_loc: (3,19)-(3,20) = "w" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "w" + │ │ ├── value: + │ │ │ @ IntegerNode (location: (3,24)-(3,25)) + │ │ │ └── flags: decimal + │ │ └── operator_loc: (3,21)-(3,23) = "=>" + │ └── rparen_loc: ∅ + ├── @ YieldNode (location: (5,0)-(5,13)) + │ ├── keyword_loc: (5,0)-(5,5) = "yield" + │ ├── lparen_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (5,6)-(5,13)) + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (5,6)-(5,13)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (5,6)-(5,7) = "y" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (5,8)-(5,13)) + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ KeywordHashNode (location: (5,8)-(5,13)) + │ │ │ └── elements: (length: 1) + │ │ │ └── @ AssocNode (location: (5,8)-(5,13)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (5,8)-(5,10)) + │ │ │ │ ├── opening_loc: (5,8)-(5,9) = ":" + │ │ │ │ ├── value_loc: (5,9)-(5,10) = "z" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "z" + │ │ │ ├── value: + │ │ │ │ @ IntegerNode (location: (5,12)-(5,13)) + │ │ │ │ └── flags: decimal + │ │ │ └── operator_loc: (5,10)-(5,12) = "=>" + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: ∅ + │ │ └── name: "y" + │ └── rparen_loc: ∅ + ├── @ YieldNode (location: (7,0)-(7,11)) + │ ├── keyword_loc: (7,0)-(7,5) = "yield" + │ ├── lparen_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (7,6)-(7,11)) + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (7,6)-(7,11)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (7,6)-(7,7) = "y" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (7,8)-(7,11)) + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ KeywordHashNode (location: (7,8)-(7,11)) + │ │ │ └── elements: (length: 1) + │ │ │ └── @ AssocNode (location: (7,8)-(7,11)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (7,8)-(7,10)) + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (7,8)-(7,9) = "z" + │ │ │ │ ├── closing_loc: (7,9)-(7,10) = ":" + │ │ │ │ └── unescaped: "z" + │ │ │ ├── value: + │ │ │ │ @ IntegerNode (location: (7,10)-(7,11)) + │ │ │ │ └── flags: decimal + │ │ │ └── operator_loc: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: ∅ + │ │ ├── flags: ∅ + │ │ └── name: "y" + │ └── rparen_loc: ∅ + ├── @ YieldNode (location: (9,0)-(9,12)) + │ ├── keyword_loc: (9,0)-(9,5) = "yield" + │ ├── lparen_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (9,6)-(9,12)) + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (9,6)-(9,12)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (9,6)-(9,7) = "y" + │ │ ├── opening_loc: (9,7)-(9,8) = "(" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (9,8)-(9,11)) + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ KeywordHashNode (location: (9,8)-(9,11)) + │ │ │ └── elements: (length: 1) + │ │ │ └── @ AssocNode (location: (9,8)-(9,11)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (9,8)-(9,10)) + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (9,8)-(9,9) = "z" + │ │ │ │ ├── closing_loc: (9,9)-(9,10) = ":" + │ │ │ │ └── unescaped: "z" + │ │ │ ├── value: + │ │ │ │ @ IntegerNode (location: (9,10)-(9,11)) + │ │ │ │ └── flags: decimal + │ │ │ └── operator_loc: ∅ + │ │ ├── closing_loc: (9,11)-(9,12) = ")" + │ │ ├── block: ∅ + │ │ ├── flags: ∅ + │ │ └── name: "y" + │ └── rparen_loc: ∅ + └── @ YieldNode (location: (11,0)-(11,13)) + ├── keyword_loc: (11,0)-(11,5) = "yield" + ├── lparen_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (11,6)-(11,13)) + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (11,6)-(11,13)) + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (11,6)-(11,7) = "y" + │ ├── opening_loc: (11,7)-(11,8) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (11,8)-(11,12)) + │ │ └── arguments: (length: 1) + │ │ └── @ KeywordHashNode (location: (11,8)-(11,12)) + │ │ └── elements: (length: 1) + │ │ └── @ AssocNode (location: (11,8)-(11,12)) + │ │ ├── key: + │ │ │ @ CallNode (location: (11,8)-(11,9)) + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── message_loc: (11,8)-(11,9) = "z" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── block: ∅ + │ │ │ ├── flags: variable_call + │ │ │ └── name: "z" + │ │ ├── value: + │ │ │ @ IntegerNode (location: (11,11)-(11,12)) + │ │ │ └── flags: decimal + │ │ └── operator_loc: (11,9)-(11,11) = "=>" + │ ├── closing_loc: (11,12)-(11,13) = ")" + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: "y" + └── rparen_loc: ∅ diff --git a/test/prism/snapshots/seattlerb/yield_empty_parens.txt b/test/prism/snapshots/seattlerb/yield_empty_parens.txt new file mode 100644 index 0000000000..5ecd89823f --- /dev/null +++ b/test/prism/snapshots/seattlerb/yield_empty_parens.txt @@ -0,0 +1,10 @@ +@ ProgramNode (location: (1,0)-(1,7)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,7)) + └── body: (length: 1) + └── @ YieldNode (location: (1,0)-(1,7)) + ├── keyword_loc: (1,0)-(1,5) = "yield" + ├── lparen_loc: (1,5)-(1,6) = "(" + ├── arguments: ∅ + └── rparen_loc: (1,6)-(1,7) = ")" |