diff options
Diffstat (limited to 'test/prism/snapshots/seattlerb')
487 files changed, 20350 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..246f39cbba --- /dev/null +++ b/test/prism/snapshots/seattlerb/BEGIN.txt @@ -0,0 +1,15 @@ +@ 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 + │ └── value: 42 + ├── 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..fabc92e477 --- /dev/null +++ b/test/prism/snapshots/seattlerb/TestRubyParserShared.txt @@ -0,0 +1,361 @@ +@ ProgramNode (location: (1,0)-(92,1)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(92,1)) + └── body: (length: 16) + ├── @ ArrayNode (location: (1,0)-(4,1)) + │ ├── flags: ∅ + │ ├── elements: (length: 0) + │ ├── opening_loc: (1,0)-(1,3) = "%I[" + │ └── closing_loc: (4,0)-(4,1) = "]" + ├── @ ArrayNode (location: (6,0)-(9,1)) + │ ├── flags: ∅ + │ ├── elements: (length: 2) + │ │ ├── @ SymbolNode (location: (7,0)-(7,5)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (7,0)-(7,5) = "line2" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "line2" + │ │ └── @ SymbolNode (location: (8,0)-(8,5)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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)) + │ ├── flags: ∅ + │ ├── elements: (length: 0) + │ ├── opening_loc: (11,0)-(11,3) = "%W[" + │ └── closing_loc: (14,0)-(14,1) = "]" + ├── @ ArrayNode (location: (16,0)-(19,1)) + │ ├── flags: ∅ + │ ├── 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)) + │ ├── flags: ∅ + │ ├── elements: (length: 0) + │ ├── opening_loc: (21,0)-(21,3) = "%i[" + │ └── closing_loc: (24,0)-(24,1) = "]" + ├── @ ArrayNode (location: (26,0)-(29,1)) + │ ├── flags: ∅ + │ ├── elements: (length: 2) + │ │ ├── @ SymbolNode (location: (27,0)-(27,5)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (27,0)-(27,5) = "line2" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "line2" + │ │ └── @ SymbolNode (location: (28,0)-(28,5)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (31,0)-(31,3) = "%r[" + │ ├── content_loc: (31,3)-(34,0) = "\n\n\n" + │ ├── closing_loc: (34,0)-(34,1) = "]" + │ └── unescaped: "\n\n\n" + ├── @ ArrayNode (location: (36,0)-(39,1)) + │ ├── flags: ∅ + │ ├── elements: (length: 0) + │ ├── opening_loc: (36,0)-(36,3) = "%w[" + │ └── closing_loc: (39,0)-(39,1) = "]" + ├── @ ArrayNode (location: (41,0)-(44,1)) + │ ├── flags: ∅ + │ ├── 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)) + │ ├── flags: ∅ + │ ├── elements: (length: 2) + │ │ ├── @ SymbolNode (location: (47,0)-(47,6)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (47,0)-(47,1) = ":" + │ │ │ ├── value_loc: (47,1)-(47,6) = "line2" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "line2" + │ │ └── @ SymbolNode (location: (48,0)-(48,6)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── name: :a + │ │ │ │ └── @ RequiredParameterNode (location: (53,8)-(53,9)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── 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)) + │ │ │ ├── flags: ∅ + │ │ │ ├── receiver: + │ │ │ │ @ LocalVariableReadNode (location: (54,4)-(54,5)) + │ │ │ │ ├── name: :a + │ │ │ │ └── depth: 0 + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :+ + │ │ │ ├── message_loc: (54,6)-(54,7) = "+" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (54,8)-(54,9)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ LocalVariableReadNode (location: (54,8)-(54,9)) + │ │ │ │ ├── name: :b + │ │ │ │ └── depth: 0 + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── 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 + │ │ │ │ └── value: 42 + │ │ │ └── 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)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── name: :a + │ │ │ │ └── @ RequiredParameterNode (location: (68,8)-(68,9)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── 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)) + │ │ │ ├── flags: ∅ + │ │ │ ├── receiver: + │ │ │ │ @ LocalVariableReadNode (location: (69,4)-(69,5)) + │ │ │ │ ├── name: :a + │ │ │ │ └── depth: 0 + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :+ + │ │ │ ├── message_loc: (69,6)-(69,7) = "+" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (69,8)-(69,9)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ LocalVariableReadNode (location: (69,8)-(69,9)) + │ │ │ │ ├── name: :b + │ │ │ │ └── depth: 0 + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── 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)) + │ │ │ ├── flags: ∅ + │ │ │ ├── elements: (length: 2) + │ │ │ │ ├── @ SymbolNode (location: (76,4)-(76,10)) + │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ ├── opening_loc: (76,4)-(76,5) = ":" + │ │ │ │ │ ├── value_loc: (76,5)-(76,10) = "line3" + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── unescaped: "line3" + │ │ │ │ └── @ SymbolNode (location: (77,4)-(77,10)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── 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 + │ │ │ │ └── value: 42 + │ │ │ └── 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)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :x + ├── message_loc: (89,0)-(89,1) = "x" + ├── opening_loc: (89,1)-(89,2) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (90,0)-(91,6)) + │ ├── flags: ∅ + │ └── arguments: (length: 2) + │ ├── @ SymbolNode (location: (90,0)-(90,6)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (90,0)-(90,1) = ":" + │ │ ├── value_loc: (90,1)-(90,6) = "line2" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "line2" + │ └── @ SymbolNode (location: (91,0)-(91,6)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (91,0)-(91,1) = ":" + │ ├── value_loc: (91,1)-(91,6) = "line3" + │ ├── closing_loc: ∅ + │ └── unescaped: "line3" + ├── closing_loc: (92,0)-(92,1) = ")" + └── block: ∅ 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..a2586423d7 --- /dev/null +++ b/test/prism/snapshots/seattlerb/alias_gvar_backref.txt @@ -0,0 +1,13 @@ +@ 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)) + │ └── name: :$& + └── 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..99ed696c68 --- /dev/null +++ b/test/prism/snapshots/seattlerb/alias_resword.txt @@ -0,0 +1,21 @@ +@ 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)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: ∅ + │ ├── value_loc: (1,6)-(1,8) = "in" + │ ├── closing_loc: ∅ + │ └── unescaped: "in" + ├── old_name: + │ @ SymbolNode (location: (1,9)-(1,12)) + │ ├── flags: forced_us_ascii_encoding + │ ├── 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..b60b131fd2 --- /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)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ FalseNode (location: (2,4)-(2,9)) + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :! + │ │ ├── message_loc: (2,0)-(2,3) = "not" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── 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..b729186dc5 --- /dev/null +++ b/test/prism/snapshots/seattlerb/aref_args_assocs.txt @@ -0,0 +1,23 @@ +@ ProgramNode (location: (1,0)-(1,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,8)) + └── body: (length: 1) + └── @ ArrayNode (location: (1,0)-(1,8)) + ├── flags: ∅ + ├── elements: (length: 1) + │ └── @ KeywordHashNode (location: (1,1)-(1,7)) + │ ├── flags: ∅ + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (1,1)-(1,7)) + │ ├── key: + │ │ @ IntegerNode (location: (1,1)-(1,2)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── value: + │ │ @ IntegerNode (location: (1,6)-(1,7)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ └── 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..0e9454d780 --- /dev/null +++ b/test/prism/snapshots/seattlerb/aref_args_lit_assocs.txt @@ -0,0 +1,26 @@ +@ ProgramNode (location: (1,0)-(1,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,11)) + └── body: (length: 1) + └── @ ArrayNode (location: (1,0)-(1,11)) + ├── flags: ∅ + ├── elements: (length: 2) + │ ├── @ IntegerNode (location: (1,1)-(1,2)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── @ KeywordHashNode (location: (1,4)-(1,10)) + │ ├── flags: ∅ + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (1,4)-(1,10)) + │ ├── key: + │ │ @ IntegerNode (location: (1,4)-(1,5)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── value: + │ │ @ IntegerNode (location: (1,9)-(1,10)) + │ │ ├── flags: decimal + │ │ └── value: 3 + │ └── 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..1ad933c74e --- /dev/null +++ b/test/prism/snapshots/seattlerb/args_kw_block.txt @@ -0,0 +1,39 @@ +@ 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) + │ │ └── @ OptionalKeywordParameterNode (location: (1,6)-(1,10)) + │ │ ├── flags: ∅ + │ │ ├── name: :a + │ │ ├── name_loc: (1,6)-(1,8) = "a:" + │ │ └── value: + │ │ @ IntegerNode (location: (1,9)-(1,10)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── keyword_rest: ∅ + │ └── block: + │ @ BlockParameterNode (location: (1,12)-(1,14)) + │ ├── flags: ∅ + │ ├── 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..880fedf933 --- /dev/null +++ b/test/prism/snapshots/seattlerb/array_line_breaks.txt @@ -0,0 +1,25 @@ +@ ProgramNode (location: (1,0)-(4,1)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,1)) + └── body: (length: 2) + ├── @ ArrayNode (location: (1,0)-(3,4)) + │ ├── flags: ∅ + │ ├── 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 + └── value: 1 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..d46a181fc7 --- /dev/null +++ b/test/prism/snapshots/seattlerb/array_lits_trailing_calls.txt @@ -0,0 +1,35 @@ +@ ProgramNode (location: (1,0)-(3,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,4)) + └── body: (length: 2) + ├── @ CallNode (location: (1,0)-(1,6)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ ArrayNode (location: (1,0)-(1,4)) + │ │ ├── flags: ∅ + │ │ ├── elements: (length: 0) + │ │ ├── opening_loc: (1,0)-(1,3) = "%w[" + │ │ └── closing_loc: (1,3)-(1,4) = "]" + │ ├── call_operator_loc: (1,4)-(1,5) = "." + │ ├── name: :b + │ ├── message_loc: (1,5)-(1,6) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ CallNode (location: (3,0)-(3,4)) + ├── flags: ∅ + ├── receiver: + │ @ ArrayNode (location: (3,0)-(3,2)) + │ ├── flags: ∅ + │ ├── elements: (length: 0) + │ ├── opening_loc: (3,0)-(3,1) = "[" + │ └── closing_loc: (3,1)-(3,2) = "]" + ├── call_operator_loc: (3,2)-(3,3) = "." + ├── name: :b + ├── message_loc: (3,3)-(3,4) = "b" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/prism/snapshots/seattlerb/assoc__bare.txt b/test/prism/snapshots/seattlerb/assoc__bare.txt new file mode 100644 index 0000000000..28e4f713c5 --- /dev/null +++ b/test/prism/snapshots/seattlerb/assoc__bare.txt @@ -0,0 +1,31 @@ +@ 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)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :y + │ │ ├── message_loc: (1,2)-(1,3) = "y" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── 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..70490c0da4 --- /dev/null +++ b/test/prism/snapshots/seattlerb/assoc_label.txt @@ -0,0 +1,34 @@ +@ ProgramNode (location: (1,0)-(1,6)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,6)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,6)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: (1,1)-(1,2) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,5)) + │ ├── flags: contains_keywords + │ └── arguments: (length: 1) + │ └── @ KeywordHashNode (location: (1,2)-(1,5)) + │ ├── flags: symbol_keys + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (1,2)-(1,5)) + │ ├── key: + │ │ @ SymbolNode (location: (1,2)-(1,4)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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 + │ │ └── value: 1 + │ └── operator_loc: ∅ + ├── closing_loc: (1,5)-(1,6) = ")" + └── block: ∅ 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..589433eda8 --- /dev/null +++ b/test/prism/snapshots/seattlerb/attr_asgn_colon_id.txt @@ -0,0 +1,23 @@ +@ ProgramNode (location: (1,0)-(1,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,8)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,8)) + ├── flags: attribute_write + ├── receiver: + │ @ ConstantReadNode (location: (1,0)-(1,1)) + │ └── name: :A + ├── call_operator_loc: (1,1)-(1,3) = "::" + ├── name: :b= + ├── message_loc: (1,3)-(1,4) = "b" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,7)-(1,8)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,7)-(1,8)) + │ ├── flags: decimal + │ └── value: 1 + ├── closing_loc: ∅ + └── block: ∅ 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..9b04ae9656 --- /dev/null +++ b/test/prism/snapshots/seattlerb/attrasgn_array_arg.txt @@ -0,0 +1,42 @@ +@ ProgramNode (location: (1,0)-(1,13)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,13)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,13)) + ├── flags: attribute_write + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: ∅ + ├── name: :[]= + ├── message_loc: (1,1)-(1,9) = "[[1, 2]]" + ├── opening_loc: (1,1)-(1,2) = "[" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,13)) + │ ├── flags: ∅ + │ └── arguments: (length: 2) + │ ├── @ ArrayNode (location: (1,2)-(1,8)) + │ │ ├── flags: ∅ + │ │ ├── elements: (length: 2) + │ │ │ ├── @ IntegerNode (location: (1,3)-(1,4)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ └── @ IntegerNode (location: (1,6)-(1,7)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ ├── opening_loc: (1,2)-(1,3) = "[" + │ │ └── closing_loc: (1,7)-(1,8) = "]" + │ └── @ IntegerNode (location: (1,12)-(1,13)) + │ ├── flags: decimal + │ └── value: 3 + ├── closing_loc: (1,8)-(1,9) = "]" + └── block: ∅ 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..39544e98da --- /dev/null +++ b/test/prism/snapshots/seattlerb/attrasgn_array_lhs.txt @@ -0,0 +1,83 @@ +@ ProgramNode (location: (1,0)-(1,42)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,42)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,42)) + ├── flags: attribute_write + ├── receiver: + │ @ ArrayNode (location: (1,0)-(1,12)) + │ ├── flags: ∅ + │ ├── elements: (length: 4) + │ │ ├── @ IntegerNode (location: (1,1)-(1,2)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── @ IntegerNode (location: (1,4)-(1,5)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ ├── @ IntegerNode (location: (1,7)-(1,8)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 3 + │ │ └── @ IntegerNode (location: (1,10)-(1,11)) + │ │ ├── flags: decimal + │ │ └── value: 4 + │ ├── opening_loc: (1,0)-(1,1) = "[" + │ └── closing_loc: (1,11)-(1,12) = "]" + ├── call_operator_loc: ∅ + ├── name: :[]= + ├── message_loc: (1,12)-(1,24) = "[from .. to]" + ├── opening_loc: (1,12)-(1,13) = "[" + ├── arguments: + │ @ ArgumentsNode (location: (1,13)-(1,42)) + │ ├── flags: ∅ + │ └── arguments: (length: 2) + │ ├── @ RangeNode (location: (1,13)-(1,23)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ CallNode (location: (1,13)-(1,17)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :from + │ │ │ ├── message_loc: (1,13)-(1,17) = "from" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── right: + │ │ │ @ CallNode (location: (1,21)-(1,23)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :to + │ │ │ ├── message_loc: (1,21)-(1,23) = "to" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── operator_loc: (1,18)-(1,20) = ".." + │ └── @ ArrayNode (location: (1,27)-(1,42)) + │ ├── flags: ∅ + │ ├── 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: ∅ 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..d4c4fe1070 --- /dev/null +++ b/test/prism/snapshots/seattlerb/attrasgn_primary_dot_constant.txt @@ -0,0 +1,31 @@ +@ ProgramNode (location: (1,0)-(1,7)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,7)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,7)) + ├── flags: attribute_write + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (1,1)-(1,2) = "." + ├── name: :B= + ├── message_loc: (1,2)-(1,3) = "B" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,6)-(1,7)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,6)-(1,7)) + │ ├── flags: decimal + │ └── value: 1 + ├── closing_loc: ∅ + └── block: ∅ 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..67c8be034e --- /dev/null +++ b/test/prism/snapshots/seattlerb/backticks_interpolation_line.txt @@ -0,0 +1,38 @@ +@ ProgramNode (location: (1,0)-(1,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,8)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,8)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :x + ├── message_loc: (1,0)-(1,1) = "x" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,8)) + │ ├── flags: ∅ + │ └── 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)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :y + │ │ │ ├── message_loc: (1,5)-(1,6) = "y" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── closing_loc: (1,6)-(1,7) = "}" + │ └── closing_loc: (1,7)-(1,8) = "`" + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/prism/snapshots/seattlerb/bang_eq.txt b/test/prism/snapshots/seattlerb/bang_eq.txt new file mode 100644 index 0000000000..ec3dd888b2 --- /dev/null +++ b/test/prism/snapshots/seattlerb/bang_eq.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)) + ├── flags: ∅ + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── call_operator_loc: ∅ + ├── name: :!= + ├── message_loc: (1,2)-(1,4) = "!=" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,5)-(1,6)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,5)-(1,6)) + │ ├── flags: decimal + │ └── value: 2 + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/prism/snapshots/seattlerb/bdot2.txt b/test/prism/snapshots/seattlerb/bdot2.txt new file mode 100644 index 0000000000..d4fb86fbe6 --- /dev/null +++ b/test/prism/snapshots/seattlerb/bdot2.txt @@ -0,0 +1,38 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 3) + ├── @ RangeNode (location: (1,0)-(1,4)) + │ ├── flags: ∅ + │ ├── left: ∅ + │ ├── right: + │ │ @ IntegerNode (location: (1,2)-(1,4)) + │ │ ├── flags: decimal + │ │ └── value: 10 + │ └── operator_loc: (1,0)-(1,2) = ".." + ├── @ RangeNode (location: (2,2)-(2,5)) + │ ├── flags: ∅ + │ ├── left: ∅ + │ ├── right: + │ │ @ CallNode (location: (2,4)-(2,5)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (2,4)-(2,5) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── operator_loc: (2,2)-(2,4) = ".." + └── @ CallNode (location: (3,2)-(3,3)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :c + ├── message_loc: (3,2)-(3,3) = "c" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/prism/snapshots/seattlerb/bdot3.txt b/test/prism/snapshots/seattlerb/bdot3.txt new file mode 100644 index 0000000000..0c960f0458 --- /dev/null +++ b/test/prism/snapshots/seattlerb/bdot3.txt @@ -0,0 +1,38 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 3) + ├── @ RangeNode (location: (1,0)-(1,5)) + │ ├── flags: exclude_end + │ ├── left: ∅ + │ ├── right: + │ │ @ IntegerNode (location: (1,3)-(1,5)) + │ │ ├── flags: decimal + │ │ └── value: 10 + │ └── operator_loc: (1,0)-(1,3) = "..." + ├── @ RangeNode (location: (2,2)-(2,6)) + │ ├── flags: exclude_end + │ ├── left: ∅ + │ ├── right: + │ │ @ CallNode (location: (2,5)-(2,6)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (2,5)-(2,6) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── operator_loc: (2,2)-(2,5) = "..." + └── @ CallNode (location: (3,2)-(3,3)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :c + ├── message_loc: (3,2)-(3,3) = "c" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ 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..6603e5c894 --- /dev/null +++ b/test/prism/snapshots/seattlerb/begin_rescue_else_ensure_bodies.txt @@ -0,0 +1,47 @@ +@ 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 + │ └── value: 1 + ├── 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 + │ │ └── value: 2 + │ └── 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 + │ │ └── value: 3 + │ └── 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 + │ │ └── value: 4 + │ └── 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..165c2980be --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_arg__bare.txt @@ -0,0 +1,31 @@ +@ 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)) + │ ├── flags: ∅ + │ ├── name: ∅ + │ ├── 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..392de8559b --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_arg_kwsplat.txt @@ -0,0 +1,39 @@ +@ ProgramNode (location: (1,0)-(1,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,11)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,11)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── 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)) + │ │ │ ├── flags: ∅ + │ │ │ ├── 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) = "}" 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..ee9644d59d --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_arg_opt_arg_block.txt @@ -0,0 +1,54 @@ +@ ProgramNode (location: (1,0)-(1,21)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,21)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,21)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── 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)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :b + │ │ ├── optionals: (length: 1) + │ │ │ └── @ OptionalParameterNode (location: (1,8)-(1,11)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :c + │ │ │ ├── name_loc: (1,8)-(1,9) = "c" + │ │ │ ├── operator_loc: (1,9)-(1,10) = "=" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (1,10)-(1,11)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,13)-(1,14)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :d + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: + │ │ @ BlockParameterNode (location: (1,16)-(1,18)) + │ │ ├── flags: ∅ + │ │ ├── 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) = "}" 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..799bd21057 --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_arg_opt_splat.txt @@ -0,0 +1,51 @@ +@ ProgramNode (location: (1,0)-(1,20)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,20)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,20)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── 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)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :b + │ │ ├── optionals: (length: 1) + │ │ │ └── @ OptionalParameterNode (location: (1,8)-(1,13)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :c + │ │ │ ├── name_loc: (1,8)-(1,9) = "c" + │ │ │ ├── operator_loc: (1,10)-(1,11) = "=" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (1,12)-(1,13)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── rest: + │ │ │ @ RestParameterNode (location: (1,15)-(1,17)) + │ │ │ ├── flags: ∅ + │ │ │ ├── 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) = "}" 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..b5df136a62 --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_arg_opt_splat_arg_block_omfg.txt @@ -0,0 +1,59 @@ +@ ProgramNode (location: (1,0)-(1,25)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,25)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,25)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── 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)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :b + │ │ ├── optionals: (length: 1) + │ │ │ └── @ OptionalParameterNode (location: (1,8)-(1,11)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :c + │ │ │ ├── name_loc: (1,8)-(1,9) = "c" + │ │ │ ├── operator_loc: (1,9)-(1,10) = "=" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (1,10)-(1,11)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── rest: + │ │ │ @ RestParameterNode (location: (1,13)-(1,15)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :d + │ │ │ ├── name_loc: (1,14)-(1,15) = "d" + │ │ │ └── operator_loc: (1,13)-(1,14) = "*" + │ │ ├── posts: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,17)-(1,18)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :e + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: + │ │ @ BlockParameterNode (location: (1,20)-(1,22)) + │ │ ├── flags: ∅ + │ │ ├── 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) = "}" 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..8a850e9a21 --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_arg_optional.txt @@ -0,0 +1,43 @@ +@ ProgramNode (location: (1,0)-(1,13)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,13)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,13)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── 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)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :b + │ │ │ ├── name_loc: (1,5)-(1,6) = "b" + │ │ │ ├── operator_loc: (1,7)-(1,8) = "=" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (1,9)-(1,10)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── 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) = "}" 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..b99cc5e45c --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_arg_scope.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)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── 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)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :b + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 1) + │ │ └── @ BlockLocalVariableNode (location: (1,8)-(1,9)) + │ │ ├── flags: ∅ + │ │ └── 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) = "}" 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..98b3a7da3a --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_arg_scope2.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)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── 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)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :b + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 2) + │ │ ├── @ BlockLocalVariableNode (location: (1,7)-(1,8)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :c + │ │ └── @ BlockLocalVariableNode (location: (1,10)-(1,11)) + │ │ ├── flags: ∅ + │ │ └── 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) = "}" 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..fd5813c983 --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_arg_splat_arg.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)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── 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)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :b + │ │ ├── optionals: (length: 0) + │ │ ├── rest: + │ │ │ @ RestParameterNode (location: (1,8)-(1,10)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :c + │ │ │ ├── name_loc: (1,9)-(1,10) = "c" + │ │ │ └── operator_loc: (1,8)-(1,9) = "*" + │ │ ├── posts: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,12)-(1,13)) + │ │ │ ├── flags: ∅ + │ │ │ └── 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) = "}" 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..0975ce3367 --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_args_kwargs.txt @@ -0,0 +1,44 @@ +@ ProgramNode (location: (1,0)-(1,23)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,23)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,23)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── 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)) + │ │ │ ├── flags: ∅ + │ │ │ ├── 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) = "}" 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..d47349defb --- /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)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── 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) = "}" 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..1f21c0a477 --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_args_opt1.txt @@ -0,0 +1,59 @@ +@ ProgramNode (location: (1,0)-(1,24)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,24)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,24)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── 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)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :a + │ │ ├── optionals: (length: 1) + │ │ │ └── @ OptionalParameterNode (location: (1,8)-(1,14)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :b + │ │ │ ├── name_loc: (1,8)-(1,9) = "b" + │ │ │ ├── operator_loc: (1,10)-(1,11) = "=" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (1,12)-(1,14)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 42 + │ │ ├── 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)) + │ ├── flags: ∅ + │ ├── 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) = "}" 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..a8d736dde7 --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_args_opt2.txt @@ -0,0 +1,52 @@ +@ ProgramNode (location: (1,0)-(1,18)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,18)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,18)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── 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)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── name: :b + │ │ │ │ ├── name_loc: (1,6)-(1,7) = "b" + │ │ │ │ ├── operator_loc: (1,7)-(1,8) = "=" + │ │ │ │ └── value: + │ │ │ │ @ IntegerNode (location: (1,8)-(1,9)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ └── @ OptionalParameterNode (location: (1,11)-(1,14)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :c + │ │ │ ├── name_loc: (1,11)-(1,12) = "c" + │ │ │ ├── operator_loc: (1,12)-(1,13) = "=" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (1,13)-(1,14)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ ├── 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) = "}" 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..0403851ed7 --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_args_opt2_2.txt @@ -0,0 +1,71 @@ +@ ProgramNode (location: (1,0)-(1,35)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,35)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,35)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── 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)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :a + │ │ ├── optionals: (length: 2) + │ │ │ ├── @ OptionalParameterNode (location: (1,8)-(1,14)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── name: :b + │ │ │ │ ├── name_loc: (1,8)-(1,9) = "b" + │ │ │ │ ├── operator_loc: (1,10)-(1,11) = "=" + │ │ │ │ └── value: + │ │ │ │ @ IntegerNode (location: (1,12)-(1,14)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 42 + │ │ │ └── @ OptionalParameterNode (location: (1,16)-(1,22)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :c + │ │ │ ├── name_loc: (1,16)-(1,17) = "c" + │ │ │ ├── operator_loc: (1,18)-(1,19) = "=" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (1,20)-(1,22)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 24 + │ │ ├── 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)) + │ ├── flags: ∅ + │ ├── 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) = "}" 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..ff4495019c --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_args_opt3.txt @@ -0,0 +1,79 @@ +@ ProgramNode (location: (1,0)-(1,42)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,42)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,42)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── 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)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :a + │ │ ├── optionals: (length: 2) + │ │ │ ├── @ OptionalParameterNode (location: (1,8)-(1,14)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── name: :b + │ │ │ │ ├── name_loc: (1,8)-(1,9) = "b" + │ │ │ │ ├── operator_loc: (1,10)-(1,11) = "=" + │ │ │ │ └── value: + │ │ │ │ @ IntegerNode (location: (1,12)-(1,14)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 42 + │ │ │ └── @ OptionalParameterNode (location: (1,16)-(1,22)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :c + │ │ │ ├── name_loc: (1,16)-(1,17) = "c" + │ │ │ ├── operator_loc: (1,18)-(1,19) = "=" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (1,20)-(1,22)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 24 + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: + │ │ @ BlockParameterNode (location: (1,24)-(1,26)) + │ │ ├── flags: ∅ + │ │ ├── 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)) + │ ├── flags: ∅ + │ ├── 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) = "}" 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..2e634dc937 --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_call_defn_call_block_call.txt @@ -0,0 +1,80 @@ +@ ProgramNode (location: (1,0)-(4,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,11)) + └── body: (length: 2) + ├── @ CallNode (location: (1,0)-(3,4)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,2)-(3,4)) + │ │ ├── flags: ∅ + │ │ └── 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)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── 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)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :d + │ │ │ ├── message_loc: (2,1)-(2,2) = "d" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── 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: ∅ + └── @ CallNode (location: (4,1)-(4,11)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (4,1)-(4,2)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :e + │ ├── message_loc: (4,1)-(4,2) = "e" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (4,2)-(4,3) = "." + ├── name: :f + ├── 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" 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..e46104b868 --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_call_dot_op2_brace_block.txt @@ -0,0 +1,100 @@ +@ ProgramNode (location: (1,0)-(1,31)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,31)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,31)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,0)-(1,16)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (1,0)-(1,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (1,0)-(1,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (1,1)-(1,2) = "." + │ ├── name: :b + │ ├── message_loc: (1,2)-(1,3) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,4)-(1,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (1,4)-(1,7)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :c + │ │ ├── message_loc: (1,4)-(1,5) = "c" + │ │ ├── opening_loc: (1,5)-(1,6) = "(" + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: (1,6)-(1,7) = ")" + │ │ └── block: ∅ + │ ├── 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)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :d + │ │ ├── message_loc: (1,11)-(1,12) = "d" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── opening_loc: (1,8)-(1,10) = "do" + │ └── closing_loc: (1,13)-(1,16) = "end" + ├── call_operator_loc: (1,16)-(1,17) = "." + ├── name: :e + ├── 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)) + │ │ │ ├── flags: ∅ + │ │ │ └── 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)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :g + │ ├── message_loc: (1,26)-(1,27) = "g" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── opening_loc: (1,19)-(1,21) = "do" + └── closing_loc: (1,28)-(1,31) = "end" 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..05d076f8d6 --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_call_dot_op2_cmd_args_do_block.txt @@ -0,0 +1,113 @@ +@ ProgramNode (location: (1,0)-(1,33)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,33)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,33)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,0)-(1,16)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (1,0)-(1,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (1,0)-(1,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (1,1)-(1,2) = "." + │ ├── name: :b + │ ├── message_loc: (1,2)-(1,3) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,4)-(1,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (1,4)-(1,7)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :c + │ │ ├── message_loc: (1,4)-(1,5) = "c" + │ │ ├── opening_loc: (1,5)-(1,6) = "(" + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: (1,6)-(1,7) = ")" + │ │ └── block: ∅ + │ ├── 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)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :d + │ │ ├── message_loc: (1,11)-(1,12) = "d" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── opening_loc: (1,8)-(1,10) = "do" + │ └── closing_loc: (1,13)-(1,16) = "end" + ├── call_operator_loc: (1,16)-(1,17) = "." + ├── name: :e + ├── message_loc: (1,17)-(1,18) = "e" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,19)-(1,20)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (1,19)-(1,20)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :f + │ ├── message_loc: (1,19)-(1,20) = "f" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── 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)) + │ │ │ ├── flags: ∅ + │ │ │ └── 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)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :h + │ ├── message_loc: (1,28)-(1,29) = "h" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── opening_loc: (1,21)-(1,23) = "do" + └── closing_loc: (1,30)-(1,33) = "end" 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..9fd13b0dfc --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_call_operation_colon.txt @@ -0,0 +1,54 @@ +@ ProgramNode (location: (1,0)-(1,15)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,15)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,15)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,0)-(1,12)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (1,0)-(1,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (1,0)-(1,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (1,1)-(1,2) = "." + │ ├── name: :b + │ ├── message_loc: (1,2)-(1,3) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,4)-(1,5)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (1,4)-(1,5)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :c + │ │ ├── message_loc: (1,4)-(1,5) = "c" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── 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" + ├── call_operator_loc: (1,12)-(1,14) = "::" + ├── name: :d + ├── message_loc: (1,14)-(1,15) = "d" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ 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..43c19d3318 --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_call_operation_dot.txt @@ -0,0 +1,54 @@ +@ ProgramNode (location: (1,0)-(1,14)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,14)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,14)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,0)-(1,12)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (1,0)-(1,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (1,0)-(1,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (1,1)-(1,2) = "." + │ ├── name: :b + │ ├── message_loc: (1,2)-(1,3) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,4)-(1,5)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (1,4)-(1,5)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :c + │ │ ├── message_loc: (1,4)-(1,5) = "c" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── 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" + ├── call_operator_loc: (1,12)-(1,13) = "." + ├── name: :d + ├── message_loc: (1,13)-(1,14) = "d" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ 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..10c1780d37 --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_call_paren_call_block_call.txt @@ -0,0 +1,60 @@ +@ ProgramNode (location: (1,0)-(2,10)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,10)) + └── body: (length: 2) + ├── @ CallNode (location: (1,0)-(1,5)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,2)-(1,5)) + │ │ ├── flags: ∅ + │ │ └── 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)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (1,3)-(1,4) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── opening_loc: (1,2)-(1,3) = "(" + │ │ └── closing_loc: (1,4)-(1,5) = ")" + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ CallNode (location: (2,0)-(2,10)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (2,0)-(2,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :c + │ ├── message_loc: (2,0)-(2,1) = "c" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (2,1)-(2,2) = "." + ├── name: :d + ├── 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" 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..30fd6dafa0 --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_command_operation_colon.txt @@ -0,0 +1,49 @@ +@ ProgramNode (location: (1,0)-(1,17)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,17)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,17)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,0)-(1,11)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,2)-(1,4)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ SymbolNode (location: (1,2)-(1,4)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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" + ├── call_operator_loc: (1,11)-(1,13) = "::" + ├── name: :c + ├── message_loc: (1,13)-(1,14) = "c" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,15)-(1,17)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ SymbolNode (location: (1,15)-(1,17)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (1,15)-(1,16) = ":" + │ ├── value_loc: (1,16)-(1,17) = "d" + │ ├── closing_loc: ∅ + │ └── unescaped: "d" + ├── closing_loc: ∅ + └── block: ∅ 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..e4f69d3604 --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_command_operation_dot.txt @@ -0,0 +1,49 @@ +@ ProgramNode (location: (1,0)-(1,16)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,16)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,16)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,0)-(1,11)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,2)-(1,4)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ SymbolNode (location: (1,2)-(1,4)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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" + ├── call_operator_loc: (1,11)-(1,12) = "." + ├── name: :c + ├── message_loc: (1,12)-(1,13) = "c" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,14)-(1,16)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ SymbolNode (location: (1,14)-(1,16)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (1,14)-(1,15) = ":" + │ ├── value_loc: (1,15)-(1,16) = "d" + │ ├── closing_loc: ∅ + │ └── unescaped: "d" + ├── closing_loc: ∅ + └── block: ∅ 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..e309ec1f98 --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_decomp_anon_splat_arg.txt @@ -0,0 +1,46 @@ +@ ProgramNode (location: (1,0)-(1,14)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,14)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,14)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── 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) + │ │ │ └── @ MultiTargetNode (location: (1,5)-(1,11)) + │ │ │ ├── lefts: (length: 0) + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (1,6)-(1,7)) + │ │ │ │ ├── operator_loc: (1,6)-(1,7) = "*" + │ │ │ │ └── expression: ∅ + │ │ │ ├── rights: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ ├── lparen_loc: (1,5)-(1,6) = "(" + │ │ │ └── rparen_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) = "}" 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..8d28fa7e02 --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_decomp_arg_splat.txt @@ -0,0 +1,46 @@ +@ ProgramNode (location: (1,0)-(1,14)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,14)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,14)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── 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) + │ │ │ └── @ MultiTargetNode (location: (1,5)-(1,11)) + │ │ │ ├── lefts: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,6)-(1,7)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :b + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (1,9)-(1,10)) + │ │ │ │ ├── operator_loc: (1,9)-(1,10) = "*" + │ │ │ │ └── expression: ∅ + │ │ │ ├── rights: (length: 0) + │ │ │ ├── lparen_loc: (1,5)-(1,6) = "(" + │ │ │ └── rparen_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) = "}" 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..4f4a82acf5 --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_decomp_arg_splat_arg.txt @@ -0,0 +1,52 @@ +@ ProgramNode (location: (1,0)-(1,18)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,18)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,18)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── 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) + │ │ │ └── @ MultiTargetNode (location: (1,5)-(1,15)) + │ │ │ ├── lefts: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,6)-(1,7)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (1,9)-(1,11)) + │ │ │ │ ├── operator_loc: (1,9)-(1,10) = "*" + │ │ │ │ └── expression: + │ │ │ │ @ RequiredParameterNode (location: (1,10)-(1,11)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :b + │ │ │ ├── rights: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,13)-(1,14)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :c + │ │ │ ├── lparen_loc: (1,5)-(1,6) = "(" + │ │ │ └── rparen_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) = "}" 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..09d3440126 --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_decomp_splat.txt @@ -0,0 +1,46 @@ +@ ProgramNode (location: (1,0)-(1,12)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,12)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,12)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── 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) + │ │ │ └── @ MultiTargetNode (location: (1,5)-(1,9)) + │ │ │ ├── lefts: (length: 0) + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (1,6)-(1,8)) + │ │ │ │ ├── operator_loc: (1,6)-(1,7) = "*" + │ │ │ │ └── expression: + │ │ │ │ @ RequiredParameterNode (location: (1,7)-(1,8)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ ├── rights: (length: 0) + │ │ │ ├── lparen_loc: (1,5)-(1,6) = "(" + │ │ │ └── rparen_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) = "}" diff --git a/test/prism/snapshots/seattlerb/block_kw.txt b/test/prism/snapshots/seattlerb/block_kw.txt new file mode 100644 index 0000000000..f022637dae --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_kw.txt @@ -0,0 +1,42 @@ +@ ProgramNode (location: (1,0)-(1,15)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,15)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,15)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :blah + ├── 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) + │ │ │ └── @ OptionalKeywordParameterNode (location: (1,8)-(1,12)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :k + │ │ │ ├── name_loc: (1,8)-(1,10) = "k:" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (1,10)-(1,12)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 42 + │ │ ├── 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) = "}" 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..8a49c8bec7 --- /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)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :blah + ├── 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) + │ │ │ └── @ RequiredKeywordParameterNode (location: (1,9)-(1,11)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :k + │ │ │ └── name_loc: (1,9)-(1,11) = "k:" + │ │ ├── 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" 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..e77bf90a27 --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_kwarg_lvar.txt @@ -0,0 +1,50 @@ +@ ProgramNode (location: (1,0)-(1,20)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,20)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,20)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :bl + ├── 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) + │ │ │ └── @ OptionalKeywordParameterNode (location: (1,6)-(1,14)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :kw + │ │ │ ├── name_loc: (1,6)-(1,9) = "kw:" + │ │ │ └── value: + │ │ │ @ SymbolNode (location: (1,10)-(1,14)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── 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) = "}" 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..a527c8c993 --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_kwarg_lvar_multiple.txt @@ -0,0 +1,61 @@ +@ ProgramNode (location: (1,0)-(1,33)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,33)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,33)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :bl + ├── 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) + │ │ │ ├── @ OptionalKeywordParameterNode (location: (1,6)-(1,14)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── name: :kw + │ │ │ │ ├── name_loc: (1,6)-(1,9) = "kw:" + │ │ │ │ └── value: + │ │ │ │ @ SymbolNode (location: (1,10)-(1,14)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: (1,10)-(1,11) = ":" + │ │ │ │ ├── value_loc: (1,11)-(1,14) = "val" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "val" + │ │ │ └── @ OptionalKeywordParameterNode (location: (1,16)-(1,26)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :kw2 + │ │ │ ├── name_loc: (1,16)-(1,20) = "kw2:" + │ │ │ └── value: + │ │ │ @ SymbolNode (location: (1,21)-(1,26)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── 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) = "}" 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..64dc928f14 --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_opt_arg.txt @@ -0,0 +1,46 @@ +@ ProgramNode (location: (1,0)-(1,14)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,14)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,14)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── 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)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :b + │ │ │ ├── name_loc: (1,5)-(1,6) = "b" + │ │ │ ├── operator_loc: (1,6)-(1,7) = "=" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (1,7)-(1,8)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,10)-(1,11)) + │ │ │ ├── flags: ∅ + │ │ │ └── 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) = "}" 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..c18df9c27d --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_opt_splat.txt @@ -0,0 +1,48 @@ +@ ProgramNode (location: (1,0)-(1,17)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,17)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,17)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── 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)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :b + │ │ │ ├── name_loc: (1,5)-(1,6) = "b" + │ │ │ ├── operator_loc: (1,7)-(1,8) = "=" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (1,9)-(1,10)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── rest: + │ │ │ @ RestParameterNode (location: (1,12)-(1,14)) + │ │ │ ├── flags: ∅ + │ │ │ ├── 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) = "}" 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..3806809d2b --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_opt_splat_arg_block_omfg.txt @@ -0,0 +1,56 @@ +@ ProgramNode (location: (1,0)-(1,22)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,22)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,22)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── 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)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :b + │ │ │ ├── name_loc: (1,5)-(1,6) = "b" + │ │ │ ├── operator_loc: (1,6)-(1,7) = "=" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (1,7)-(1,8)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── rest: + │ │ │ @ RestParameterNode (location: (1,10)-(1,12)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :c + │ │ │ ├── name_loc: (1,11)-(1,12) = "c" + │ │ │ └── operator_loc: (1,10)-(1,11) = "*" + │ │ ├── posts: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,14)-(1,15)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :d + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: + │ │ @ BlockParameterNode (location: (1,17)-(1,19)) + │ │ ├── flags: ∅ + │ │ ├── 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) = "}" diff --git a/test/prism/snapshots/seattlerb/block_optarg.txt b/test/prism/snapshots/seattlerb/block_optarg.txt new file mode 100644 index 0000000000..5da99aec79 --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_optarg.txt @@ -0,0 +1,46 @@ +@ ProgramNode (location: (1,0)-(1,14)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,14)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,14)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── 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)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :b + │ │ │ ├── name_loc: (1,5)-(1,6) = "b" + │ │ │ ├── operator_loc: (1,7)-(1,8) = "=" + │ │ │ └── value: + │ │ │ @ SymbolNode (location: (1,9)-(1,11)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── 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) = "}" 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..ebd937904c --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_paren_splat.txt @@ -0,0 +1,49 @@ +@ ProgramNode (location: (1,0)-(1,15)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,15)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,15)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── 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) + │ │ │ └── @ MultiTargetNode (location: (1,5)-(1,12)) + │ │ │ ├── lefts: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,6)-(1,7)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :b + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (1,9)-(1,11)) + │ │ │ │ ├── operator_loc: (1,9)-(1,10) = "*" + │ │ │ │ └── expression: + │ │ │ │ @ RequiredParameterNode (location: (1,10)-(1,11)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :c + │ │ │ ├── rights: (length: 0) + │ │ │ ├── lparen_loc: (1,5)-(1,6) = "(" + │ │ │ └── rparen_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) = "}" 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..53c43603a7 --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_reg_optarg.txt @@ -0,0 +1,49 @@ +@ ProgramNode (location: (1,0)-(1,17)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,17)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,17)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── 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)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :b + │ │ ├── optionals: (length: 1) + │ │ │ └── @ OptionalParameterNode (location: (1,8)-(1,14)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :c + │ │ │ ├── name_loc: (1,8)-(1,9) = "c" + │ │ │ ├── operator_loc: (1,10)-(1,11) = "=" + │ │ │ └── value: + │ │ │ @ SymbolNode (location: (1,12)-(1,14)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── 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) = "}" diff --git a/test/prism/snapshots/seattlerb/block_return.txt b/test/prism/snapshots/seattlerb/block_return.txt new file mode 100644 index 0000000000..c863b28a22 --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_return.txt @@ -0,0 +1,57 @@ +@ ProgramNode (location: (1,0)-(1,27)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,27)) + └── body: (length: 1) + └── @ ReturnNode (location: (1,0)-(1,27)) + ├── flags: ∅ + ├── keyword_loc: (1,0)-(1,6) = "return" + └── arguments: + @ ArgumentsNode (location: (1,7)-(1,27)) + ├── flags: ∅ + └── arguments: (length: 1) + └── @ CallNode (location: (1,7)-(1,27)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :foo + ├── message_loc: (1,7)-(1,10) = "foo" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,11)-(1,14)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (1,11)-(1,14)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :arg + │ ├── message_loc: (1,11)-(1,14) = "arg" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── 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)) + │ │ │ ├── flags: ∅ + │ │ │ └── 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" diff --git a/test/prism/snapshots/seattlerb/block_scope.txt b/test/prism/snapshots/seattlerb/block_scope.txt new file mode 100644 index 0000000000..a21a28b993 --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_scope.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)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── 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)) + │ │ ├── flags: ∅ + │ │ └── 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) = "}" 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..617ff88622 --- /dev/null +++ b/test/prism/snapshots/seattlerb/block_splat_reg.txt @@ -0,0 +1,42 @@ +@ ProgramNode (location: (1,0)-(1,13)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,13)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,13)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── 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)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :b + │ │ │ ├── name_loc: (1,6)-(1,7) = "b" + │ │ │ └── operator_loc: (1,5)-(1,6) = "*" + │ │ ├── posts: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ ├── flags: ∅ + │ │ │ └── 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) = "}" diff --git a/test/prism/snapshots/seattlerb/bug169.txt b/test/prism/snapshots/seattlerb/bug169.txt new file mode 100644 index 0000000000..e4fb47a6de --- /dev/null +++ b/test/prism/snapshots/seattlerb/bug169.txt @@ -0,0 +1,28 @@ +@ ProgramNode (location: (1,0)-(1,7)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,7)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,7)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :m + ├── message_loc: (1,0)-(1,1) = "m" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,4)) + │ ├── flags: ∅ + │ └── 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) = "}" diff --git a/test/prism/snapshots/seattlerb/bug179.txt b/test/prism/snapshots/seattlerb/bug179.txt new file mode 100644 index 0000000000..d7695bc7a7 --- /dev/null +++ b/test/prism/snapshots/seattlerb/bug179.txt @@ -0,0 +1,28 @@ +@ ProgramNode (location: (1,0)-(1,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,9)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,9)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :p + ├── message_loc: (1,0)-(1,1) = "p" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,9)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ RangeNode (location: (1,2)-(1,9)) + │ ├── flags: ∅ + │ ├── 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) = ".." + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/prism/snapshots/seattlerb/bug190.txt b/test/prism/snapshots/seattlerb/bug190.txt new file mode 100644 index 0000000000..b261a166cf --- /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)) + ├── flags: forced_us_ascii_encoding + ├── opening_loc: (1,0)-(1,3) = "%r'" + ├── content_loc: (1,3)-(1,5) = "\\'" + ├── closing_loc: (1,5)-(1,6) = "'" + └── unescaped: "'" diff --git a/test/prism/snapshots/seattlerb/bug191.txt b/test/prism/snapshots/seattlerb/bug191.txt new file mode 100644 index 0000000000..69835ab1d0 --- /dev/null +++ b/test/prism/snapshots/seattlerb/bug191.txt @@ -0,0 +1,87 @@ +@ 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)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (1,0)-(1,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── then_keyword_loc: (1,2)-(1,3) = "?" + │ ├── 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)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (1,8)-(1,9) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── end_keyword_loc: ∅ + │ └── end_keyword_loc: ∅ + └── @ IfNode (location: (3,0)-(3,9)) + ├── if_keyword_loc: ∅ + ├── predicate: + │ @ CallNode (location: (3,0)-(3,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (3,0)-(3,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── then_keyword_loc: (3,2)-(3,3) = "?" + ├── 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)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (3,8)-(3,9) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── 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..377b53727e --- /dev/null +++ b/test/prism/snapshots/seattlerb/bug202.txt @@ -0,0 +1,22 @@ +@ 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 + │ │ └── value: 1 + │ └── 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 + │ └── value: 1 + └── 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..203a39a793 --- /dev/null +++ b/test/prism/snapshots/seattlerb/bug236.txt @@ -0,0 +1,70 @@ +@ ProgramNode (location: (1,0)-(3,6)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,6)) + └── body: (length: 2) + ├── @ CallNode (location: (1,0)-(1,7)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :x + │ ├── 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)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: + │ │ │ │ @ ImplicitRestNode (location: (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) = "}" + └── @ CallNode (location: (3,0)-(3,6)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :x + ├── 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)) + │ │ │ ├── flags: ∅ + │ │ │ └── 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) = "}" diff --git a/test/prism/snapshots/seattlerb/bug290.txt b/test/prism/snapshots/seattlerb/bug290.txt new file mode 100644 index 0000000000..4f1e673c4b --- /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)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (2,2)-(2,5) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── 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..ae72675e5c --- /dev/null +++ b/test/prism/snapshots/seattlerb/bug_187.txt @@ -0,0 +1,59 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(3,3)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :private + ├── message_loc: (1,0)-(1,7) = "private" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,8)-(3,3)) + │ ├── flags: ∅ + │ └── 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)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (2,0)-(2,1)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :a + │ │ │ ├── message_loc: (2,0)-(2,1) = "a" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: (2,1)-(2,2) = "." + │ │ ├── name: :b + │ │ ├── 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" + │ ├── 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: ∅ diff --git a/test/prism/snapshots/seattlerb/bug_215.txt b/test/prism/snapshots/seattlerb/bug_215.txt new file mode 100644 index 0000000000..de7716335e --- /dev/null +++ b/test/prism/snapshots/seattlerb/bug_215.txt @@ -0,0 +1,14 @@ +@ 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)) + │ ├── flags: forced_us_ascii_encoding + │ ├── 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..ad61501a07 --- /dev/null +++ b/test/prism/snapshots/seattlerb/bug_249.txt @@ -0,0 +1,86 @@ +@ ProgramNode (location: (1,0)-(4,28)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,28)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(4,28)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :mount + ├── message_loc: (1,0)-(1,5) = "mount" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,6)-(4,28)) + │ ├── flags: contains_keywords + │ └── arguments: (length: 2) + │ ├── @ CallNode (location: (1,6)-(4,9)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ ParenthesesNode (location: (1,6)-(4,5)) + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (1,7)-(4,4)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (1,7)-(4,4)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── receiver: + │ │ │ │ │ @ ConstantReadNode (location: (1,7)-(1,12)) + │ │ │ │ │ └── name: :Class + │ │ │ │ ├── call_operator_loc: (1,12)-(1,13) = "." + │ │ │ │ ├── name: :new + │ │ │ │ ├── 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" + │ │ │ ├── opening_loc: (1,6)-(1,7) = "(" + │ │ │ └── closing_loc: (4,4)-(4,5) = ")" + │ │ ├── call_operator_loc: (4,5)-(4,6) = "." + │ │ ├── name: :new + │ │ ├── message_loc: (4,6)-(4,9) = "new" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── @ KeywordHashNode (location: (4,11)-(4,28)) + │ ├── flags: symbol_keys + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (4,11)-(4,28)) + │ ├── key: + │ │ @ SymbolNode (location: (4,11)-(4,14)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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: ∅ diff --git a/test/prism/snapshots/seattlerb/bug_and.txt b/test/prism/snapshots/seattlerb/bug_and.txt new file mode 100644 index 0000000000..3daf505e5f --- /dev/null +++ b/test/prism/snapshots/seattlerb/bug_and.txt @@ -0,0 +1,21 @@ +@ 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)) + │ ├── flags: ∅ + │ ├── 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..f451bd0172 --- /dev/null +++ b/test/prism/snapshots/seattlerb/bug_args__19.txt @@ -0,0 +1,58 @@ +@ ProgramNode (location: (1,0)-(1,16)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,16)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,16)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── 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) + │ │ │ └── @ MultiTargetNode (location: (1,5)-(1,11)) + │ │ │ ├── lefts: (length: 2) + │ │ │ │ ├── @ RequiredParameterNode (location: (1,6)-(1,7)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── name: :a + │ │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :b + │ │ │ ├── rest: ∅ + │ │ │ ├── rights: (length: 0) + │ │ │ ├── lparen_loc: (1,5)-(1,6) = "(" + │ │ │ └── rparen_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)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :d + │ ├── message_loc: (1,13)-(1,14) = "d" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── opening_loc: (1,2)-(1,3) = "{" + └── closing_loc: (1,15)-(1,16) = "}" 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..297979c182 --- /dev/null +++ b/test/prism/snapshots/seattlerb/bug_args_masgn.txt @@ -0,0 +1,49 @@ +@ ProgramNode (location: (1,0)-(1,17)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,17)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,17)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── 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) + │ │ │ ├── @ MultiTargetNode (location: (1,5)-(1,11)) + │ │ │ │ ├── lefts: (length: 2) + │ │ │ │ │ ├── @ RequiredParameterNode (location: (1,6)-(1,7)) + │ │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ │ └── name: :a + │ │ │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── name: :b + │ │ │ │ ├── rest: ∅ + │ │ │ │ ├── rights: (length: 0) + │ │ │ │ ├── lparen_loc: (1,5)-(1,6) = "(" + │ │ │ │ └── rparen_loc: (1,10)-(1,11) = ")" + │ │ │ └── @ RequiredParameterNode (location: (1,13)-(1,14)) + │ │ │ ├── flags: ∅ + │ │ │ └── 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) = "}" 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..6bec9187b3 --- /dev/null +++ b/test/prism/snapshots/seattlerb/bug_args_masgn2.txt @@ -0,0 +1,58 @@ +@ ProgramNode (location: (1,0)-(1,22)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,22)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,22)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── 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) + │ │ │ ├── @ MultiTargetNode (location: (1,5)-(1,16)) + │ │ │ │ ├── lefts: (length: 2) + │ │ │ │ │ ├── @ MultiTargetNode (location: (1,6)-(1,12)) + │ │ │ │ │ │ ├── lefts: (length: 2) + │ │ │ │ │ │ │ ├── @ RequiredParameterNode (location: (1,7)-(1,8)) + │ │ │ │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ │ │ │ └── name: :a + │ │ │ │ │ │ │ └── @ RequiredParameterNode (location: (1,10)-(1,11)) + │ │ │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ │ │ └── name: :b + │ │ │ │ │ │ ├── rest: ∅ + │ │ │ │ │ │ ├── rights: (length: 0) + │ │ │ │ │ │ ├── lparen_loc: (1,6)-(1,7) = "(" + │ │ │ │ │ │ └── rparen_loc: (1,11)-(1,12) = ")" + │ │ │ │ │ └── @ RequiredParameterNode (location: (1,14)-(1,15)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── name: :c + │ │ │ │ ├── rest: ∅ + │ │ │ │ ├── rights: (length: 0) + │ │ │ │ ├── lparen_loc: (1,5)-(1,6) = "(" + │ │ │ │ └── rparen_loc: (1,15)-(1,16) = ")" + │ │ │ └── @ RequiredParameterNode (location: (1,18)-(1,19)) + │ │ │ ├── flags: ∅ + │ │ │ └── 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) = "}" 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..42a060d02a --- /dev/null +++ b/test/prism/snapshots/seattlerb/bug_args_masgn_outer_parens__19.txt @@ -0,0 +1,55 @@ +@ ProgramNode (location: (1,0)-(1,19)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,19)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,19)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── 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) + │ │ │ └── @ MultiTargetNode (location: (1,5)-(1,16)) + │ │ │ ├── lefts: (length: 2) + │ │ │ │ ├── @ MultiTargetNode (location: (1,6)-(1,12)) + │ │ │ │ │ ├── lefts: (length: 2) + │ │ │ │ │ │ ├── @ RequiredParameterNode (location: (1,7)-(1,8)) + │ │ │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ │ │ └── name: :k + │ │ │ │ │ │ └── @ RequiredParameterNode (location: (1,10)-(1,11)) + │ │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ │ └── name: :v + │ │ │ │ │ ├── rest: ∅ + │ │ │ │ │ ├── rights: (length: 0) + │ │ │ │ │ ├── lparen_loc: (1,6)-(1,7) = "(" + │ │ │ │ │ └── rparen_loc: (1,11)-(1,12) = ")" + │ │ │ │ └── @ RequiredParameterNode (location: (1,14)-(1,15)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :i + │ │ │ ├── rest: ∅ + │ │ │ ├── rights: (length: 0) + │ │ │ ├── lparen_loc: (1,5)-(1,6) = "(" + │ │ │ └── rparen_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) = "}" 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..53d6f9220b --- /dev/null +++ b/test/prism/snapshots/seattlerb/bug_call_arglist_parens.txt @@ -0,0 +1,110 @@ +@ 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)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :g + │ │ ├── message_loc: (2,8)-(2,9) = "g" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (2,10)-(2,17)) + │ │ │ ├── flags: ∅ + │ │ │ └── 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 + │ │ │ │ │ └── value: 1 + │ │ │ │ ├── opening_loc: (2,10)-(2,11) = "(" + │ │ │ │ └── closing_loc: (2,13)-(2,14) = ")" + │ │ │ └── @ IntegerNode (location: (2,16)-(2,17)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── 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)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :g + │ │ ├── message_loc: (7,8)-(7,9) = "g" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (7,10)-(7,16)) + │ │ │ ├── flags: ∅ + │ │ │ └── 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 + │ │ │ │ │ └── value: 1 + │ │ │ │ ├── opening_loc: (7,10)-(7,11) = "(" + │ │ │ │ └── closing_loc: (7,12)-(7,13) = ")" + │ │ │ └── @ IntegerNode (location: (7,15)-(7,16)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── 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)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :g + ├── message_loc: (11,0)-(11,1) = "g" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (11,2)-(11,9)) + │ ├── flags: ∅ + │ └── 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 + │ │ │ └── value: 1 + │ │ ├── opening_loc: (11,2)-(11,3) = "(" + │ │ └── closing_loc: (11,5)-(11,6) = ")" + │ └── @ IntegerNode (location: (11,8)-(11,9)) + │ ├── flags: decimal + │ └── value: 2 + ├── closing_loc: ∅ + └── block: ∅ 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..0cc1ca05e1 --- /dev/null +++ b/test/prism/snapshots/seattlerb/bug_case_when_regexp.txt @@ -0,0 +1,28 @@ +@ 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)) + │ ├── flags: forced_us_ascii_encoding + │ ├── 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,22)) + │ ├── keyword_loc: (1,9)-(1,13) = "when" + │ ├── conditions: (length: 1) + │ │ └── @ RegularExpressionNode (location: (1,14)-(1,17)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (1,14)-(1,15) = "/" + │ │ ├── content_loc: (1,15)-(1,16) = "x" + │ │ ├── closing_loc: (1,16)-(1,17) = "/" + │ │ └── unescaped: "x" + │ ├── then_keyword_loc: (1,18)-(1,22) = "then" + │ └── 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..af886999b5 --- /dev/null +++ b/test/prism/snapshots/seattlerb/bug_comma.txt @@ -0,0 +1,41 @@ +@ 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)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :test + │ ├── message_loc: (1,3)-(1,7) = "test" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,8)-(1,15)) + │ │ ├── flags: ∅ + │ │ └── 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)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :dir + │ │ ├── message_loc: (1,12)-(1,15) = "dir" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── then_keyword_loc: (1,16)-(1,20) = "then" + ├── 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..cbf3bc3ef0 --- /dev/null +++ b/test/prism/snapshots/seattlerb/bug_cond_pct.txt @@ -0,0 +1,22 @@ +@ 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)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (1,11)-(1,14) = "%r%" + │ │ ├── content_loc: (1,14)-(1,22) = "blahblah" + │ │ ├── closing_loc: (1,22)-(1,23) = "%" + │ │ └── unescaped: "blahblah" + │ ├── then_keyword_loc: ∅ + │ └── 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..e138db4d49 --- /dev/null +++ b/test/prism/snapshots/seattlerb/bug_hash_args.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)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :foo + ├── message_loc: (1,0)-(1,3) = "foo" + ├── opening_loc: (1,3)-(1,4) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,4)-(1,18)) + │ ├── flags: contains_keywords + │ └── arguments: (length: 2) + │ ├── @ SymbolNode (location: (1,4)-(1,8)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (1,4)-(1,5) = ":" + │ │ ├── value_loc: (1,5)-(1,8) = "bar" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "bar" + │ └── @ KeywordHashNode (location: (1,10)-(1,18)) + │ ├── flags: symbol_keys + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (1,10)-(1,18)) + │ ├── key: + │ │ @ SymbolNode (location: (1,10)-(1,14)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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: ∅ 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..fe2d7f73c9 --- /dev/null +++ b/test/prism/snapshots/seattlerb/bug_hash_args_trailing_comma.txt @@ -0,0 +1,38 @@ +@ ProgramNode (location: (1,0)-(1,20)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,20)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,20)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :foo + ├── message_loc: (1,0)-(1,3) = "foo" + ├── opening_loc: (1,3)-(1,4) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,4)-(1,18)) + │ ├── flags: contains_keywords + │ └── arguments: (length: 2) + │ ├── @ SymbolNode (location: (1,4)-(1,8)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (1,4)-(1,5) = ":" + │ │ ├── value_loc: (1,5)-(1,8) = "bar" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "bar" + │ └── @ KeywordHashNode (location: (1,10)-(1,18)) + │ ├── flags: symbol_keys + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (1,10)-(1,18)) + │ ├── key: + │ │ @ SymbolNode (location: (1,10)-(1,14)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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: ∅ 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..433fb02411 --- /dev/null +++ b/test/prism/snapshots/seattlerb/bug_hash_interp_array.txt @@ -0,0 +1,26 @@ +@ 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)) + │ │ ├── flags: ∅ + │ │ ├── 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..b4c75c4607 --- /dev/null +++ b/test/prism/snapshots/seattlerb/bug_masgn_right.txt @@ -0,0 +1,49 @@ +@ ProgramNode (location: (1,0)-(1,17)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,17)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,17)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── 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)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ └── @ MultiTargetNode (location: (1,8)-(1,14)) + │ │ │ ├── lefts: (length: 2) + │ │ │ │ ├── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── name: :b + │ │ │ │ └── @ RequiredParameterNode (location: (1,12)-(1,13)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :c + │ │ │ ├── rest: ∅ + │ │ │ ├── rights: (length: 0) + │ │ │ ├── lparen_loc: (1,8)-(1,9) = "(" + │ │ │ └── rparen_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) = "}" 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..9e4a416d4a --- /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)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,4)-(1,5)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,4)-(1,5) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: ∅ + ├── name: :! + ├── message_loc: (1,0)-(1,3) = "not" + ├── opening_loc: (1,3)-(1,4) = "(" + ├── arguments: ∅ + ├── closing_loc: (1,5)-(1,6) = ")" + └── block: ∅ 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..33016f32f8 --- /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)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (1,6)-(1,7) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── 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..d3e88b3f9e --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_and.txt @@ -0,0 +1,24 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,5)) + ├── flags: ∅ + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── call_operator_loc: ∅ + ├── name: :& + ├── message_loc: (1,2)-(1,3) = "&" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,4)-(1,5)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,4)-(1,5)) + │ ├── flags: decimal + │ └── value: 2 + ├── closing_loc: ∅ + └── block: ∅ 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..f489bc7f19 --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_arg_assoc.txt @@ -0,0 +1,34 @@ +@ ProgramNode (location: (1,0)-(1,10)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,10)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,10)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: (1,1)-(1,2) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,9)) + │ ├── flags: contains_keywords + │ └── arguments: (length: 2) + │ ├── @ IntegerNode (location: (1,2)-(1,3)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── @ KeywordHashNode (location: (1,5)-(1,9)) + │ ├── flags: ∅ + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (1,5)-(1,9)) + │ ├── key: + │ │ @ IntegerNode (location: (1,5)-(1,6)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── value: + │ │ @ IntegerNode (location: (1,8)-(1,9)) + │ │ ├── flags: decimal + │ │ └── value: 3 + │ └── operator_loc: (1,6)-(1,8) = "=>" + ├── closing_loc: (1,9)-(1,10) = ")" + └── block: ∅ 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..5b191396de --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_arg_assoc_kwsplat.txt @@ -0,0 +1,43 @@ +@ ProgramNode (location: (1,0)-(1,16)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,16)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,16)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: (1,1)-(1,2) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,15)) + │ ├── flags: contains_keywords, contains_keyword_splat + │ └── arguments: (length: 2) + │ ├── @ IntegerNode (location: (1,2)-(1,3)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── @ KeywordHashNode (location: (1,5)-(1,15)) + │ ├── flags: ∅ + │ └── elements: (length: 2) + │ ├── @ AssocNode (location: (1,5)-(1,10)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (1,5)-(1,8)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── 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 + │ │ │ └── value: 2 + │ │ └── operator_loc: ∅ + │ └── @ AssocSplatNode (location: (1,12)-(1,15)) + │ ├── value: + │ │ @ IntegerNode (location: (1,14)-(1,15)) + │ │ ├── flags: decimal + │ │ └── value: 3 + │ └── operator_loc: (1,12)-(1,14) = "**" + ├── closing_loc: (1,15)-(1,16) = ")" + └── block: ∅ 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..f95b80cf7d --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_arg_kwsplat.txt @@ -0,0 +1,37 @@ +@ ProgramNode (location: (1,0)-(1,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,9)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,9)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: (1,1)-(1,2) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,8)) + │ ├── flags: contains_keywords, contains_keyword_splat + │ └── arguments: (length: 2) + │ ├── @ CallNode (location: (1,2)-(1,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (1,2)-(1,3) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── @ KeywordHashNode (location: (1,5)-(1,8)) + │ ├── flags: ∅ + │ └── elements: (length: 1) + │ └── @ AssocSplatNode (location: (1,5)-(1,8)) + │ ├── value: + │ │ @ IntegerNode (location: (1,7)-(1,8)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── operator_loc: (1,5)-(1,7) = "**" + ├── closing_loc: (1,8)-(1,9) = ")" + └── block: ∅ 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..8946206a3f --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_args_assoc_quoted.txt @@ -0,0 +1,106 @@ +@ ProgramNode (location: (1,0)-(5,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(5,8)) + └── body: (length: 3) + ├── @ CallNode (location: (1,0)-(1,11)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :x + │ ├── message_loc: (1,0)-(1,1) = "x" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,2)-(1,11)) + │ │ ├── flags: contains_keywords + │ │ └── arguments: (length: 1) + │ │ └── @ KeywordHashNode (location: (1,2)-(1,11)) + │ │ ├── flags: ∅ + │ │ └── 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)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :k + │ │ │ │ │ ├── message_loc: (1,5)-(1,6) = "k" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ └── closing_loc: (1,6)-(1,7) = "}" + │ │ │ └── closing_loc: (1,7)-(1,9) = "\":" + │ │ ├── value: + │ │ │ @ IntegerNode (location: (1,9)-(1,11)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 42 + │ │ └── operator_loc: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (3,0)-(3,8)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :x + │ ├── message_loc: (3,0)-(3,1) = "x" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (3,2)-(3,8)) + │ │ ├── flags: contains_keywords + │ │ └── arguments: (length: 1) + │ │ └── @ KeywordHashNode (location: (3,2)-(3,8)) + │ │ ├── flags: symbol_keys + │ │ └── elements: (length: 1) + │ │ └── @ AssocNode (location: (3,2)-(3,8)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (3,2)-(3,6)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── 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 + │ │ │ └── value: 42 + │ │ └── operator_loc: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ CallNode (location: (5,0)-(5,8)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :x + ├── message_loc: (5,0)-(5,1) = "x" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (5,2)-(5,8)) + │ ├── flags: contains_keywords + │ └── arguments: (length: 1) + │ └── @ KeywordHashNode (location: (5,2)-(5,8)) + │ ├── flags: symbol_keys + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (5,2)-(5,8)) + │ ├── key: + │ │ @ SymbolNode (location: (5,2)-(5,6)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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 + │ │ └── value: 42 + │ └── operator_loc: ∅ + ├── closing_loc: ∅ + └── block: ∅ 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..0ba5891cf6 --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_args_assoc_trailing_comma.txt @@ -0,0 +1,34 @@ +@ ProgramNode (location: (1,0)-(1,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,11)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,11)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: (1,1)-(1,2) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,9)) + │ ├── flags: contains_keywords + │ └── arguments: (length: 2) + │ ├── @ IntegerNode (location: (1,2)-(1,3)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── @ KeywordHashNode (location: (1,5)-(1,9)) + │ ├── flags: ∅ + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (1,5)-(1,9)) + │ ├── key: + │ │ @ IntegerNode (location: (1,5)-(1,6)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── value: + │ │ @ IntegerNode (location: (1,8)-(1,9)) + │ │ ├── flags: decimal + │ │ └── value: 3 + │ └── operator_loc: (1,6)-(1,8) = "=>" + ├── closing_loc: (1,10)-(1,11) = ")" + └── block: ∅ 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..f4a55ff58c --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_args_command.txt @@ -0,0 +1,54 @@ +@ ProgramNode (location: (1,0)-(1,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,9)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,9)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (1,1)-(1,2) = "." + ├── name: :b + ├── message_loc: (1,2)-(1,3) = "b" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,4)-(1,9)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (1,4)-(1,9)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (1,4)-(1,5)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :c + │ │ ├── message_loc: (1,4)-(1,5) = "c" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (1,5)-(1,6) = "." + │ ├── name: :d + │ ├── message_loc: (1,6)-(1,7) = "d" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,8)-(1,9)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (1,8)-(1,9)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── closing_loc: ∅ + └── block: ∅ 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..95d2f4859d --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_array_arg.txt @@ -0,0 +1,38 @@ +@ ProgramNode (location: (1,0)-(1,13)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,13)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,13)) + ├── flags: ∅ + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── call_operator_loc: ∅ + ├── name: :== + ├── message_loc: (1,2)-(1,4) = "==" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,5)-(1,13)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ ArrayNode (location: (1,5)-(1,13)) + │ ├── flags: ∅ + │ ├── elements: (length: 2) + │ │ ├── @ SymbolNode (location: (1,6)-(1,8)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (1,6)-(1,7) = ":" + │ │ │ ├── value_loc: (1,7)-(1,8) = "b" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "b" + │ │ └── @ SymbolNode (location: (1,10)-(1,12)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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: ∅ 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..e02740e7f5 --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_array_block_call.txt @@ -0,0 +1,40 @@ +@ ProgramNode (location: (1,0)-(1,19)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,19)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,19)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,19)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ ArrayNode (location: (1,2)-(1,19)) + │ ├── flags: ∅ + │ ├── elements: (length: 2) + │ │ ├── @ NilNode (location: (1,4)-(1,7)) + │ │ └── @ CallNode (location: (1,9)-(1,17)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── 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" + │ ├── opening_loc: (1,2)-(1,3) = "[" + │ └── closing_loc: (1,18)-(1,19) = "]" + ├── closing_loc: ∅ + └── block: ∅ 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..c6aa722812 --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_array_lambda_block_call.txt @@ -0,0 +1,41 @@ +@ ProgramNode (location: (1,0)-(2,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,3)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(2,3)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,11)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ ArrayNode (location: (1,2)-(1,11)) + │ ├── flags: ∅ + │ ├── 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" 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..091e21c00a --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_array_lit_inline_hash.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)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: (1,1)-(1,2) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,15)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ ArrayNode (location: (1,2)-(1,15)) + │ ├── flags: ∅ + │ ├── elements: (length: 2) + │ │ ├── @ SymbolNode (location: (1,3)-(1,5)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (1,3)-(1,4) = ":" + │ │ │ ├── value_loc: (1,4)-(1,5) = "b" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "b" + │ │ └── @ KeywordHashNode (location: (1,7)-(1,14)) + │ │ ├── flags: symbol_keys + │ │ └── elements: (length: 1) + │ │ └── @ AssocNode (location: (1,7)-(1,14)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (1,7)-(1,9)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── 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 + │ │ │ └── value: 1 + │ │ └── 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: ∅ diff --git a/test/prism/snapshots/seattlerb/call_assoc.txt b/test/prism/snapshots/seattlerb/call_assoc.txt new file mode 100644 index 0000000000..60784e6095 --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_assoc.txt @@ -0,0 +1,31 @@ +@ ProgramNode (location: (1,0)-(1,7)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,7)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,7)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: (1,1)-(1,2) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,6)) + │ ├── flags: contains_keywords + │ └── arguments: (length: 1) + │ └── @ KeywordHashNode (location: (1,2)-(1,6)) + │ ├── flags: ∅ + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (1,2)-(1,6)) + │ ├── key: + │ │ @ IntegerNode (location: (1,2)-(1,3)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── value: + │ │ @ IntegerNode (location: (1,5)-(1,6)) + │ │ ├── flags: decimal + │ │ └── value: 3 + │ └── operator_loc: (1,3)-(1,5) = "=>" + ├── closing_loc: (1,6)-(1,7) = ")" + └── block: ∅ 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..dc25fb2493 --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_assoc_new.txt @@ -0,0 +1,34 @@ +@ ProgramNode (location: (1,0)-(1,6)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,6)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,6)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: (1,1)-(1,2) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,5)) + │ ├── flags: contains_keywords + │ └── arguments: (length: 1) + │ └── @ KeywordHashNode (location: (1,2)-(1,5)) + │ ├── flags: symbol_keys + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (1,2)-(1,5)) + │ ├── key: + │ │ @ SymbolNode (location: (1,2)-(1,4)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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 + │ │ └── value: 3 + │ └── operator_loc: ∅ + ├── closing_loc: (1,5)-(1,6) = ")" + └── block: ∅ 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..b3d652e879 --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_assoc_new_if_multiline.txt @@ -0,0 +1,58 @@ +@ ProgramNode (location: (1,0)-(5,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(5,4)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(5,4)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: (1,1)-(1,2) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(5,3)) + │ ├── flags: contains_keywords + │ └── arguments: (length: 1) + │ └── @ KeywordHashNode (location: (1,2)-(5,3)) + │ ├── flags: symbol_keys + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (1,2)-(5,3)) + │ ├── key: + │ │ @ SymbolNode (location: (1,2)-(1,4)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (1,8)-(1,9) = ":" + │ │ │ ├── value_loc: (1,9)-(1,10) = "c" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "c" + │ │ ├── then_keyword_loc: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (2,0)-(2,1)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ IntegerNode (location: (2,0)-(2,1)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── 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 + │ │ │ │ └── value: 2 + │ │ │ └── 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: ∅ 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..b2012f0f75 --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_assoc_trailing_comma.txt @@ -0,0 +1,31 @@ +@ ProgramNode (location: (1,0)-(1,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,8)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,8)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: (1,1)-(1,2) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,6)) + │ ├── flags: contains_keywords + │ └── arguments: (length: 1) + │ └── @ KeywordHashNode (location: (1,2)-(1,6)) + │ ├── flags: ∅ + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (1,2)-(1,6)) + │ ├── key: + │ │ @ IntegerNode (location: (1,2)-(1,3)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── value: + │ │ @ IntegerNode (location: (1,5)-(1,6)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ └── operator_loc: (1,3)-(1,5) = "=>" + ├── closing_loc: (1,7)-(1,8) = ")" + └── block: ∅ 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..5e4e10d953 --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_bang_command_call.txt @@ -0,0 +1,41 @@ +@ ProgramNode (location: (1,0)-(1,7)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,7)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,7)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,2)-(1,7)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (1,2)-(1,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (1,2)-(1,3) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (1,3)-(1,4) = "." + │ ├── name: :b + │ ├── message_loc: (1,4)-(1,5) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,6)-(1,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (1,6)-(1,7)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: ∅ + ├── name: :! + ├── message_loc: (1,0)-(1,1) = "!" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ 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..bf11bc0136 --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_bang_squiggle.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)) + ├── flags: ∅ + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── call_operator_loc: ∅ + ├── name: :!~ + ├── message_loc: (1,2)-(1,4) = "!~" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,5)-(1,6)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,5)-(1,6)) + │ ├── flags: decimal + │ └── value: 2 + ├── closing_loc: ∅ + └── block: ∅ 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..1aa994c8e6 --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_begin_call_block_call.txt @@ -0,0 +1,53 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(3,3)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(3,3)) + │ ├── flags: ∅ + │ └── 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)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (2,0)-(2,1)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (2,0)-(2,1) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: (2,1)-(2,2) = "." + │ │ ├── name: :c + │ │ ├── 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" + │ ├── rescue_clause: ∅ + │ ├── else_clause: ∅ + │ ├── ensure_clause: ∅ + │ └── end_keyword_loc: (3,0)-(3,3) = "end" + ├── closing_loc: ∅ + └── block: ∅ 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..f87c29cf2e --- /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)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :x + ├── 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)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :blk + │ ├── message_loc: (1,3)-(1,6) = "blk" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── operator_loc: (1,2)-(1,3) = "&" diff --git a/test/prism/snapshots/seattlerb/call_carat.txt b/test/prism/snapshots/seattlerb/call_carat.txt new file mode 100644 index 0000000000..856e9a7847 --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_carat.txt @@ -0,0 +1,24 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,5)) + ├── flags: ∅ + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── call_operator_loc: ∅ + ├── name: :^ + ├── message_loc: (1,2)-(1,3) = "^" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,4)-(1,5)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,4)-(1,5)) + │ ├── flags: decimal + │ └── value: 2 + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/prism/snapshots/seattlerb/call_colon2.txt b/test/prism/snapshots/seattlerb/call_colon2.txt new file mode 100644 index 0000000000..98bfc63126 --- /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)) + ├── flags: ∅ + ├── receiver: + │ @ ConstantReadNode (location: (1,0)-(1,1)) + │ └── name: :A + ├── call_operator_loc: (1,1)-(1,3) = "::" + ├── name: :b + ├── message_loc: (1,3)-(1,4) = "b" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ 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..6d10171a2b --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_colon_parens.txt @@ -0,0 +1,18 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,5)) + ├── flags: ∅ + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── call_operator_loc: (1,1)-(1,3) = "::" + ├── name: :call + ├── message_loc: ∅ + ├── opening_loc: (1,3)-(1,4) = "(" + ├── arguments: ∅ + ├── closing_loc: (1,4)-(1,5) = ")" + └── block: ∅ diff --git a/test/prism/snapshots/seattlerb/call_div.txt b/test/prism/snapshots/seattlerb/call_div.txt new file mode 100644 index 0000000000..ba62fb87bd --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_div.txt @@ -0,0 +1,24 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,5)) + ├── flags: ∅ + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── call_operator_loc: ∅ + ├── name: :/ + ├── message_loc: (1,2)-(1,3) = "/" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,4)-(1,5)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,4)-(1,5)) + │ ├── flags: decimal + │ └── value: 2 + ├── closing_loc: ∅ + └── block: ∅ 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..c9b7084699 --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_dot_parens.txt @@ -0,0 +1,18 @@ +@ ProgramNode (location: (1,0)-(1,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,4)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,4)) + ├── flags: ∅ + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── call_operator_loc: (1,1)-(1,2) = "." + ├── name: :call + ├── message_loc: ∅ + ├── opening_loc: (1,2)-(1,3) = "(" + ├── arguments: ∅ + ├── closing_loc: (1,3)-(1,4) = ")" + └── block: ∅ diff --git a/test/prism/snapshots/seattlerb/call_env.txt b/test/prism/snapshots/seattlerb/call_env.txt new file mode 100644 index 0000000000..fd1f95388e --- /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)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (1,1)-(1,2) = "." + ├── name: :happy + ├── message_loc: (1,2)-(1,7) = "happy" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/prism/snapshots/seattlerb/call_eq3.txt b/test/prism/snapshots/seattlerb/call_eq3.txt new file mode 100644 index 0000000000..e636e15725 --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_eq3.txt @@ -0,0 +1,24 @@ +@ ProgramNode (location: (1,0)-(1,7)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,7)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,7)) + ├── flags: ∅ + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── call_operator_loc: ∅ + ├── name: :=== + ├── message_loc: (1,2)-(1,5) = "===" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,6)-(1,7)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,6)-(1,7)) + │ ├── flags: decimal + │ └── value: 2 + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/prism/snapshots/seattlerb/call_gt.txt b/test/prism/snapshots/seattlerb/call_gt.txt new file mode 100644 index 0000000000..a6f19e5adf --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_gt.txt @@ -0,0 +1,24 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,5)) + ├── flags: ∅ + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── call_operator_loc: ∅ + ├── name: :> + ├── message_loc: (1,2)-(1,3) = ">" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,4)-(1,5)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,4)-(1,5)) + │ ├── flags: decimal + │ └── value: 2 + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/prism/snapshots/seattlerb/call_kwsplat.txt b/test/prism/snapshots/seattlerb/call_kwsplat.txt new file mode 100644 index 0000000000..e0620dc5f0 --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_kwsplat.txt @@ -0,0 +1,27 @@ +@ ProgramNode (location: (1,0)-(1,6)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,6)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,6)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: (1,1)-(1,2) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,5)) + │ ├── flags: contains_keywords, contains_keyword_splat + │ └── arguments: (length: 1) + │ └── @ KeywordHashNode (location: (1,2)-(1,5)) + │ ├── flags: ∅ + │ └── elements: (length: 1) + │ └── @ AssocSplatNode (location: (1,2)-(1,5)) + │ ├── value: + │ │ @ IntegerNode (location: (1,4)-(1,5)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── operator_loc: (1,2)-(1,4) = "**" + ├── closing_loc: (1,5)-(1,6) = ")" + └── block: ∅ 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..e8435d7e7a --- /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)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,0)-(2,2)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (1,0)-(1,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (1,0)-(1,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (2,0)-(2,1) = "." + │ ├── name: :b + │ ├── message_loc: (2,1)-(2,2) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (3,0)-(3,1) = "." + ├── name: :c + ├── message_loc: (3,1)-(3,2) = "c" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ 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..e5dfb72372 --- /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)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,0)-(2,2)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (1,0)-(1,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (1,0)-(1,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (2,0)-(2,1) = "." + │ ├── name: :b + │ ├── message_loc: (2,1)-(2,2) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (4,0)-(4,1) = "." + ├── name: :d + ├── message_loc: (4,1)-(4,2) = "d" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/prism/snapshots/seattlerb/call_lt.txt b/test/prism/snapshots/seattlerb/call_lt.txt new file mode 100644 index 0000000000..14f50585d9 --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_lt.txt @@ -0,0 +1,24 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,5)) + ├── flags: ∅ + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── call_operator_loc: ∅ + ├── name: :< + ├── message_loc: (1,2)-(1,3) = "<" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,4)-(1,5)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,4)-(1,5)) + │ ├── flags: decimal + │ └── value: 2 + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/prism/snapshots/seattlerb/call_lte.txt b/test/prism/snapshots/seattlerb/call_lte.txt new file mode 100644 index 0000000000..665a99d60a --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_lte.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)) + ├── flags: ∅ + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── call_operator_loc: ∅ + ├── name: :<= + ├── message_loc: (1,2)-(1,4) = "<=" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,5)-(1,6)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,5)-(1,6)) + │ ├── flags: decimal + │ └── value: 2 + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/prism/snapshots/seattlerb/call_not.txt b/test/prism/snapshots/seattlerb/call_not.txt new file mode 100644 index 0000000000..86c6892303 --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_not.txt @@ -0,0 +1,18 @@ +@ ProgramNode (location: (1,0)-(1,6)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,6)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,6)) + ├── flags: ∅ + ├── receiver: + │ @ IntegerNode (location: (1,4)-(1,6)) + │ ├── flags: decimal + │ └── value: 42 + ├── call_operator_loc: ∅ + ├── name: :! + ├── message_loc: (1,0)-(1,3) = "not" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/prism/snapshots/seattlerb/call_pipe.txt b/test/prism/snapshots/seattlerb/call_pipe.txt new file mode 100644 index 0000000000..855e986ef6 --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_pipe.txt @@ -0,0 +1,24 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,5)) + ├── flags: ∅ + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── call_operator_loc: ∅ + ├── name: :| + ├── message_loc: (1,2)-(1,3) = "|" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,4)-(1,5)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,4)-(1,5)) + │ ├── flags: decimal + │ └── value: 2 + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/prism/snapshots/seattlerb/call_rshift.txt b/test/prism/snapshots/seattlerb/call_rshift.txt new file mode 100644 index 0000000000..26e593db18 --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_rshift.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)) + ├── flags: ∅ + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── call_operator_loc: ∅ + ├── name: :>> + ├── message_loc: (1,2)-(1,4) = ">>" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,5)-(1,6)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,5)-(1,6)) + │ ├── flags: decimal + │ └── value: 2 + ├── closing_loc: ∅ + └── block: ∅ 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..16ca69b5c2 --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_self_brackets.txt @@ -0,0 +1,22 @@ +@ ProgramNode (location: (1,0)-(1,7)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,7)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,7)) + ├── flags: ignore_visibility + ├── receiver: + │ @ SelfNode (location: (1,0)-(1,4)) + ├── call_operator_loc: ∅ + ├── name: :[] + ├── message_loc: (1,4)-(1,7) = "[1]" + ├── opening_loc: (1,4)-(1,5) = "[" + ├── arguments: + │ @ ArgumentsNode (location: (1,5)-(1,6)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,5)-(1,6)) + │ ├── flags: decimal + │ └── value: 1 + ├── closing_loc: (1,6)-(1,7) = "]" + └── block: ∅ diff --git a/test/prism/snapshots/seattlerb/call_spaceship.txt b/test/prism/snapshots/seattlerb/call_spaceship.txt new file mode 100644 index 0000000000..8d43c3f971 --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_spaceship.txt @@ -0,0 +1,24 @@ +@ ProgramNode (location: (1,0)-(1,7)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,7)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,7)) + ├── flags: ∅ + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── call_operator_loc: ∅ + ├── name: :<=> + ├── message_loc: (1,2)-(1,5) = "<=>" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,6)-(1,7)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,6)-(1,7)) + │ ├── flags: decimal + │ └── value: 2 + ├── closing_loc: ∅ + └── block: ∅ 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..242db9e9cb --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_stabby_do_end_with_block.txt @@ -0,0 +1,41 @@ +@ ProgramNode (location: (1,0)-(1,22)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,22)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,22)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,13)) + │ ├── flags: ∅ + │ └── 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 + │ └── value: 1 + ├── 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 + │ └── value: 2 + ├── opening_loc: (1,14)-(1,16) = "do" + └── closing_loc: (1,19)-(1,22) = "end" 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..7c3ab8dad8 --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_stabby_with_braces_block.txt @@ -0,0 +1,41 @@ +@ ProgramNode (location: (1,0)-(1,19)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,19)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,19)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,10)) + │ ├── flags: ∅ + │ └── 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 + │ └── value: 1 + ├── 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 + │ └── value: 2 + ├── opening_loc: (1,11)-(1,13) = "do" + └── closing_loc: (1,16)-(1,19) = "end" diff --git a/test/prism/snapshots/seattlerb/call_star.txt b/test/prism/snapshots/seattlerb/call_star.txt new file mode 100644 index 0000000000..49aee1672c --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_star.txt @@ -0,0 +1,24 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,5)) + ├── flags: ∅ + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── call_operator_loc: ∅ + ├── name: :* + ├── message_loc: (1,2)-(1,3) = "*" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,4)-(1,5)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,4)-(1,5)) + │ ├── flags: decimal + │ └── value: 2 + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/prism/snapshots/seattlerb/call_star2.txt b/test/prism/snapshots/seattlerb/call_star2.txt new file mode 100644 index 0000000000..cc2532cc7c --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_star2.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)) + ├── flags: ∅ + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── call_operator_loc: ∅ + ├── name: :** + ├── message_loc: (1,2)-(1,4) = "**" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,5)-(1,6)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,5)-(1,6)) + │ ├── flags: decimal + │ └── value: 2 + ├── closing_loc: ∅ + └── block: ∅ 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..fe28a3ad3e --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_trailing_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)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: (1,1)-(1,2) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,3)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,2)-(1,3)) + │ ├── flags: decimal + │ └── value: 1 + ├── closing_loc: (1,4)-(1,5) = ")" + └── block: ∅ 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..b0e23eb27b --- /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)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,0)-(2,1)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (1,0)-(1,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (1,0)-(1,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (1,1)-(1,2) = "." + │ ├── name: :b + │ ├── message_loc: (2,0)-(2,1) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (2,1)-(2,2) = "." + ├── name: :c + ├── message_loc: (3,0)-(3,1) = "c" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ 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..782cc83b10 --- /dev/null +++ b/test/prism/snapshots/seattlerb/call_unary_bang.txt @@ -0,0 +1,18 @@ +@ ProgramNode (location: (1,0)-(1,2)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,2)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,2)) + ├── flags: ∅ + ├── receiver: + │ @ IntegerNode (location: (1,1)-(1,2)) + │ ├── flags: decimal + │ └── value: 1 + ├── call_operator_loc: ∅ + ├── name: :! + ├── message_loc: (1,0)-(1,1) = "!" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/prism/snapshots/seattlerb/case_in.txt b/test/prism/snapshots/seattlerb/case_in.txt new file mode 100644 index 0000000000..950d66647e --- /dev/null +++ b/test/prism/snapshots/seattlerb/case_in.txt @@ -0,0 +1,976 @@ +@ ProgramNode (location: (1,0)-(111,3)) +├── locals: [:b, :_, :lhs, :x, :rhs, :c, :e] +└── statements: + @ StatementsNode (location: (1,0)-(111,3)) + └── body: (length: 28) + ├── @ CaseMatchNode (location: (1,0)-(3,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (1,5)-(1,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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: ∅ + │ │ │ ├── elements: (length: 1) + │ │ │ │ └── @ AssocNode (location: (2,4)-(2,8)) + │ │ │ │ ├── key: + │ │ │ │ │ @ SymbolNode (location: (2,4)-(2,8)) + │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ ├── opening_loc: (2,4)-(2,5) = "\"" + │ │ │ │ │ ├── value_loc: (2,5)-(2,6) = "b" + │ │ │ │ │ ├── closing_loc: (2,6)-(2,8) = "\":" + │ │ │ │ │ └── unescaped: "b" + │ │ │ │ ├── value: + │ │ │ │ │ @ ImplicitNode (location: (2,5)-(2,6)) + │ │ │ │ │ └── value: + │ │ │ │ │ @ LocalVariableTargetNode (location: (2,5)-(2,6)) + │ │ │ │ │ ├── name: :b + │ │ │ │ │ └── depth: 0 + │ │ │ │ └── operator_loc: ∅ + │ │ │ ├── rest: ∅ + │ │ │ ├── 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" + ├── @ CaseMatchNode (location: (5,0)-(7,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (5,5)-(5,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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)) + │ │ │ ├── flags: ∅ + │ │ │ ├── elements: (length: 2) + │ │ │ │ ├── @ SymbolNode (location: (6,6)-(6,7)) + │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── value_loc: (6,6)-(6,7) = "a" + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── unescaped: "a" + │ │ │ │ └── @ SymbolNode (location: (6,8)-(6,9)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── 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" + ├── @ CaseMatchNode (location: (9,0)-(11,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (9,5)-(9,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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)) + │ │ │ ├── flags: ∅ + │ │ │ ├── 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" + ├── @ CaseMatchNode (location: (13,0)-(15,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (13,5)-(13,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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)) + │ │ │ ├── flags: ∅ + │ │ │ ├── elements: (length: 2) + │ │ │ │ ├── @ SymbolNode (location: (14,6)-(14,7)) + │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── value_loc: (14,6)-(14,7) = "a" + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── unescaped: "a" + │ │ │ │ └── @ SymbolNode (location: (14,8)-(14,9)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── 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" + ├── @ CaseMatchNode (location: (17,0)-(19,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (17,5)-(17,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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)) + │ │ │ ├── flags: ∅ + │ │ │ ├── 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" + ├── @ CaseMatchNode (location: (21,0)-(23,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (21,5)-(21,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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,10)) + │ │ ├── pattern: + │ │ │ @ ParenthesesNode (location: (22,3)-(22,10)) + │ │ │ ├── body: + │ │ │ │ @ RangeNode (location: (22,4)-(22,9)) + │ │ │ │ ├── flags: exclude_end + │ │ │ │ ├── left: ∅ + │ │ │ │ ├── right: + │ │ │ │ │ @ IntegerNode (location: (22,7)-(22,9)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 10 + │ │ │ │ └── operator_loc: (22,4)-(22,7) = "..." + │ │ │ ├── opening_loc: (22,3)-(22,4) = "(" + │ │ │ └── closing_loc: (22,9)-(22,10) = ")" + │ │ ├── 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" + ├── @ CaseMatchNode (location: (25,0)-(27,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (25,5)-(25,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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,9)) + │ │ ├── pattern: + │ │ │ @ ParenthesesNode (location: (26,3)-(26,9)) + │ │ │ ├── body: + │ │ │ │ @ RangeNode (location: (26,4)-(26,8)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── left: ∅ + │ │ │ │ ├── right: + │ │ │ │ │ @ IntegerNode (location: (26,6)-(26,8)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 10 + │ │ │ │ └── operator_loc: (26,4)-(26,6) = ".." + │ │ │ ├── opening_loc: (26,3)-(26,4) = "(" + │ │ │ └── closing_loc: (26,8)-(26,9) = ")" + │ │ ├── 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" + ├── @ CaseMatchNode (location: (29,0)-(31,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (29,5)-(29,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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,9)) + │ │ ├── pattern: + │ │ │ @ ParenthesesNode (location: (30,3)-(30,9)) + │ │ │ ├── body: + │ │ │ │ @ RangeNode (location: (30,4)-(30,8)) + │ │ │ │ ├── flags: exclude_end + │ │ │ │ ├── left: + │ │ │ │ │ @ IntegerNode (location: (30,4)-(30,5)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 1 + │ │ │ │ ├── right: ∅ + │ │ │ │ └── operator_loc: (30,5)-(30,8) = "..." + │ │ │ ├── opening_loc: (30,3)-(30,4) = "(" + │ │ │ └── closing_loc: (30,8)-(30,9) = ")" + │ │ ├── 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" + ├── @ CaseMatchNode (location: (33,0)-(35,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (33,5)-(33,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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,10)) + │ │ ├── pattern: + │ │ │ @ ParenthesesNode (location: (34,3)-(34,10)) + │ │ │ ├── body: + │ │ │ │ @ RangeNode (location: (34,4)-(34,9)) + │ │ │ │ ├── flags: exclude_end + │ │ │ │ ├── left: + │ │ │ │ │ @ IntegerNode (location: (34,4)-(34,5)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 1 + │ │ │ │ ├── right: + │ │ │ │ │ @ IntegerNode (location: (34,8)-(34,9)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 3 + │ │ │ │ └── operator_loc: (34,5)-(34,8) = "..." + │ │ │ ├── opening_loc: (34,3)-(34,4) = "(" + │ │ │ └── closing_loc: (34,9)-(34,10) = ")" + │ │ ├── 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" + ├── @ CaseMatchNode (location: (37,0)-(39,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (37,5)-(37,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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,7)) + │ │ ├── pattern: + │ │ │ @ ParenthesesNode (location: (38,3)-(38,7)) + │ │ │ ├── body: + │ │ │ │ @ IntegerNode (location: (38,4)-(38,6)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 42 + │ │ │ ├── opening_loc: (38,3)-(38,4) = "(" + │ │ │ └── closing_loc: (38,6)-(38,7) = ")" + │ │ ├── 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" + ├── @ CaseMatchNode (location: (41,0)-(43,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (41,5)-(41,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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: ∅ + │ │ │ ├── elements: (length: 0) + │ │ │ ├── rest: + │ │ │ │ @ NoKeywordsParameterNode (location: (42,3)-(42,8)) + │ │ │ │ ├── operator_loc: (42,3)-(42,5) = "**" + │ │ │ │ └── keyword_loc: (42,5)-(42,8) = "nil" + │ │ │ ├── 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" + ├── @ CaseMatchNode (location: (45,0)-(47,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (45,5)-(45,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (46,3)-(46,4) = "/" + │ │ │ ├── content_loc: (46,4)-(46,10) = "regexp" + │ │ │ ├── closing_loc: (46,10)-(46,11) = "/" + │ │ │ └── unescaped: "regexp" + │ │ ├── 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" + ├── @ CaseMatchNode (location: (49,0)-(51,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (49,5)-(49,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── 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)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── 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" + ├── @ CaseMatchNode (location: (53,0)-(55,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (53,5)-(53,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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)) + │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ ├── 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)) + │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ ├── 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" + ├── @ CaseMatchNode (location: (57,0)-(59,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (57,5)-(57,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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" + ├── @ CaseMatchNode (location: (61,0)-(63,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (61,5)-(61,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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" + ├── @ CaseMatchNode (location: (65,0)-(67,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (65,5)-(65,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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" + ├── @ CaseMatchNode (location: (69,0)-(71,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (69,5)-(69,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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)) + │ │ │ │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ │ │ │ └── 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" + ├── @ CaseMatchNode (location: (73,0)-(75,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (73,5)-(73,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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)) + │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ ├── 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)) + │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ ├── 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" + ├── @ CaseMatchNode (location: (77,0)-(79,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (77,5)-(77,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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" + ├── @ CaseMatchNode (location: (81,0)-(83,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (81,5)-(81,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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)) + │ │ │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ │ │ ├── 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)) + │ │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ │ ├── 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" + ├── @ CaseMatchNode (location: (85,0)-(87,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (85,5)-(85,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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" + ├── @ CaseMatchNode (location: (89,0)-(91,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (89,5)-(89,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :a + │ │ │ │ │ ├── message_loc: (90,6)-(90,7) = "a" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── 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" + ├── @ CaseMatchNode (location: (93,0)-(95,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (93,5)-(93,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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" + ├── @ CaseMatchNode (location: (97,0)-(99,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (97,5)-(97,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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)) + │ │ │ ├── flags: ∅ + │ │ │ ├── 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" + ├── @ CaseMatchNode (location: (101,0)-(103,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (101,5)-(101,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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" + ├── @ CaseMatchNode (location: (105,0)-(107,3)) + │ ├── predicate: + │ │ @ SymbolNode (location: (105,5)-(105,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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: ∅ + │ │ │ ├── elements: (length: 1) + │ │ │ │ └── @ AssocNode (location: (106,5)-(106,9)) + │ │ │ │ ├── key: + │ │ │ │ │ @ SymbolNode (location: (106,5)-(106,9)) + │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ ├── opening_loc: (106,5)-(106,6) = "\"" + │ │ │ │ │ ├── value_loc: (106,6)-(106,7) = "b" + │ │ │ │ │ ├── closing_loc: (106,7)-(106,9) = "\":" + │ │ │ │ │ └── unescaped: "b" + │ │ │ │ ├── value: + │ │ │ │ │ @ ImplicitNode (location: (106,6)-(106,7)) + │ │ │ │ │ └── value: + │ │ │ │ │ @ LocalVariableTargetNode (location: (106,6)-(106,7)) + │ │ │ │ │ ├── name: :b + │ │ │ │ │ └── depth: 0 + │ │ │ │ └── operator_loc: ∅ + │ │ │ ├── rest: ∅ + │ │ │ ├── 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" + └── @ CaseMatchNode (location: (109,0)-(111,3)) + ├── predicate: + │ @ SymbolNode (location: (109,5)-(109,7)) + │ ├── flags: forced_us_ascii_encoding + │ ├── 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: ∅ + │ │ ├── elements: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── 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..fdf5ce2a29 --- /dev/null +++ b/test/prism/snapshots/seattlerb/case_in_31.txt @@ -0,0 +1,49 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [:c] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(4,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── flags: forced_us_ascii_encoding + │ ├── 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)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── 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)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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..1a1d887b4f --- /dev/null +++ b/test/prism/snapshots/seattlerb/case_in_37.txt @@ -0,0 +1,58 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(4,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── flags: forced_us_ascii_encoding + │ ├── 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: ∅ + │ │ ├── elements: (length: 1) + │ │ │ └── @ AssocNode (location: (2,5)-(2,17)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (2,5)-(2,7)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── 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: ∅ + │ │ ├── rest: ∅ + │ │ ├── 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)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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..f985d6bc8d --- /dev/null +++ b/test/prism/snapshots/seattlerb/case_in_42.txt @@ -0,0 +1,44 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [:_] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(3,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── flags: forced_us_ascii_encoding + │ ├── 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)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── 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..c399ba1bfa --- /dev/null +++ b/test/prism/snapshots/seattlerb/case_in_42_2.txt @@ -0,0 +1,40 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [:list] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(3,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── flags: forced_us_ascii_encoding + │ ├── 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..99baebce05 --- /dev/null +++ b/test/prism/snapshots/seattlerb/case_in_47.txt @@ -0,0 +1,52 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(4,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── flags: forced_us_ascii_encoding + │ ├── 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)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: (2,7)-(2,8) = ":" + │ │ │ │ ├── value_loc: (2,8)-(2,9) = "b" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "b" + │ │ │ └── @ SymbolNode (location: (2,11)-(2,13)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── 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)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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..4bab417d57 --- /dev/null +++ b/test/prism/snapshots/seattlerb/case_in_67.txt @@ -0,0 +1,33 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(3,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── flags: forced_us_ascii_encoding + │ ├── 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)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ IntegerNode (location: (2,3)-(2,4)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── right: ∅ + │ │ └── operator_loc: (2,4)-(2,6) = ".." + │ ├── 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..082aa74eca --- /dev/null +++ b/test/prism/snapshots/seattlerb/case_in_86.txt @@ -0,0 +1,51 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(3,3)) + ├── predicate: + │ @ ArrayNode (location: (1,5)-(1,13)) + │ ├── flags: ∅ + │ ├── elements: (length: 2) + │ │ ├── @ SymbolNode (location: (1,6)-(1,8)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (1,6)-(1,7) = ":" + │ │ │ ├── value_loc: (1,7)-(1,8) = "a" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a" + │ │ └── @ SymbolNode (location: (1,10)-(1,12)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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: ∅ + │ │ │ ├── name: :NilClass + │ │ │ ├── delimiter_loc: (2,3)-(2,5) = "::" + │ │ │ └── name_loc: (2,5)-(2,13) = "NilClass" + │ │ ├── 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..346264f907 --- /dev/null +++ b/test/prism/snapshots/seattlerb/case_in_86_2.txt @@ -0,0 +1,51 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(3,3)) + ├── predicate: + │ @ ArrayNode (location: (1,5)-(1,13)) + │ ├── flags: ∅ + │ ├── elements: (length: 2) + │ │ ├── @ SymbolNode (location: (1,6)-(1,8)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (1,6)-(1,7) = ":" + │ │ │ ├── value_loc: (1,7)-(1,8) = "a" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a" + │ │ └── @ SymbolNode (location: (1,10)-(1,12)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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: ∅ + │ │ │ ├── name: :NilClass + │ │ │ ├── delimiter_loc: (2,6)-(2,8) = "::" + │ │ │ └── name_loc: (2,8)-(2,16) = "NilClass" + │ │ ├── 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..f361e8d458 --- /dev/null +++ b/test/prism/snapshots/seattlerb/case_in_array_pat_const.txt @@ -0,0 +1,42 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [:c] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(4,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── flags: forced_us_ascii_encoding + │ ├── 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)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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..d6fb80ef90 --- /dev/null +++ b/test/prism/snapshots/seattlerb/case_in_array_pat_const2.txt @@ -0,0 +1,47 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [:d] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(4,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── flags: forced_us_ascii_encoding + │ ├── 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 + │ │ │ ├── name: :C + │ │ │ ├── delimiter_loc: (2,4)-(2,6) = "::" + │ │ │ └── name_loc: (2,6)-(2,7) = "C" + │ │ ├── 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)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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..8d185b250a --- /dev/null +++ b/test/prism/snapshots/seattlerb/case_in_array_pat_paren_assign.txt @@ -0,0 +1,48 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [:d] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(4,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── flags: forced_us_ascii_encoding + │ ├── 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)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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..c4b838aa1d --- /dev/null +++ b/test/prism/snapshots/seattlerb/case_in_const.txt @@ -0,0 +1,28 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CaseMatchNode (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)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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..5eae7fc1ea --- /dev/null +++ b/test/prism/snapshots/seattlerb/case_in_else.txt @@ -0,0 +1,40 @@ +@ ProgramNode (location: (1,0)-(6,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(6,3)) + └── body: (length: 1) + └── @ CaseMatchNode (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)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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..f84c4c30d0 --- /dev/null +++ b/test/prism/snapshots/seattlerb/case_in_find.txt @@ -0,0 +1,47 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [:a, :b] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(3,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── flags: forced_us_ascii_encoding + │ ├── 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)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── 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..a757f80346 --- /dev/null +++ b/test/prism/snapshots/seattlerb/case_in_find_array.txt @@ -0,0 +1,44 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [:c] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(3,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── flags: forced_us_ascii_encoding + │ ├── 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)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── 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..e813efa9ee --- /dev/null +++ b/test/prism/snapshots/seattlerb/case_in_hash_pat.txt @@ -0,0 +1,68 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(4,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── flags: forced_us_ascii_encoding + │ ├── 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: ∅ + │ │ ├── elements: (length: 2) + │ │ │ ├── @ AssocNode (location: (2,5)-(2,11)) + │ │ │ │ ├── key: + │ │ │ │ │ @ SymbolNode (location: (2,5)-(2,7)) + │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ ├── 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)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── 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: ∅ + │ │ ├── rest: ∅ + │ │ ├── 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)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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..790d9d63ff --- /dev/null +++ b/test/prism/snapshots/seattlerb/case_in_hash_pat_assign.txt @@ -0,0 +1,86 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [:x, :f] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(4,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── flags: forced_us_ascii_encoding + │ ├── 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: ∅ + │ │ ├── elements: (length: 3) + │ │ │ ├── @ AssocNode (location: (2,5)-(2,20)) + │ │ │ │ ├── key: + │ │ │ │ │ @ SymbolNode (location: (2,5)-(2,7)) + │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ ├── 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)) + │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ ├── 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)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (2,30)-(2,31) = "f" + │ │ │ │ ├── closing_loc: (2,31)-(2,32) = ":" + │ │ │ │ └── unescaped: "f" + │ │ │ ├── value: + │ │ │ │ @ ImplicitNode (location: (2,30)-(2,31)) + │ │ │ │ └── value: + │ │ │ │ @ LocalVariableTargetNode (location: (2,30)-(2,31)) + │ │ │ │ ├── name: :f + │ │ │ │ └── depth: 0 + │ │ │ └── operator_loc: ∅ + │ │ ├── rest: ∅ + │ │ ├── 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)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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..4c8cfd0e54 --- /dev/null +++ b/test/prism/snapshots/seattlerb/case_in_hash_pat_paren_assign.txt @@ -0,0 +1,51 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(4,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── flags: forced_us_ascii_encoding + │ ├── 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 + │ │ ├── elements: (length: 1) + │ │ │ └── @ AssocNode (location: (2,5)-(2,10)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (2,5)-(2,7)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── 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 + │ │ │ │ └── value: 42 + │ │ │ └── operator_loc: ∅ + │ │ ├── rest: ∅ + │ │ ├── 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)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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..8ff95a161f --- /dev/null +++ b/test/prism/snapshots/seattlerb/case_in_hash_pat_paren_true.txt @@ -0,0 +1,47 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(4,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── flags: forced_us_ascii_encoding + │ ├── 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: ∅ + │ │ ├── elements: (length: 1) + │ │ │ └── @ AssocNode (location: (2,3)-(2,10)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (2,3)-(2,5)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── 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: ∅ + │ │ ├── rest: ∅ + │ │ ├── opening_loc: ∅ + │ │ └── closing_loc: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (3,2)-(3,4)) + │ │ └── body: (length: 1) + │ │ └── @ SymbolNode (location: (3,2)-(3,4)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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..b93b889ec5 --- /dev/null +++ b/test/prism/snapshots/seattlerb/case_in_hash_pat_rest.txt @@ -0,0 +1,55 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [:c, :rest] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(3,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── flags: forced_us_ascii_encoding + │ ├── 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: ∅ + │ │ ├── elements: (length: 1) + │ │ │ └── @ AssocNode (location: (2,3)-(2,7)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (2,3)-(2,5)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── 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: ∅ + │ │ ├── rest: + │ │ │ @ AssocSplatNode (location: (2,9)-(2,15)) + │ │ │ ├── value: + │ │ │ │ @ LocalVariableTargetNode (location: (2,11)-(2,15)) + │ │ │ │ ├── name: :rest + │ │ │ │ └── depth: 0 + │ │ │ └── operator_loc: (2,9)-(2,11) = "**" + │ │ ├── opening_loc: ∅ + │ │ └── closing_loc: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (2,21)-(2,23)) + │ │ └── body: (length: 1) + │ │ └── @ SymbolNode (location: (2,21)-(2,23)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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..956e93faa0 --- /dev/null +++ b/test/prism/snapshots/seattlerb/case_in_hash_pat_rest_solo.txt @@ -0,0 +1,42 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [:rest] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(3,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── flags: forced_us_ascii_encoding + │ ├── 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: ∅ + │ │ ├── elements: (length: 0) + │ │ ├── rest: + │ │ │ @ AssocSplatNode (location: (2,3)-(2,9)) + │ │ │ ├── value: + │ │ │ │ @ LocalVariableTargetNode (location: (2,5)-(2,9)) + │ │ │ │ ├── name: :rest + │ │ │ │ └── depth: 0 + │ │ │ └── operator_loc: (2,3)-(2,5) = "**" + │ │ ├── opening_loc: ∅ + │ │ └── closing_loc: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (2,15)-(2,17)) + │ │ └── body: (length: 1) + │ │ └── @ SymbolNode (location: (2,15)-(2,17)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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..a21d3e15dd --- /dev/null +++ b/test/prism/snapshots/seattlerb/case_in_if_unless_post_mod.txt @@ -0,0 +1,67 @@ +@ ProgramNode (location: (1,0)-(6,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(6,3)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(6,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── flags: forced_us_ascii_encoding + │ ├── 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)) + │ │ │ ├── then_keyword_loc: ∅ + │ │ │ ├── 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)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── 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)) + │ │ ├── then_keyword_loc: ∅ + │ │ ├── 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)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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..eba0084f96 --- /dev/null +++ b/test/prism/snapshots/seattlerb/case_in_multiple.txt @@ -0,0 +1,57 @@ +@ ProgramNode (location: (1,0)-(6,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(6,3)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(6,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── flags: forced_us_ascii_encoding + │ ├── 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 + │ │ │ ├── name: :B + │ │ │ ├── delimiter_loc: (2,4)-(2,6) = "::" + │ │ │ └── name_loc: (2,6)-(2,7) = "B" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (3,2)-(3,4)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ SymbolNode (location: (3,2)-(3,4)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── 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 + │ │ ├── name: :E + │ │ ├── delimiter_loc: (4,4)-(4,6) = "::" + │ │ └── name_loc: (4,6)-(4,7) = "E" + │ ├── statements: + │ │ @ StatementsNode (location: (5,2)-(5,4)) + │ │ └── body: (length: 1) + │ │ └── @ SymbolNode (location: (5,2)-(5,4)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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..7ac6617608 --- /dev/null +++ b/test/prism/snapshots/seattlerb/case_in_or.txt @@ -0,0 +1,38 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(4,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── flags: forced_us_ascii_encoding + │ ├── 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)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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..b6e12dfb15 --- /dev/null +++ b/test/prism/snapshots/seattlerb/cond_unary_minus.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,0)-(1,2) = "if" + ├── predicate: + │ @ IntegerNode (location: (1,3)-(1,5)) + │ ├── flags: decimal + │ └── value: -1 + ├── then_keyword_loc: ∅ + ├── 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..e09eed7d2f --- /dev/null +++ b/test/prism/snapshots/seattlerb/const_2_op_asgn_or2.txt @@ -0,0 +1,22 @@ +@ 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: ∅ + │ │ ├── name: :X + │ │ ├── delimiter_loc: (1,0)-(1,2) = "::" + │ │ └── name_loc: (1,2)-(1,3) = "X" + │ ├── name: :Y + │ ├── delimiter_loc: (1,3)-(1,5) = "::" + │ └── name_loc: (1,5)-(1,6) = "Y" + ├── operator_loc: (1,7)-(1,10) = "||=" + └── value: + @ IntegerNode (location: (1,11)-(1,12)) + ├── flags: decimal + └── value: 1 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..398af888a8 --- /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: ∅ + │ ├── name: :X + │ ├── delimiter_loc: (1,0)-(1,2) = "::" + │ └── name_loc: (1,2)-(1,3) = "X" + ├── operator_loc: (1,4)-(1,7) = "||=" + └── value: + @ IntegerNode (location: (1,8)-(1,9)) + ├── flags: decimal + └── value: 1 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..f9792aebb3 --- /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: ∅ + │ ├── name: :X + │ ├── delimiter_loc: (1,0)-(1,2) = "::" + │ └── name_loc: (1,2)-(1,3) = "X" + ├── binary_operator_loc: (1,4)-(1,6) = "&=" + ├── value: + │ @ IntegerNode (location: (1,7)-(1,8)) + │ ├── flags: decimal + │ └── value: 1 + └── binary_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..146455d327 --- /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: ∅ + │ ├── name: :X + │ ├── delimiter_loc: (1,0)-(1,2) = "::" + │ └── name_loc: (1,2)-(1,3) = "X" + ├── operator_loc: (1,4)-(1,7) = "&&=" + └── value: + @ IntegerNode (location: (1,8)-(1,9)) + ├── flags: decimal + └── value: 1 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..5e9dd39604 --- /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 + │ ├── name: :Y + │ ├── delimiter_loc: (1,1)-(1,3) = "::" + │ └── name_loc: (1,3)-(1,4) = "Y" + ├── operator_loc: (1,5)-(1,8) = "||=" + └── value: + @ IntegerNode (location: (1,9)-(1,10)) + ├── flags: decimal + └── value: 1 diff --git a/test/prism/snapshots/seattlerb/dasgn_icky2.txt b/test/prism/snapshots/seattlerb/dasgn_icky2.txt new file mode 100644 index 0000000000..e118362f87 --- /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)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── 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" 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..49b577fcd1 --- /dev/null +++ b/test/prism/snapshots/seattlerb/defined_eh_parens.txt @@ -0,0 +1,13 @@ +@ 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 + │ └── value: 42 + ├── 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..3f2bdf44a4 --- /dev/null +++ b/test/prism/snapshots/seattlerb/defn_arg_asplat_arg.txt @@ -0,0 +1,37 @@ +@ 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)) + │ │ ├── flags: ∅ + │ │ └── name: :interp + │ ├── optionals: (length: 0) + │ ├── rest: + │ │ @ RestParameterNode (location: (1,17)-(1,18)) + │ │ ├── flags: ∅ + │ │ ├── name: ∅ + │ │ ├── name_loc: ∅ + │ │ └── operator_loc: (1,17)-(1,18) = "*" + │ ├── posts: (length: 1) + │ │ └── @ RequiredParameterNode (location: (1,20)-(1,24)) + │ │ ├── flags: ∅ + │ │ └── 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..4121770c5c --- /dev/null +++ b/test/prism/snapshots/seattlerb/defn_arg_forward_args.txt @@ -0,0 +1,49 @@ +@ 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)) + │ │ ├── flags: ∅ + │ │ └── 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)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :b + │ ├── message_loc: (1,15)-(1,16) = "b" + │ ├── opening_loc: (1,16)-(1,17) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,17)-(1,23)) + │ │ ├── flags: ∅ + │ │ └── 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: ∅ + ├── 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..178b6ccde7 --- /dev/null +++ b/test/prism/snapshots/seattlerb/defn_args_forward_args.txt @@ -0,0 +1,61 @@ +@ 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)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :x + │ │ ├── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :y + │ │ └── @ RequiredParameterNode (location: (1,12)-(1,13)) + │ │ ├── flags: ∅ + │ │ └── 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)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :b + │ ├── message_loc: (1,21)-(1,22) = "b" + │ ├── opening_loc: (1,22)-(1,23) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,23)-(1,35)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 3) + │ │ ├── @ SymbolNode (location: (1,23)-(1,27)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── 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: ∅ + ├── 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..c3ea59282a --- /dev/null +++ b/test/prism/snapshots/seattlerb/defn_endless_command.txt @@ -0,0 +1,36 @@ +@ 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)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :other_method + │ ├── message_loc: (1,18)-(1,30) = "other_method" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,31)-(1,33)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (1,31)-(1,33)) + │ │ ├── flags: decimal + │ │ └── value: 42 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── 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..dfd1d01ba8 --- /dev/null +++ b/test/prism/snapshots/seattlerb/defn_endless_command_rescue.txt @@ -0,0 +1,43 @@ +@ 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) + │ └── @ RescueModifierNode (location: (1,18)-(1,43)) + │ ├── expression: + │ │ @ CallNode (location: (1,18)-(1,33)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :other_method + │ │ ├── message_loc: (1,18)-(1,30) = "other_method" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (1,31)-(1,33)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (1,31)-(1,33)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 42 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── keyword_loc: (1,34)-(1,40) = "rescue" + │ └── rescue_expression: + │ @ IntegerNode (location: (1,41)-(1,43)) + │ ├── flags: decimal + │ └── value: 24 + ├── 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..71a984c811 --- /dev/null +++ b/test/prism/snapshots/seattlerb/defn_forward_args.txt @@ -0,0 +1,43 @@ +@ 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)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :b + │ ├── message_loc: (1,12)-(1,13) = "b" + │ ├── opening_loc: (1,13)-(1,14) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,14)-(1,17)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ ForwardingArgumentsNode (location: (1,14)-(1,17)) + │ ├── closing_loc: (1,17)-(1,18) = ")" + │ └── block: ∅ + ├── 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..4a4d69e4d0 --- /dev/null +++ b/test/prism/snapshots/seattlerb/defn_forward_args__no_parens.txt @@ -0,0 +1,43 @@ +@ 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)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :m + │ ├── message_loc: (2,2)-(2,3) = "m" + │ ├── opening_loc: (2,3)-(2,4) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (2,4)-(2,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ ForwardingArgumentsNode (location: (2,4)-(2,7)) + │ ├── closing_loc: (2,7)-(2,8) = ")" + │ └── block: ∅ + ├── 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..2aadedd964 --- /dev/null +++ b/test/prism/snapshots/seattlerb/defn_kwarg_env.txt @@ -0,0 +1,55 @@ +@ 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)) + │ │ ├── flags: ∅ + │ │ ├── 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)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :test_splat + │ ├── message_loc: (1,20)-(1,30) = "test_splat" + │ ├── opening_loc: (1,30)-(1,31) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,31)-(1,40)) + │ │ ├── flags: contains_keywords, contains_keyword_splat + │ │ └── arguments: (length: 1) + │ │ └── @ KeywordHashNode (location: (1,31)-(1,40)) + │ │ ├── flags: ∅ + │ │ └── 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: ∅ + ├── 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..8a5022ff37 --- /dev/null +++ b/test/prism/snapshots/seattlerb/defn_kwarg_kwarg.txt @@ -0,0 +1,45 @@ +@ 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)) + │ │ ├── flags: ∅ + │ │ └── name: :a + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 2) + │ │ ├── @ OptionalKeywordParameterNode (location: (1,9)-(1,13)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :b + │ │ │ ├── name_loc: (1,9)-(1,11) = "b:" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (1,12)-(1,13)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── @ OptionalKeywordParameterNode (location: (1,15)-(1,19)) + │ │ ├── flags: ∅ + │ │ ├── name: :c + │ │ ├── name_loc: (1,15)-(1,17) = "c:" + │ │ └── value: + │ │ @ IntegerNode (location: (1,18)-(1,19)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── 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..4c980bc27f --- /dev/null +++ b/test/prism/snapshots/seattlerb/defn_kwarg_kwsplat.txt @@ -0,0 +1,39 @@ +@ 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) + │ │ └── @ OptionalKeywordParameterNode (location: (1,6)-(1,10)) + │ │ ├── flags: ∅ + │ │ ├── name: :b + │ │ ├── name_loc: (1,6)-(1,8) = "b:" + │ │ └── value: + │ │ @ IntegerNode (location: (1,9)-(1,10)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── keyword_rest: + │ │ @ KeywordRestParameterNode (location: (1,12)-(1,15)) + │ │ ├── flags: ∅ + │ │ ├── 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..40afacc2a7 --- /dev/null +++ b/test/prism/snapshots/seattlerb/defn_kwarg_kwsplat_anon.txt @@ -0,0 +1,39 @@ +@ 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) + │ │ └── @ OptionalKeywordParameterNode (location: (1,6)-(1,10)) + │ │ ├── flags: ∅ + │ │ ├── name: :b + │ │ ├── name_loc: (1,6)-(1,8) = "b:" + │ │ └── value: + │ │ @ IntegerNode (location: (1,9)-(1,10)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── keyword_rest: + │ │ @ KeywordRestParameterNode (location: (1,12)-(1,14)) + │ │ ├── flags: ∅ + │ │ ├── name: ∅ + │ │ ├── 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..0eae56924c --- /dev/null +++ b/test/prism/snapshots/seattlerb/defn_kwarg_lvar.txt @@ -0,0 +1,42 @@ +@ 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) + │ │ └── @ OptionalKeywordParameterNode (location: (1,8)-(1,16)) + │ │ ├── flags: ∅ + │ │ ├── name: :kw + │ │ ├── name_loc: (1,8)-(1,11) = "kw:" + │ │ └── value: + │ │ @ SymbolNode (location: (1,12)-(1,16)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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..bc5747ad02 --- /dev/null +++ b/test/prism/snapshots/seattlerb/defn_kwarg_no_parens.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: :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) + │ │ └── @ OptionalKeywordParameterNode (location: (1,6)-(1,10)) + │ │ ├── flags: ∅ + │ │ ├── name: :a + │ │ ├── name_loc: (1,6)-(1,8) = "a:" + │ │ └── value: + │ │ @ IntegerNode (location: (1,9)-(1,10)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── 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..82527f7875 --- /dev/null +++ b/test/prism/snapshots/seattlerb/defn_kwarg_val.txt @@ -0,0 +1,37 @@ +@ 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)) + │ │ ├── flags: ∅ + │ │ └── name: :a + │ ├── optionals: (length: 0) + │ ├── rest: ∅ + │ ├── posts: (length: 0) + │ ├── keywords: (length: 1) + │ │ └── @ OptionalKeywordParameterNode (location: (1,9)-(1,12)) + │ │ ├── flags: ∅ + │ │ ├── name: :b + │ │ ├── name_loc: (1,9)-(1,11) = "b:" + │ │ └── value: + │ │ @ IntegerNode (location: (1,11)-(1,12)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── 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..e700499809 --- /dev/null +++ b/test/prism/snapshots/seattlerb/defn_oneliner.txt @@ -0,0 +1,47 @@ +@ 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)) + │ │ ├── flags: ∅ + │ │ └── 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)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :system + │ ├── message_loc: (1,16)-(1,22) = "system" + │ ├── opening_loc: (1,22)-(1,23) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,23)-(1,26)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ LocalVariableReadNode (location: (1,23)-(1,26)) + │ │ ├── name: :cmd + │ │ └── depth: 0 + │ ├── closing_loc: (1,26)-(1,27) = ")" + │ └── block: ∅ + ├── 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..2708351ede --- /dev/null +++ b/test/prism/snapshots/seattlerb/defn_oneliner_eq2.txt @@ -0,0 +1,47 @@ +@ 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)) + │ │ │ ├── flags: ∅ + │ │ │ └── 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 + │ │ └── value: 42 + │ ├── 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..54555b1a23 --- /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)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :system + │ ├── message_loc: (1,11)-(1,17) = "system" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── 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..e0fc4636f1 --- /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)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :system + │ ├── message_loc: (1,13)-(1,19) = "system" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── 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..b5b5dbe6ac --- /dev/null +++ b/test/prism/snapshots/seattlerb/defn_oneliner_rescue.txt @@ -0,0 +1,158 @@ +@ 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)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :cmd + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: + │ │ @ BeginNode (location: (1,0)-(5,3)) + │ │ ├── begin_keyword_loc: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (2,2)-(2,13)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (2,2)-(2,13)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :system + │ │ │ ├── message_loc: (2,2)-(2,8) = "system" + │ │ │ ├── opening_loc: (2,8)-(2,9) = "(" + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (2,9)-(2,12)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ LocalVariableReadNode (location: (2,9)-(2,12)) + │ │ │ │ ├── name: :cmd + │ │ │ │ └── depth: 0 + │ │ │ ├── closing_loc: (2,12)-(2,13) = ")" + │ │ │ └── block: ∅ + │ │ ├── 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)) + │ │ │ ├── flags: ∅ + │ │ │ └── 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)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :system + │ │ │ ├── message_loc: (9,2)-(9,8) = "system" + │ │ │ ├── opening_loc: (9,8)-(9,9) = "(" + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (9,9)-(9,12)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ LocalVariableReadNode (location: (9,9)-(9,12)) + │ │ │ │ ├── name: :cmd + │ │ │ │ └── depth: 0 + │ │ │ ├── closing_loc: (9,12)-(9,13) = ")" + │ │ │ └── block: ∅ + │ │ ├── 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)) + │ │ ├── flags: ∅ + │ │ └── 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)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :system + │ │ ├── message_loc: (13,16)-(13,22) = "system" + │ │ ├── opening_loc: (13,22)-(13,23) = "(" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (13,23)-(13,26)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ LocalVariableReadNode (location: (13,23)-(13,26)) + │ │ │ ├── name: :cmd + │ │ │ └── depth: 0 + │ │ ├── closing_loc: (13,26)-(13,27) = ")" + │ │ └── block: ∅ + │ ├── 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..569bc23078 --- /dev/null +++ b/test/prism/snapshots/seattlerb/defn_opt_last_arg.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: :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)) + │ │ ├── flags: ∅ + │ │ ├── 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..f86168513a --- /dev/null +++ b/test/prism/snapshots/seattlerb/defn_opt_reg.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: :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)) + │ │ ├── flags: ∅ + │ │ ├── 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)) + │ │ ├── flags: ∅ + │ │ └── 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..3019e9b73e --- /dev/null +++ b/test/prism/snapshots/seattlerb/defn_opt_splat_arg.txt @@ -0,0 +1,43 @@ +@ 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)) + │ │ ├── flags: ∅ + │ │ ├── name: :a + │ │ ├── name_loc: (1,7)-(1,8) = "a" + │ │ ├── operator_loc: (1,9)-(1,10) = "=" + │ │ └── value: + │ │ @ IntegerNode (location: (1,11)-(1,12)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── rest: + │ │ @ RestParameterNode (location: (1,14)-(1,16)) + │ │ ├── flags: ∅ + │ │ ├── name: :b + │ │ ├── name_loc: (1,15)-(1,16) = "b" + │ │ └── operator_loc: (1,14)-(1,15) = "*" + │ ├── posts: (length: 1) + │ │ └── @ RequiredParameterNode (location: (1,18)-(1,19)) + │ │ ├── flags: ∅ + │ │ └── 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..bce131ad18 --- /dev/null +++ b/test/prism/snapshots/seattlerb/defn_powarg.txt @@ -0,0 +1,31 @@ +@ 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)) + │ │ ├── flags: ∅ + │ │ ├── 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..d079e1b5f3 --- /dev/null +++ b/test/prism/snapshots/seattlerb/defn_reg_opt_reg.txt @@ -0,0 +1,44 @@ +@ 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)) + │ │ ├── flags: ∅ + │ │ └── name: :a + │ ├── optionals: (length: 1) + │ │ └── @ OptionalParameterNode (location: (1,9)-(1,15)) + │ │ ├── flags: ∅ + │ │ ├── name: :b + │ │ ├── name_loc: (1,9)-(1,10) = "b" + │ │ ├── operator_loc: (1,11)-(1,12) = "=" + │ │ └── value: + │ │ @ SymbolNode (location: (1,13)-(1,15)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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)) + │ │ ├── flags: ∅ + │ │ └── 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..109fac495a --- /dev/null +++ b/test/prism/snapshots/seattlerb/defn_splat_arg.txt @@ -0,0 +1,34 @@ +@ 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)) + │ │ ├── flags: ∅ + │ │ ├── name: ∅ + │ │ ├── name_loc: ∅ + │ │ └── operator_loc: (1,6)-(1,7) = "*" + │ ├── posts: (length: 1) + │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ ├── flags: ∅ + │ │ └── 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..231a3c0da9 --- /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..24bb14f8e1 --- /dev/null +++ b/test/prism/snapshots/seattlerb/defs_as_arg_with_do_block_inside.txt @@ -0,0 +1,60 @@ +@ ProgramNode (location: (1,0)-(1,30)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,30)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,30)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :p + ├── message_loc: (1,0)-(1,1) = "p" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,30)) + │ ├── flags: ∅ + │ └── 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)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (1,14)-(1,15)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :x + │ │ │ ├── message_loc: (1,14)-(1,15) = "x" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: (1,15)-(1,16) = "." + │ │ ├── name: :y + │ │ ├── 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" + │ ├── 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: ∅ 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..f3c4e79417 --- /dev/null +++ b/test/prism/snapshots/seattlerb/defs_endless_command.txt @@ -0,0 +1,46 @@ +@ 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)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :x + │ ├── message_loc: (1,4)-(1,5) = "x" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── parameters: ∅ + ├── body: + │ @ StatementsNode (location: (1,20)-(1,35)) + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,20)-(1,35)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :other_method + │ ├── message_loc: (1,20)-(1,32) = "other_method" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,33)-(1,35)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (1,33)-(1,35)) + │ │ ├── flags: decimal + │ │ └── value: 42 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── 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..b0cd34a9c8 --- /dev/null +++ b/test/prism/snapshots/seattlerb/defs_endless_command_rescue.txt @@ -0,0 +1,53 @@ +@ 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)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :x + │ ├── message_loc: (1,4)-(1,5) = "x" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── parameters: ∅ + ├── body: + │ @ StatementsNode (location: (1,20)-(1,45)) + │ └── body: (length: 1) + │ └── @ RescueModifierNode (location: (1,20)-(1,45)) + │ ├── expression: + │ │ @ CallNode (location: (1,20)-(1,35)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :other_method + │ │ ├── message_loc: (1,20)-(1,32) = "other_method" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (1,33)-(1,35)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (1,33)-(1,35)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 42 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── keyword_loc: (1,36)-(1,42) = "rescue" + │ └── rescue_expression: + │ @ IntegerNode (location: (1,43)-(1,45)) + │ ├── flags: decimal + │ └── value: 24 + ├── 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..53235c9bb8 --- /dev/null +++ b/test/prism/snapshots/seattlerb/defs_kwarg.txt @@ -0,0 +1,35 @@ +@ 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) + │ │ └── @ OptionalKeywordParameterNode (location: (1,11)-(1,15)) + │ │ ├── flags: ∅ + │ │ ├── name: :b + │ │ ├── name_loc: (1,11)-(1,13) = "b:" + │ │ └── value: + │ │ @ IntegerNode (location: (1,14)-(1,15)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── 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..d32975354d --- /dev/null +++ b/test/prism/snapshots/seattlerb/defs_oneliner.txt @@ -0,0 +1,48 @@ +@ 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)) + │ │ ├── flags: ∅ + │ │ └── 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)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :system + │ ├── message_loc: (1,21)-(1,27) = "system" + │ ├── opening_loc: (1,27)-(1,28) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,28)-(1,31)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ LocalVariableReadNode (location: (1,28)-(1,31)) + │ │ ├── name: :cmd + │ │ └── depth: 0 + │ ├── closing_loc: (1,31)-(1,32) = ")" + │ └── block: ∅ + ├── 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..fcc5c63cf0 --- /dev/null +++ b/test/prism/snapshots/seattlerb/defs_oneliner_eq2.txt @@ -0,0 +1,48 @@ +@ 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)) + │ │ │ ├── flags: ∅ + │ │ │ └── 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 + │ │ └── value: 42 + │ ├── 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..f776210768 --- /dev/null +++ b/test/prism/snapshots/seattlerb/defs_oneliner_rescue.txt @@ -0,0 +1,161 @@ +@ 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)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :cmd + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: + │ │ @ BeginNode (location: (1,0)-(5,3)) + │ │ ├── begin_keyword_loc: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (2,2)-(2,13)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (2,2)-(2,13)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :system + │ │ │ ├── message_loc: (2,2)-(2,8) = "system" + │ │ │ ├── opening_loc: (2,8)-(2,9) = "(" + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (2,9)-(2,12)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ LocalVariableReadNode (location: (2,9)-(2,12)) + │ │ │ │ ├── name: :cmd + │ │ │ │ └── depth: 0 + │ │ │ ├── closing_loc: (2,12)-(2,13) = ")" + │ │ │ └── block: ∅ + │ │ ├── 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)) + │ │ │ ├── flags: ∅ + │ │ │ └── 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)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :system + │ │ │ ├── message_loc: (9,2)-(9,8) = "system" + │ │ │ ├── opening_loc: (9,8)-(9,9) = "(" + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (9,9)-(9,12)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ LocalVariableReadNode (location: (9,9)-(9,12)) + │ │ │ │ ├── name: :cmd + │ │ │ │ └── depth: 0 + │ │ │ ├── closing_loc: (9,12)-(9,13) = ")" + │ │ │ └── block: ∅ + │ │ ├── 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)) + │ │ ├── flags: ∅ + │ │ └── 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)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :system + │ │ ├── message_loc: (13,21)-(13,27) = "system" + │ │ ├── opening_loc: (13,27)-(13,28) = "(" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (13,28)-(13,31)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ LocalVariableReadNode (location: (13,28)-(13,31)) + │ │ │ ├── name: :cmd + │ │ │ └── depth: 0 + │ │ ├── closing_loc: (13,31)-(13,32) = ")" + │ │ └── block: ∅ + │ ├── 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..8ba30ccf85 --- /dev/null +++ b/test/prism/snapshots/seattlerb/difficult0_.txt @@ -0,0 +1,73 @@ +@ ProgramNode (location: (1,0)-(4,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,8)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(4,8)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :p + ├── message_loc: (1,0)-(1,1) = "p" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(4,8)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (1,2)-(4,8)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (1,2)-(4,4)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ StringNode (location: (1,2)-(1,8)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (1,2)-(1,8) = "<<-END" + │ │ │ ├── content_loc: (2,0)-(3,0) = " a\n" + │ │ │ ├── closing_loc: (3,0)-(4,0) = " END\n" + │ │ │ └── unescaped: " a\n" + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :+ + │ │ ├── message_loc: (1,8)-(1,9) = "+" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (1,9)-(4,4)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ InterpolatedStringNode (location: (1,9)-(4,4)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (1,9)-(1,10) = "'" + │ │ │ ├── parts: (length: 2) + │ │ │ │ ├── @ StringNode (location: (1,10)-(2,0)) + │ │ │ │ │ ├── flags: frozen + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── content_loc: (1,10)-(2,0) = "b\n" + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── unescaped: "b\n" + │ │ │ │ └── @ StringNode (location: (4,0)-(4,3)) + │ │ │ │ ├── flags: frozen + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── content_loc: (4,0)-(4,3) = " c" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: " c" + │ │ │ └── closing_loc: (4,3)-(4,4) = "'" + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :+ + │ ├── message_loc: (4,4)-(4,5) = "+" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (4,5)-(4,8)) + │ │ ├── flags: ∅ + │ │ └── 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: ∅ + ├── closing_loc: ∅ + └── block: ∅ 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..da2306312c --- /dev/null +++ b/test/prism/snapshots/seattlerb/difficult1_line_numbers.txt @@ -0,0 +1,267 @@ +@ 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)) + ├── then_keyword_loc: ∅ + ├── statements: + │ @ StatementsNode (location: (2,2)-(11,11)) + │ └── body: (length: 10) + │ ├── @ CallNode (location: (2,2)-(2,5)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :p + │ │ ├── message_loc: (2,2)-(2,3) = "p" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (2,4)-(2,5)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (2,4)-(2,5)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── @ CallNode (location: (3,2)-(3,7)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (3,2)-(3,3)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :a + │ │ │ ├── message_loc: (3,2)-(3,3) = "a" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: (3,3)-(3,4) = "." + │ │ ├── name: :b + │ │ ├── message_loc: (3,4)-(3,5) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (3,6)-(3,7)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (3,6)-(3,7)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── @ CallNode (location: (4,2)-(4,10)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (4,2)-(4,3)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :c + │ │ │ ├── message_loc: (4,2)-(4,3) = "c" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: (4,3)-(4,4) = "." + │ │ ├── name: :d + │ │ ├── message_loc: (4,4)-(4,5) = "d" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (4,6)-(4,10)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 2) + │ │ │ ├── @ IntegerNode (location: (4,6)-(4,7)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 3 + │ │ │ └── @ IntegerNode (location: (4,9)-(4,10)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 4 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── @ CallNode (location: (5,2)-(5,7)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (5,2)-(5,3)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :e + │ │ │ ├── message_loc: (5,2)-(5,3) = "e" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: (5,3)-(5,4) = "." + │ │ ├── name: :f + │ │ ├── message_loc: (5,4)-(5,5) = "f" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (5,6)-(5,7)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (5,6)-(5,7)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 5 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── @ CallNode (location: (6,2)-(6,10)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (6,2)-(6,3)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :g + │ │ │ ├── message_loc: (6,2)-(6,3) = "g" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: (6,3)-(6,4) = "." + │ │ ├── name: :h + │ │ ├── message_loc: (6,4)-(6,5) = "h" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (6,6)-(6,10)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 2) + │ │ │ ├── @ IntegerNode (location: (6,6)-(6,7)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 6 + │ │ │ └── @ IntegerNode (location: (6,9)-(6,10)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 7 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── @ CallNode (location: (7,2)-(7,6)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :p + │ │ ├── message_loc: (7,2)-(7,3) = "p" + │ │ ├── opening_loc: (7,3)-(7,4) = "(" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (7,4)-(7,5)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (7,4)-(7,5)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── closing_loc: (7,5)-(7,6) = ")" + │ │ └── block: ∅ + │ ├── @ CallNode (location: (8,2)-(8,8)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (8,2)-(8,3)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :a + │ │ │ ├── message_loc: (8,2)-(8,3) = "a" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: (8,3)-(8,4) = "." + │ │ ├── name: :b + │ │ ├── message_loc: (8,4)-(8,5) = "b" + │ │ ├── opening_loc: (8,5)-(8,6) = "(" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (8,6)-(8,7)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (8,6)-(8,7)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ ├── closing_loc: (8,7)-(8,8) = ")" + │ │ └── block: ∅ + │ ├── @ CallNode (location: (9,2)-(9,11)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (9,2)-(9,3)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :c + │ │ │ ├── message_loc: (9,2)-(9,3) = "c" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: (9,3)-(9,4) = "." + │ │ ├── name: :d + │ │ ├── message_loc: (9,4)-(9,5) = "d" + │ │ ├── opening_loc: (9,5)-(9,6) = "(" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (9,6)-(9,10)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 2) + │ │ │ ├── @ IntegerNode (location: (9,6)-(9,7)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 3 + │ │ │ └── @ IntegerNode (location: (9,9)-(9,10)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 4 + │ │ ├── closing_loc: (9,10)-(9,11) = ")" + │ │ └── block: ∅ + │ ├── @ CallNode (location: (10,2)-(10,8)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (10,2)-(10,3)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :e + │ │ │ ├── message_loc: (10,2)-(10,3) = "e" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: (10,3)-(10,4) = "." + │ │ ├── name: :f + │ │ ├── message_loc: (10,4)-(10,5) = "f" + │ │ ├── opening_loc: (10,5)-(10,6) = "(" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (10,6)-(10,7)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (10,6)-(10,7)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 5 + │ │ ├── closing_loc: (10,7)-(10,8) = ")" + │ │ └── block: ∅ + │ └── @ CallNode (location: (11,2)-(11,11)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (11,2)-(11,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :g + │ │ ├── message_loc: (11,2)-(11,3) = "g" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (11,3)-(11,4) = "." + │ ├── name: :h + │ ├── message_loc: (11,4)-(11,5) = "h" + │ ├── opening_loc: (11,5)-(11,6) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (11,6)-(11,10)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ IntegerNode (location: (11,6)-(11,7)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 6 + │ │ └── @ IntegerNode (location: (11,9)-(11,10)) + │ │ ├── flags: decimal + │ │ └── value: 7 + │ ├── closing_loc: (11,10)-(11,11) = ")" + │ └── block: ∅ + ├── 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..f586634c59 --- /dev/null +++ b/test/prism/snapshots/seattlerb/difficult1_line_numbers2.txt @@ -0,0 +1,78 @@ +@ 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)) + │ ├── then_keyword_loc: (1,8)-(1,12) = "then" + │ ├── statements: + │ │ @ StatementsNode (location: (2,2)-(5,6)) + │ │ └── body: (length: 4) + │ │ ├── @ CallNode (location: (2,2)-(2,8)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :p + │ │ │ ├── message_loc: (2,2)-(2,3) = "p" + │ │ │ ├── opening_loc: (2,3)-(2,4) = "(" + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (2,4)-(2,7)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── 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: ∅ + │ │ ├── @ 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 + │ │ │ │ └── value: 1 + │ │ │ └── operator_loc: (3,4)-(3,5) = "=" + │ │ ├── @ CallNode (location: (4,2)-(4,5)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :p + │ │ │ ├── message_loc: (4,2)-(4,3) = "p" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (4,4)-(4,5)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ LocalVariableReadNode (location: (4,4)-(4,5)) + │ │ │ │ ├── name: :b + │ │ │ │ └── depth: 0 + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── @ 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 + │ │ │ └── value: 1 + │ │ └── operator_loc: (5,4)-(5,5) = "=" + │ ├── consequent: ∅ + │ └── end_keyword_loc: (6,0)-(6,3) = "end" + └── @ CallNode (location: (7,0)-(7,1)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── message_loc: (7,0)-(7,1) = "a" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/prism/snapshots/seattlerb/difficult2_.txt b/test/prism/snapshots/seattlerb/difficult2_.txt new file mode 100644 index 0000000000..b53d4cad3f --- /dev/null +++ b/test/prism/snapshots/seattlerb/difficult2_.txt @@ -0,0 +1,74 @@ +@ 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 + │ │ └── value: 1 + │ ├── then_keyword_loc: (1,2)-(1,3) = "?" + │ ├── statements: + │ │ @ StatementsNode (location: (1,4)-(1,9)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (1,4)-(1,9)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (1,4)-(1,5) = "b" + │ │ ├── opening_loc: (1,5)-(1,6) = "(" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (1,6)-(1,8)) + │ │ │ ├── flags: ∅ + │ │ │ └── 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: ∅ + │ ├── 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 + │ │ │ └── value: 2 + │ │ └── end_keyword_loc: ∅ + │ └── end_keyword_loc: ∅ + └── @ CallNode (location: (2,0)-(2,6)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── message_loc: (2,0)-(2,1) = "a" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (2,2)-(2,6)) + │ ├── flags: contains_keywords + │ └── arguments: (length: 1) + │ └── @ KeywordHashNode (location: (2,2)-(2,6)) + │ ├── flags: symbol_keys + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (2,2)-(2,6)) + │ ├── key: + │ │ @ SymbolNode (location: (2,2)-(2,4)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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 + │ │ └── value: 3 + │ └── operator_loc: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/prism/snapshots/seattlerb/difficult3_.txt b/test/prism/snapshots/seattlerb/difficult3_.txt new file mode 100644 index 0000000000..f074c49a9f --- /dev/null +++ b/test/prism/snapshots/seattlerb/difficult3_.txt @@ -0,0 +1,52 @@ +@ ProgramNode (location: (1,0)-(1,18)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,18)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,18)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── 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)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ └── @ MultiTargetNode (location: (1,8)-(1,15)) + │ │ │ ├── lefts: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :b + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (1,12)-(1,14)) + │ │ │ │ ├── operator_loc: (1,12)-(1,13) = "*" + │ │ │ │ └── expression: + │ │ │ │ @ RequiredParameterNode (location: (1,13)-(1,14)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :c + │ │ │ ├── rights: (length: 0) + │ │ │ ├── lparen_loc: (1,8)-(1,9) = "(" + │ │ │ └── rparen_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) = "}" diff --git a/test/prism/snapshots/seattlerb/difficult3_2.txt b/test/prism/snapshots/seattlerb/difficult3_2.txt new file mode 100644 index 0000000000..af1a649171 --- /dev/null +++ b/test/prism/snapshots/seattlerb/difficult3_2.txt @@ -0,0 +1,42 @@ +@ ProgramNode (location: (1,0)-(1,13)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,13)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,13)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── 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)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :a + │ │ │ ├── name_loc: (1,6)-(1,7) = "a" + │ │ │ └── operator_loc: (1,5)-(1,6) = "*" + │ │ ├── posts: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ ├── flags: ∅ + │ │ │ └── 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) = "}" diff --git a/test/prism/snapshots/seattlerb/difficult3_3.txt b/test/prism/snapshots/seattlerb/difficult3_3.txt new file mode 100644 index 0000000000..e49bbcd55a --- /dev/null +++ b/test/prism/snapshots/seattlerb/difficult3_3.txt @@ -0,0 +1,47 @@ +@ ProgramNode (location: (1,0)-(1,17)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,17)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,17)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── 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)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :a + │ │ │ ├── name_loc: (1,6)-(1,7) = "a" + │ │ │ └── operator_loc: (1,5)-(1,6) = "*" + │ │ ├── posts: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :b + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: + │ │ @ BlockParameterNode (location: (1,12)-(1,14)) + │ │ ├── flags: ∅ + │ │ ├── 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) = "}" diff --git a/test/prism/snapshots/seattlerb/difficult3_4.txt b/test/prism/snapshots/seattlerb/difficult3_4.txt new file mode 100644 index 0000000000..73afffb4cb --- /dev/null +++ b/test/prism/snapshots/seattlerb/difficult3_4.txt @@ -0,0 +1,38 @@ +@ 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)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (1,2)-(1,3) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── then_keyword_loc: (1,4)-(1,5) = "?" + │ ├── 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..793c3f1e11 --- /dev/null +++ b/test/prism/snapshots/seattlerb/difficult3_5.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)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,19)) + │ ├── flags: ∅ + │ └── 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)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :g + │ ├── 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" + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/prism/snapshots/seattlerb/difficult3__10.txt b/test/prism/snapshots/seattlerb/difficult3__10.txt new file mode 100644 index 0000000000..0131e44d44 --- /dev/null +++ b/test/prism/snapshots/seattlerb/difficult3__10.txt @@ -0,0 +1,52 @@ +@ ProgramNode (location: (1,0)-(1,18)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,18)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,18)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── 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)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ └── @ MultiTargetNode (location: (1,8)-(1,15)) + │ │ │ ├── lefts: (length: 0) + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (1,9)-(1,11)) + │ │ │ │ ├── operator_loc: (1,9)-(1,10) = "*" + │ │ │ │ └── expression: + │ │ │ │ @ RequiredParameterNode (location: (1,10)-(1,11)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :b + │ │ │ ├── rights: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,13)-(1,14)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :c + │ │ │ ├── lparen_loc: (1,8)-(1,9) = "(" + │ │ │ └── rparen_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) = "}" diff --git a/test/prism/snapshots/seattlerb/difficult3__11.txt b/test/prism/snapshots/seattlerb/difficult3__11.txt new file mode 100644 index 0000000000..a658b091c2 --- /dev/null +++ b/test/prism/snapshots/seattlerb/difficult3__11.txt @@ -0,0 +1,46 @@ +@ ProgramNode (location: (1,0)-(1,14)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,14)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,14)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── 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)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ └── @ MultiTargetNode (location: (1,8)-(1,11)) + │ │ │ ├── lefts: (length: 0) + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (1,9)-(1,10)) + │ │ │ │ ├── operator_loc: (1,9)-(1,10) = "*" + │ │ │ │ └── expression: ∅ + │ │ │ ├── rights: (length: 0) + │ │ │ ├── lparen_loc: (1,8)-(1,9) = "(" + │ │ │ └── rparen_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) = "}" diff --git a/test/prism/snapshots/seattlerb/difficult3__12.txt b/test/prism/snapshots/seattlerb/difficult3__12.txt new file mode 100644 index 0000000000..5aa252fe6a --- /dev/null +++ b/test/prism/snapshots/seattlerb/difficult3__12.txt @@ -0,0 +1,49 @@ +@ ProgramNode (location: (1,0)-(1,17)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,17)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,17)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── 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)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ └── @ MultiTargetNode (location: (1,8)-(1,14)) + │ │ │ ├── lefts: (length: 0) + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (1,9)-(1,10)) + │ │ │ │ ├── operator_loc: (1,9)-(1,10) = "*" + │ │ │ │ └── expression: ∅ + │ │ │ ├── rights: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,12)-(1,13)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :b + │ │ │ ├── lparen_loc: (1,8)-(1,9) = "(" + │ │ │ └── rparen_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) = "}" diff --git a/test/prism/snapshots/seattlerb/difficult3__6.txt b/test/prism/snapshots/seattlerb/difficult3__6.txt new file mode 100644 index 0000000000..a42a625be7 --- /dev/null +++ b/test/prism/snapshots/seattlerb/difficult3__6.txt @@ -0,0 +1,55 @@ +@ ProgramNode (location: (1,0)-(1,21)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,21)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,21)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── 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)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ └── @ MultiTargetNode (location: (1,8)-(1,18)) + │ │ │ ├── lefts: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :b + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (1,12)-(1,14)) + │ │ │ │ ├── operator_loc: (1,12)-(1,13) = "*" + │ │ │ │ └── expression: + │ │ │ │ @ RequiredParameterNode (location: (1,13)-(1,14)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :c + │ │ │ ├── rights: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,16)-(1,17)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :d + │ │ │ ├── lparen_loc: (1,8)-(1,9) = "(" + │ │ │ └── rparen_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) = "}" diff --git a/test/prism/snapshots/seattlerb/difficult3__7.txt b/test/prism/snapshots/seattlerb/difficult3__7.txt new file mode 100644 index 0000000000..b08025804c --- /dev/null +++ b/test/prism/snapshots/seattlerb/difficult3__7.txt @@ -0,0 +1,49 @@ +@ ProgramNode (location: (1,0)-(1,17)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,17)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,17)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── 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)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ └── @ MultiTargetNode (location: (1,8)-(1,14)) + │ │ │ ├── lefts: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :b + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (1,12)-(1,13)) + │ │ │ │ ├── operator_loc: (1,12)-(1,13) = "*" + │ │ │ │ └── expression: ∅ + │ │ │ ├── rights: (length: 0) + │ │ │ ├── lparen_loc: (1,8)-(1,9) = "(" + │ │ │ └── rparen_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) = "}" diff --git a/test/prism/snapshots/seattlerb/difficult3__8.txt b/test/prism/snapshots/seattlerb/difficult3__8.txt new file mode 100644 index 0000000000..b2b118faef --- /dev/null +++ b/test/prism/snapshots/seattlerb/difficult3__8.txt @@ -0,0 +1,52 @@ +@ ProgramNode (location: (1,0)-(1,20)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,20)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,20)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── 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)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ └── @ MultiTargetNode (location: (1,8)-(1,17)) + │ │ │ ├── lefts: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :b + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (1,12)-(1,13)) + │ │ │ │ ├── operator_loc: (1,12)-(1,13) = "*" + │ │ │ │ └── expression: ∅ + │ │ │ ├── rights: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (1,15)-(1,16)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :c + │ │ │ ├── lparen_loc: (1,8)-(1,9) = "(" + │ │ │ └── rparen_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) = "}" diff --git a/test/prism/snapshots/seattlerb/difficult3__9.txt b/test/prism/snapshots/seattlerb/difficult3__9.txt new file mode 100644 index 0000000000..85c10a4432 --- /dev/null +++ b/test/prism/snapshots/seattlerb/difficult3__9.txt @@ -0,0 +1,49 @@ +@ ProgramNode (location: (1,0)-(1,15)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,15)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,15)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── 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)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ └── @ MultiTargetNode (location: (1,8)-(1,12)) + │ │ │ ├── lefts: (length: 0) + │ │ │ ├── rest: + │ │ │ │ @ SplatNode (location: (1,9)-(1,11)) + │ │ │ │ ├── operator_loc: (1,9)-(1,10) = "*" + │ │ │ │ └── expression: + │ │ │ │ @ RequiredParameterNode (location: (1,10)-(1,11)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :b + │ │ │ ├── rights: (length: 0) + │ │ │ ├── lparen_loc: (1,8)-(1,9) = "(" + │ │ │ └── rparen_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) = "}" 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..8307c806e6 --- /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)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (2,0)-(2,1) = "." + ├── name: :b + ├── message_loc: (2,1)-(2,2) = "b" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ 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..ee4370c0f0 --- /dev/null +++ b/test/prism/snapshots/seattlerb/difficult4__leading_dots2.txt @@ -0,0 +1,16 @@ +@ 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 + │ └── value: 1 + └── @ RangeNode (location: (2,0)-(2,3)) + ├── flags: ∅ + ├── left: ∅ + ├── right: + │ @ IntegerNode (location: (2,2)-(2,3)) + │ ├── flags: decimal + │ └── value: 3 + └── operator_loc: (2,0)-(2,2) = ".." diff --git a/test/prism/snapshots/seattlerb/difficult6_.txt b/test/prism/snapshots/seattlerb/difficult6_.txt new file mode 100644 index 0000000000..bf80034fe9 --- /dev/null +++ b/test/prism/snapshots/seattlerb/difficult6_.txt @@ -0,0 +1,61 @@ +@ 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)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :a + │ │ ├── optionals: (length: 1) + │ │ │ └── @ OptionalParameterNode (location: (1,6)-(1,11)) + │ │ │ ├── flags: ∅ + │ │ │ ├── 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)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :p + ├── message_loc: (1,15)-(1,16) = "p" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,17)-(1,23)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ ArrayNode (location: (1,17)-(1,23)) + │ ├── flags: ∅ + │ ├── 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: ∅ diff --git a/test/prism/snapshots/seattlerb/difficult6__7.txt b/test/prism/snapshots/seattlerb/difficult6__7.txt new file mode 100644 index 0000000000..7fe70c7033 --- /dev/null +++ b/test/prism/snapshots/seattlerb/difficult6__7.txt @@ -0,0 +1,55 @@ +@ ProgramNode (location: (1,0)-(1,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,11)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,11)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (1,1)-(1,2) = "." + ├── name: :b + ├── message_loc: (1,2)-(1,3) = "b" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,4)-(1,7)) + │ ├── flags: ∅ + │ └── 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 + │ │ └── value: 1 + │ ├── 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)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :c + │ ├── message_loc: (1,9)-(1,10) = "c" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── opening_loc: (1,8)-(1,9) = "{" + └── closing_loc: (1,10)-(1,11) = "}" diff --git a/test/prism/snapshots/seattlerb/difficult6__8.txt b/test/prism/snapshots/seattlerb/difficult6__8.txt new file mode 100644 index 0000000000..7f915e283c --- /dev/null +++ b/test/prism/snapshots/seattlerb/difficult6__8.txt @@ -0,0 +1,55 @@ +@ ProgramNode (location: (1,0)-(1,12)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,12)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,12)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (1,1)-(1,3) = "::" + ├── name: :b + ├── message_loc: (1,3)-(1,4) = "b" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,5)-(1,8)) + │ ├── flags: ∅ + │ └── 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 + │ │ └── value: 1 + │ ├── 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)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :c + │ ├── message_loc: (1,10)-(1,11) = "c" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── opening_loc: (1,9)-(1,10) = "{" + └── closing_loc: (1,11)-(1,12) = "}" diff --git a/test/prism/snapshots/seattlerb/difficult7_.txt b/test/prism/snapshots/seattlerb/difficult7_.txt new file mode 100644 index 0000000000..40c778cf6c --- /dev/null +++ b/test/prism/snapshots/seattlerb/difficult7_.txt @@ -0,0 +1,93 @@ +@ 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)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (2,8)-(2,9) = "a" + │ │ │ ├── closing_loc: (2,9)-(2,10) = ":" + │ │ │ └── unescaped: "a" + │ │ ├── value: + │ │ │ @ CallNode (location: (2,11)-(2,33)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :lambda + │ │ │ ├── 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)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :b + │ │ │ │ │ ├── message_loc: (2,20)-(2,21) = "b" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── then_keyword_loc: (2,22)-(2,23) = "?" + │ │ │ │ ├── statements: + │ │ │ │ │ @ StatementsNode (location: (2,24)-(2,27)) + │ │ │ │ │ └── body: (length: 1) + │ │ │ │ │ └── @ CallNode (location: (2,24)-(2,27)) + │ │ │ │ │ ├── flags: ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :c + │ │ │ │ │ ├── message_loc: (2,24)-(2,25) = "c" + │ │ │ │ │ ├── opening_loc: (2,25)-(2,26) = "(" + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: (2,26)-(2,27) = ")" + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── 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)) + │ │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ │ ├── name: :d + │ │ │ │ │ │ ├── message_loc: (2,30)-(2,31) = "d" + │ │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ │ └── block: ∅ + │ │ │ │ │ └── end_keyword_loc: ∅ + │ │ │ │ └── end_keyword_loc: ∅ + │ │ │ ├── opening_loc: (2,18)-(2,19) = "{" + │ │ │ └── closing_loc: (2,32)-(2,33) = "}" + │ │ └── operator_loc: ∅ + │ └── @ AssocNode (location: (3,8)-(3,14)) + │ ├── key: + │ │ @ SymbolNode (location: (3,8)-(3,10)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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..5877b18d68 --- /dev/null +++ b/test/prism/snapshots/seattlerb/do_bug.txt @@ -0,0 +1,63 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 2) + ├── @ CallNode (location: (1,0)-(1,3)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,2)-(1,3)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (1,2)-(1,3)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ CallNode (location: (2,0)-(4,3)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (2,0)-(2,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (2,0)-(2,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (2,1)-(2,2) = "." + ├── name: :b + ├── 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)) + │ │ │ ├── flags: ∅ + │ │ │ └── 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" 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..104515ac3a --- /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)) + ├── flags: ∅ + ├── left: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── right: ∅ + └── operator_loc: (1,1)-(1,3) = ".." 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..ec7f57cd96 --- /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)) + ├── flags: exclude_end + ├── left: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── right: ∅ + └── operator_loc: (1,1)-(1,4) = "..." diff --git a/test/prism/snapshots/seattlerb/dstr_evstr.txt b/test/prism/snapshots/seattlerb/dstr_evstr.txt new file mode 100644 index 0000000000..add8ad6f5c --- /dev/null +++ b/test/prism/snapshots/seattlerb/dstr_evstr.txt @@ -0,0 +1,38 @@ +@ ProgramNode (location: (1,0)-(1,12)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,12)) + └── body: (length: 1) + └── @ InterpolatedStringNode (location: (1,0)-(1,12)) + ├── flags: ∅ + ├── 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: frozen + │ │ │ ├── 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)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (1,9)-(1,10) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── 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..53f97e4b36 --- /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)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :field + │ │ ├── message_loc: (1,4)-(1,9) = "field" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── 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..c4c0ef0437 --- /dev/null +++ b/test/prism/snapshots/seattlerb/dstr_lex_state.txt @@ -0,0 +1,35 @@ +@ ProgramNode (location: (1,0)-(1,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,8)) + └── body: (length: 1) + └── @ InterpolatedStringNode (location: (1,0)-(1,8)) + ├── flags: ∅ + ├── 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)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :p + │ │ ├── message_loc: (1,3)-(1,4) = "p" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (1,4)-(1,6)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ SymbolNode (location: (1,4)-(1,6)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: (1,4)-(1,5) = ":" + │ │ │ ├── value_loc: (1,5)-(1,6) = "a" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a" + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── 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..6fe0781880 --- /dev/null +++ b/test/prism/snapshots/seattlerb/dstr_str.txt @@ -0,0 +1,28 @@ +@ ProgramNode (location: (1,0)-(1,10)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,10)) + └── body: (length: 1) + └── @ InterpolatedStringNode (location: (1,0)-(1,10)) + ├── flags: mutable + ├── 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: frozen + │ │ │ ├── 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: frozen + │ ├── 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..7b1b68131e --- /dev/null +++ b/test/prism/snapshots/seattlerb/dsym_esc_to_sym.txt @@ -0,0 +1,11 @@ +@ ProgramNode (location: (1,0)-(1,17)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,17)) + └── body: (length: 1) + └── @ SymbolNode (location: (1,0)-(1,17)) + ├── flags: forced_utf8_encoding + ├── 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..eb7e435c63 --- /dev/null +++ b/test/prism/snapshots/seattlerb/dsym_to_sym.txt @@ -0,0 +1,37 @@ +@ 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)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (3,6)-(3,7) = ":" + │ ├── value_loc: (3,7)-(3,9) = "<<" + │ ├── closing_loc: ∅ + │ └── unescaped: "<<" + ├── old_name: + │ @ SymbolNode (location: (3,10)-(3,13)) + │ ├── flags: forced_us_ascii_encoding + │ ├── 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..a5fc3951d6 --- /dev/null +++ b/test/prism/snapshots/seattlerb/eq_begin_line_numbers.txt @@ -0,0 +1,11 @@ +@ 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 + │ └── value: 1 + └── @ IntegerNode (location: (6,0)-(6,1)) + ├── flags: decimal + └── value: 2 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..2103bde8cb --- /dev/null +++ b/test/prism/snapshots/seattlerb/eq_begin_why_wont_people_use_their_spacebar.txt @@ -0,0 +1,50 @@ +@ ProgramNode (location: (1,0)-(3,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,8)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(3,8)) + ├── flags: attribute_write + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :h + │ ├── message_loc: (1,0)-(1,1) = "h" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: ∅ + ├── name: :[]= + ├── message_loc: (1,1)-(1,4) = "[k]" + ├── opening_loc: (1,1)-(1,2) = "[" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(3,8)) + │ ├── flags: ∅ + │ └── arguments: (length: 2) + │ ├── @ CallNode (location: (1,2)-(1,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :k + │ │ ├── message_loc: (1,2)-(1,3) = "k" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── @ 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 + │ │ └── value: 42 + │ ├── rescue_clause: ∅ + │ ├── else_clause: ∅ + │ ├── ensure_clause: ∅ + │ └── end_keyword_loc: (3,5)-(3,8) = "end" + ├── closing_loc: (1,3)-(1,4) = "]" + └── block: ∅ diff --git a/test/prism/snapshots/seattlerb/evstr_evstr.txt b/test/prism/snapshots/seattlerb/evstr_evstr.txt new file mode 100644 index 0000000000..9c801299f8 --- /dev/null +++ b/test/prism/snapshots/seattlerb/evstr_evstr.txt @@ -0,0 +1,42 @@ +@ ProgramNode (location: (1,0)-(1,10)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,10)) + └── body: (length: 1) + └── @ InterpolatedStringNode (location: (1,0)-(1,10)) + ├── flags: ∅ + ├── 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)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :a + │ │ │ ├── message_loc: (1,3)-(1,4) = "a" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── 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)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (1,7)-(1,8) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── 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..54319e613c --- /dev/null +++ b/test/prism/snapshots/seattlerb/evstr_str.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)) + ├── flags: ∅ + ├── 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)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :a + │ │ │ ├── message_loc: (1,3)-(1,4) = "a" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── closing_loc: (1,4)-(1,5) = "}" + │ └── @ StringNode (location: (1,5)-(1,7)) + │ ├── flags: frozen + │ ├── 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..0a289ab7be --- /dev/null +++ b/test/prism/snapshots/seattlerb/expr_not_bang.txt @@ -0,0 +1,38 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,5)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,2)-(1,5)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,2)-(1,3) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,4)-(1,5)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (1,4)-(1,5)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (1,4)-(1,5) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: ∅ + ├── name: :! + ├── message_loc: (1,0)-(1,1) = "!" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/prism/snapshots/seattlerb/f_kw.txt b/test/prism/snapshots/seattlerb/f_kw.txt new file mode 100644 index 0000000000..4226137925 --- /dev/null +++ b/test/prism/snapshots/seattlerb/f_kw.txt @@ -0,0 +1,34 @@ +@ 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) + │ │ └── @ OptionalKeywordParameterNode (location: (1,6)-(1,10)) + │ │ ├── flags: ∅ + │ │ ├── name: :k + │ │ ├── name_loc: (1,6)-(1,8) = "k:" + │ │ └── value: + │ │ @ IntegerNode (location: (1,8)-(1,10)) + │ │ ├── flags: decimal + │ │ └── value: 42 + │ ├── 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..f72f43e034 --- /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) + │ │ └── @ RequiredKeywordParameterNode (location: (1,6)-(1,8)) + │ │ ├── flags: ∅ + │ │ ├── name: :k + │ │ └── name_loc: (1,6)-(1,8) = "k:" + │ ├── 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..5a71ab6cda --- /dev/null +++ b/test/prism/snapshots/seattlerb/flip2_env_lvar.txt @@ -0,0 +1,37 @@ +@ 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)) + │ ├── flags: ∅ + │ ├── left: + │ │ @ CallNode (location: (1,3)-(1,4)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (1,3)-(1,4) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── right: + │ │ @ CallNode (location: (1,6)-(1,7)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (1,6)-(1,7) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── operator_loc: (1,4)-(1,6) = ".." + ├── then_keyword_loc: (1,8)-(1,12) = "then" + ├── 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..9c1da70f24 --- /dev/null +++ b/test/prism/snapshots/seattlerb/float_with_if_modifier.txt @@ -0,0 +1,17 @@ +@ 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)) + ├── then_keyword_loc: ∅ + ├── statements: + │ @ StatementsNode (location: (1,0)-(1,3)) + │ └── body: (length: 1) + │ └── @ FloatNode (location: (1,0)-(1,3)) + │ └── value: 1.0 + ├── 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..353e4c6964 --- /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)-(4,0) = "before\\\r\nafter\r\n" + │ ├── closing_loc: (4,0)-(5,0) = "XXX\r\n" + │ └── unescaped: "beforeafter\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..fc4c1784fe --- /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)-(3,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)-(8,0) = " why would someone do this? \\\n blah\n" + ├── closing_loc: (8,0)-(9,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..2b1d776404 --- /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: forced_utf8_encoding + │ ├── opening_loc: (1,4)-(1,9) = "<<eos" + │ ├── content_loc: (2,0)-(3,0) = "a\\xE9b\n" + │ ├── closing_loc: (3,0)-(4,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..7a01f8d6d1 --- /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: forced_utf8_encoding + │ ├── opening_loc: (1,4)-(1,10) = "<<-EOS" + │ ├── content_loc: (2,0)-(4,0) = "a\\247b\ncöd\n" + │ ├── closing_loc: (4,0)-(5,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..888ebc809a --- /dev/null +++ b/test/prism/snapshots/seattlerb/heredoc_comma_arg.txt @@ -0,0 +1,27 @@ +@ ProgramNode (location: (1,0)-(7,1)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(7,1)) + └── body: (length: 2) + ├── @ ArrayNode (location: (1,0)-(2,3)) + │ ├── flags: ∅ + │ ├── elements: (length: 1) + │ │ └── @ StringNode (location: (1,1)-(2,1)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (1,1)-(1,2) = "\"" + │ │ ├── content_loc: (1,2)-(2,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)) + ├── flags: ∅ + ├── elements: (length: 1) + │ └── @ StringNode (location: (4,1)-(4,8)) + │ ├── flags: ∅ + │ ├── opening_loc: (4,1)-(4,8) = "<<-FILE" + │ ├── content_loc: (5,0)-(6,0) = " some text\n" + │ ├── closing_loc: (6,0)-(7,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..a51ce71afe --- /dev/null +++ b/test/prism/snapshots/seattlerb/heredoc_lineno.txt @@ -0,0 +1,26 @@ +@ 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)-(5,0) = "line2\nline3\nline4\n" + │ │ ├── closing_loc: (5,0)-(6,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 + │ └── value: 42 + └── 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..a2322b9632 --- /dev/null +++ b/test/prism/snapshots/seattlerb/heredoc_nested.txt @@ -0,0 +1,42 @@ +@ ProgramNode (location: (1,0)-(7,2)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(7,2)) + └── body: (length: 1) + └── @ ArrayNode (location: (1,0)-(7,2)) + ├── flags: ∅ + ├── elements: (length: 2) + │ ├── @ InterpolatedStringNode (location: (1,1)-(1,4)) + │ │ ├── flags: mutable + │ │ ├── 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: frozen + │ │ │ │ │ ├── opening_loc: (2,2)-(2,5) = "<<B" + │ │ │ │ │ ├── content_loc: (3,0)-(4,0) = "b\n" + │ │ │ │ │ ├── closing_loc: (4,0)-(5,0) = "B\n" + │ │ │ │ │ └── unescaped: "b\n" + │ │ │ │ └── closing_loc: (2,5)-(2,6) = "}" + │ │ │ ├── @ StringNode (location: (2,6)-(3,0)) + │ │ │ │ ├── flags: frozen + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── content_loc: (2,6)-(3,0) = "\n" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "\n" + │ │ │ └── @ StringNode (location: (5,0)-(6,0)) + │ │ │ ├── flags: frozen + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (5,0)-(6,0) = "a\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a\n" + │ │ └── closing_loc: (6,0)-(7,0) = "A\n" + │ └── @ IntegerNode (location: (7,0)-(7,1)) + │ ├── flags: decimal + │ └── value: 0 + ├── 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..9bab044ace --- /dev/null +++ b/test/prism/snapshots/seattlerb/heredoc_squiggly.txt @@ -0,0 +1,34 @@ +@ 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: + │ @ InterpolatedStringNode (location: (1,4)-(1,12)) + │ ├── flags: ∅ + │ ├── opening_loc: (1,4)-(1,12) = "<<~\"EOF\"" + │ ├── parts: (length: 3) + │ │ ├── @ StringNode (location: (2,0)-(3,0)) + │ │ │ ├── flags: frozen + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (2,0)-(3,0) = " x\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "x\n" + │ │ ├── @ StringNode (location: (3,0)-(4,0)) + │ │ │ ├── flags: frozen + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (3,0)-(4,0) = " y\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "y\n" + │ │ └── @ StringNode (location: (4,0)-(5,0)) + │ │ ├── flags: frozen + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (4,0)-(5,0) = " z\n" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "z\n" + │ └── closing_loc: (5,0)-(6,0) = " EOF\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..e12014afa5 --- /dev/null +++ b/test/prism/snapshots/seattlerb/heredoc_squiggly_blank_line_plus_interpolation.txt @@ -0,0 +1,67 @@ +@ 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)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (1,4)-(1,7) = "foo" + │ ├── opening_loc: (1,7)-(1,8) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,8)-(1,19)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (1,8)-(1,19)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ InterpolatedStringNode (location: (1,8)-(1,14)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (1,8)-(1,14) = "<<~EOF" + │ │ │ ├── parts: (length: 3) + │ │ │ │ ├── @ StringNode (location: (2,0)-(3,0)) + │ │ │ │ │ ├── flags: frozen + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── content_loc: (2,0)-(3,0) = "\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)) + │ │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ │ ├── name: :bar + │ │ │ │ │ │ ├── message_loc: (3,6)-(3,9) = "bar" + │ │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ │ └── block: ∅ + │ │ │ │ │ └── closing_loc: (3,9)-(3,10) = "}" + │ │ │ │ └── @ StringNode (location: (3,10)-(4,0)) + │ │ │ │ ├── flags: frozen + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── content_loc: (3,10)-(4,0) = "baz\n" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "baz\n" + │ │ │ └── closing_loc: (4,0)-(5,0) = " EOF\n" + │ │ ├── call_operator_loc: (1,14)-(1,15) = "." + │ │ ├── name: :chop + │ │ ├── message_loc: (1,15)-(1,19) = "chop" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (1,19)-(1,20) = ")" + │ └── block: ∅ + └── 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..8596647e72 --- /dev/null +++ b/test/prism/snapshots/seattlerb/heredoc_squiggly_blank_lines.txt @@ -0,0 +1,34 @@ +@ 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)) + │ ├── flags: ∅ + │ ├── opening_loc: (1,4)-(1,10) = "<<~EOF" + │ ├── parts: (length: 3) + │ │ ├── @ StringNode (location: (2,0)-(3,0)) + │ │ │ ├── flags: frozen + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (2,0)-(3,0) = " x\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "x\n" + │ │ ├── @ StringNode (location: (3,0)-(4,0)) + │ │ │ ├── flags: frozen + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (3,0)-(4,0) = "\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "\n" + │ │ └── @ StringNode (location: (4,0)-(5,0)) + │ │ ├── flags: frozen + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (4,0)-(5,0) = " z\n" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "z\n" + │ └── closing_loc: (5,0)-(6,0) = "EOF\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..c998f19984 --- /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)-(2,0) = "" + ├── closing_loc: (2,0)-(3,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..d34f89ff9c --- /dev/null +++ b/test/prism/snapshots/seattlerb/heredoc_squiggly_interp.txt @@ -0,0 +1,49 @@ +@ 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)) + │ ├── flags: ∅ + │ ├── opening_loc: (1,4)-(1,10) = "<<~EOF" + │ ├── parts: (length: 5) + │ │ ├── @ StringNode (location: (2,0)-(3,0)) + │ │ │ ├── flags: frozen + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (2,0)-(3,0) = " w\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: " w\n" + │ │ ├── @ StringNode (location: (3,0)-(3,3)) + │ │ │ ├── flags: frozen + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (3,0)-(3,3) = " x" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "x" + │ │ ├── @ 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 + │ │ │ │ └── value: 42 + │ │ │ └── closing_loc: (3,7)-(3,8) = "}" + │ │ ├── @ StringNode (location: (3,8)-(4,0)) + │ │ │ ├── flags: frozen + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (3,8)-(4,0) = " y\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: " y\n" + │ │ └── @ StringNode (location: (4,0)-(5,0)) + │ │ ├── flags: frozen + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (4,0)-(5,0) = " z\n" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: " z\n" + │ └── closing_loc: (5,0)-(6,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..7c17bc4820 --- /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)-(3,0) = "a\n" + ├── closing_loc: (3,0)-(4,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..311d7bc1b7 --- /dev/null +++ b/test/prism/snapshots/seattlerb/heredoc_squiggly_tabs.txt @@ -0,0 +1,28 @@ +@ 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: + │ @ InterpolatedStringNode (location: (1,4)-(1,12)) + │ ├── flags: ∅ + │ ├── opening_loc: (1,4)-(1,12) = "<<~\"EOF\"" + │ ├── parts: (length: 2) + │ │ ├── @ StringNode (location: (2,0)-(3,0)) + │ │ │ ├── flags: frozen + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (2,0)-(3,0) = " blah blah\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "blah blah\n" + │ │ └── @ StringNode (location: (3,0)-(4,0)) + │ │ ├── flags: frozen + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (3,0)-(4,0) = "\t blah blah\n" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: " blah blah\n" + │ └── closing_loc: (4,0)-(5,0) = " EOF\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..3150f807a2 --- /dev/null +++ b/test/prism/snapshots/seattlerb/heredoc_squiggly_tabs_extra.txt @@ -0,0 +1,28 @@ +@ 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: + │ @ InterpolatedStringNode (location: (1,4)-(1,12)) + │ ├── flags: ∅ + │ ├── opening_loc: (1,4)-(1,12) = "<<~\"EOF\"" + │ ├── parts: (length: 2) + │ │ ├── @ StringNode (location: (2,0)-(3,0)) + │ │ │ ├── flags: frozen + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (2,0)-(3,0) = " blah blah\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "blah blah\n" + │ │ └── @ StringNode (location: (3,0)-(4,0)) + │ │ ├── flags: frozen + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (3,0)-(4,0) = " \tblah blah\n" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "\tblah blah\n" + │ └── closing_loc: (4,0)-(5,0) = " EOF\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..85c3d2df6d --- /dev/null +++ b/test/prism/snapshots/seattlerb/heredoc_squiggly_visually_blank_lines.txt @@ -0,0 +1,34 @@ +@ 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)) + │ ├── flags: ∅ + │ ├── opening_loc: (1,4)-(1,10) = "<<~EOF" + │ ├── parts: (length: 3) + │ │ ├── @ StringNode (location: (2,0)-(3,0)) + │ │ │ ├── flags: frozen + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (2,0)-(3,0) = " x\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "x\n" + │ │ ├── @ StringNode (location: (3,0)-(4,0)) + │ │ │ ├── flags: frozen + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (3,0)-(4,0) = " \n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "\n" + │ │ └── @ StringNode (location: (4,0)-(5,0)) + │ │ ├── flags: frozen + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (4,0)-(5,0) = " z\n" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "z\n" + │ └── closing_loc: (5,0)-(6,0) = "EOF\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..bc05047b40 --- /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)) + ├── flags: ∅ + ├── receiver: + │ @ StringNode (location: (1,0)-(1,5)) + │ ├── flags: ∅ + │ ├── opening_loc: (1,0)-(1,5) = "<<END" + │ ├── content_loc: (2,0)-(3,0) = "blah\n" + │ ├── closing_loc: (3,0)-(4,0) = "END\n" + │ └── unescaped: "blah\n" + ├── call_operator_loc: (4,0)-(4,1) = "." + ├── name: :strip + ├── message_loc: (4,1)-(4,6) = "strip" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/prism/snapshots/seattlerb/heredoc_unicode.txt b/test/prism/snapshots/seattlerb/heredoc_unicode.txt new file mode 100644 index 0000000000..2c72854324 --- /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)-(3,0) = ".\n" + ├── closing_loc: (3,0)-(4,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..43bb8d5ea8 --- /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)-(4,0) = "foo\\rbar\nbaz\\r\n" + ├── closing_loc: (4,0)-(5,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..2ef6763389 --- /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)-(4,0) = "foo\\rbar\r\nbaz\\r\r\n" + ├── closing_loc: (4,0)-(5,0) = "EOS\r\n" + └── unescaped: "foo\rbar\nbaz\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..fbee030100 --- /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)-(3,0) = "body\r\n" + ├── closing_loc: (3,0)-(4,0) = "eot\n" + └── unescaped: "body\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..b59203bc4e --- /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)-(4,0) = "foo\rbar\r\nbaz\n" + ├── closing_loc: (4,0)-(5,0) = "EOS\n" + └── unescaped: "foo\rbar\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..36bc4c6560 --- /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)-(4,0) = "foo\rbar\r\r\nbaz\r\n" + ├── closing_loc: (4,0)-(5,0) = "EOS\r\n" + └── unescaped: "foo\rbar\r\nbaz\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..c4be1244dc --- /dev/null +++ b/test/prism/snapshots/seattlerb/heredoc_with_interpolation_and_carriage_return_escapes.txt @@ -0,0 +1,27 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ InterpolatedStringNode (location: (1,0)-(1,5)) + ├── flags: ∅ + ├── opening_loc: (1,0)-(1,5) = "<<EOS" + ├── parts: (length: 3) + │ ├── @ StringNode (location: (2,0)-(2,5)) + │ │ ├── flags: frozen + │ │ ├── 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)-(3,0)) + │ ├── flags: frozen + │ ├── opening_loc: ∅ + │ ├── content_loc: (2,10)-(3,0) = "\n" + │ ├── closing_loc: ∅ + │ └── unescaped: "\n" + └── closing_loc: (3,0)-(4,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..c2290cec13 --- /dev/null +++ b/test/prism/snapshots/seattlerb/heredoc_with_interpolation_and_carriage_return_escapes_windows.txt @@ -0,0 +1,27 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ InterpolatedStringNode (location: (1,0)-(1,5)) + ├── flags: ∅ + ├── opening_loc: (1,0)-(1,5) = "<<EOS" + ├── parts: (length: 3) + │ ├── @ StringNode (location: (2,0)-(2,5)) + │ │ ├── flags: frozen + │ │ ├── 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)-(3,0)) + │ ├── flags: frozen + │ ├── opening_loc: ∅ + │ ├── content_loc: (2,10)-(3,0) = "\r\n" + │ ├── closing_loc: ∅ + │ └── unescaped: "\n" + └── closing_loc: (3,0)-(4,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..6e1648f659 --- /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)-(3,0) = "\#${\n" + ├── closing_loc: (3,0)-(4,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..6a535c6472 --- /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)-(5,0) = "\r\n\r\r\n\\r\n" + ├── closing_loc: (5,0)-(6,0) = "EOS\n" + └── unescaped: "\n\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..6539846ff1 --- /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)-(5,0) = "\r\r\n\r\r\r\n\\r\r\n" + ├── closing_loc: (5,0)-(6,0) = "EOS\r\n" + └── unescaped: "\r\n\r\r\n\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..034850158c --- /dev/null +++ b/test/prism/snapshots/seattlerb/if_elsif.txt @@ -0,0 +1,25 @@ +@ 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 + │ └── value: 1 + ├── then_keyword_loc: ∅ + ├── 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 + │ │ └── value: 2 + │ ├── then_keyword_loc: ∅ + │ ├── 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..85ec52b4c8 --- /dev/null +++ b/test/prism/snapshots/seattlerb/if_symbol.txt @@ -0,0 +1,31 @@ +@ 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)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :f + │ ├── message_loc: (1,3)-(1,4) = "f" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,5)-(1,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ SymbolNode (location: (1,5)-(1,7)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: (1,5)-(1,6) = ":" + │ │ ├── value_loc: (1,6)-(1,7) = "x" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "x" + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── then_keyword_loc: ∅ + ├── 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..9771e9c2bd --- /dev/null +++ b/test/prism/snapshots/seattlerb/index_0.txt @@ -0,0 +1,38 @@ +@ ProgramNode (location: (1,0)-(1,7)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,7)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,7)) + ├── flags: attribute_write + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: ∅ + ├── name: :[]= + ├── message_loc: (1,1)-(1,3) = "[]" + ├── opening_loc: (1,1)-(1,2) = "[" + ├── arguments: + │ @ ArgumentsNode (location: (1,6)-(1,7)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (1,6)-(1,7)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :b + │ ├── message_loc: (1,6)-(1,7) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── closing_loc: (1,2)-(1,3) = "]" + └── block: ∅ 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..322eae9907 --- /dev/null +++ b/test/prism/snapshots/seattlerb/index_0_opasgn.txt @@ -0,0 +1,36 @@ +@ ProgramNode (location: (1,0)-(1,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,8)) + └── body: (length: 1) + └── @ IndexOperatorWriteNode (location: (1,0)-(1,8)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: ∅ + ├── opening_loc: (1,1)-(1,2) = "[" + ├── arguments: ∅ + ├── closing_loc: (1,2)-(1,3) = "]" + ├── block: ∅ + ├── binary_operator: :+ + ├── binary_operator_loc: (1,4)-(1,6) = "+=" + └── value: + @ CallNode (location: (1,7)-(1,8)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :b + ├── message_loc: (1,7)-(1,8) = "b" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ 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..2108c1f0a0 --- /dev/null +++ b/test/prism/snapshots/seattlerb/integer_with_if_modifier.txt @@ -0,0 +1,18 @@ +@ 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)) + ├── then_keyword_loc: ∅ + ├── statements: + │ @ StatementsNode (location: (1,0)-(1,5)) + │ └── body: (length: 1) + │ └── @ IntegerNode (location: (1,0)-(1,5)) + │ ├── flags: decimal + │ └── value: 1234 + ├── 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..ab231cf539 --- /dev/null +++ b/test/prism/snapshots/seattlerb/interpolated_symbol_array_line_breaks.txt @@ -0,0 +1,25 @@ +@ ProgramNode (location: (1,0)-(5,1)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(5,1)) + └── body: (length: 2) + ├── @ ArrayNode (location: (1,0)-(4,1)) + │ ├── flags: ∅ + │ ├── elements: (length: 2) + │ │ ├── @ SymbolNode (location: (2,0)-(2,1)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (2,0)-(2,1) = "a" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a" + │ │ └── @ SymbolNode (location: (3,0)-(3,1)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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 + └── value: 1 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..933e5de627 --- /dev/null +++ b/test/prism/snapshots/seattlerb/interpolated_word_array_line_breaks.txt @@ -0,0 +1,25 @@ +@ ProgramNode (location: (1,0)-(5,1)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(5,1)) + └── body: (length: 2) + ├── @ ArrayNode (location: (1,0)-(4,1)) + │ ├── flags: ∅ + │ ├── 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 + └── value: 1 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..f76bbfc559 --- /dev/null +++ b/test/prism/snapshots/seattlerb/iter_args_1.txt @@ -0,0 +1,40 @@ +@ ProgramNode (location: (1,0)-(1,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,11)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,11)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── 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)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ └── @ RequiredParameterNode (location: (1,7)-(1,8)) + │ │ │ ├── flags: ∅ + │ │ │ └── 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) = "}" 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..b8aaae800a --- /dev/null +++ b/test/prism/snapshots/seattlerb/iter_args_10_1.txt @@ -0,0 +1,51 @@ +@ ProgramNode (location: (1,0)-(1,21)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,21)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,21)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── 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)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :a + │ │ ├── optionals: (length: 1) + │ │ │ └── @ OptionalParameterNode (location: (1,8)-(1,14)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :b + │ │ │ ├── name_loc: (1,8)-(1,9) = "b" + │ │ │ ├── operator_loc: (1,10)-(1,11) = "=" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (1,12)-(1,14)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 42 + │ │ ├── rest: + │ │ │ @ RestParameterNode (location: (1,16)-(1,18)) + │ │ │ ├── flags: ∅ + │ │ │ ├── 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) = "}" 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..833f6429dc --- /dev/null +++ b/test/prism/snapshots/seattlerb/iter_args_10_2.txt @@ -0,0 +1,56 @@ +@ ProgramNode (location: (1,0)-(1,25)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,25)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,25)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── 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)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :a + │ │ ├── optionals: (length: 1) + │ │ │ └── @ OptionalParameterNode (location: (1,8)-(1,14)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :b + │ │ │ ├── name_loc: (1,8)-(1,9) = "b" + │ │ │ ├── operator_loc: (1,10)-(1,11) = "=" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (1,12)-(1,14)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 42 + │ │ ├── rest: + │ │ │ @ RestParameterNode (location: (1,16)-(1,18)) + │ │ │ ├── flags: ∅ + │ │ │ ├── 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)) + │ │ ├── flags: ∅ + │ │ ├── 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) = "}" 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..e4d2f79474 --- /dev/null +++ b/test/prism/snapshots/seattlerb/iter_args_11_1.txt @@ -0,0 +1,54 @@ +@ ProgramNode (location: (1,0)-(1,24)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,24)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,24)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── 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)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :a + │ │ ├── optionals: (length: 1) + │ │ │ └── @ OptionalParameterNode (location: (1,8)-(1,14)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :b + │ │ │ ├── name_loc: (1,8)-(1,9) = "b" + │ │ │ ├── operator_loc: (1,10)-(1,11) = "=" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (1,12)-(1,14)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 42 + │ │ ├── rest: + │ │ │ @ RestParameterNode (location: (1,16)-(1,18)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :c + │ │ │ ├── name_loc: (1,17)-(1,18) = "c" + │ │ │ └── operator_loc: (1,16)-(1,17) = "*" + │ │ ├── posts: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,20)-(1,21)) + │ │ │ ├── flags: ∅ + │ │ │ └── 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) = "}" 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..07a0e5ed9d --- /dev/null +++ b/test/prism/snapshots/seattlerb/iter_args_11_2.txt @@ -0,0 +1,59 @@ +@ ProgramNode (location: (1,0)-(1,28)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,28)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,28)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── 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)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :a + │ │ ├── optionals: (length: 1) + │ │ │ └── @ OptionalParameterNode (location: (1,8)-(1,14)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :b + │ │ │ ├── name_loc: (1,8)-(1,9) = "b" + │ │ │ ├── operator_loc: (1,10)-(1,11) = "=" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (1,12)-(1,14)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 42 + │ │ ├── rest: + │ │ │ @ RestParameterNode (location: (1,16)-(1,18)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :c + │ │ │ ├── name_loc: (1,17)-(1,18) = "c" + │ │ │ └── operator_loc: (1,16)-(1,17) = "*" + │ │ ├── posts: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,20)-(1,21)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :d + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: + │ │ @ BlockParameterNode (location: (1,23)-(1,25)) + │ │ ├── flags: ∅ + │ │ ├── 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) = "}" 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..a905286f47 --- /dev/null +++ b/test/prism/snapshots/seattlerb/iter_args_2__19.txt @@ -0,0 +1,46 @@ +@ ProgramNode (location: (1,0)-(1,14)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,14)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,14)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── 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) + │ │ │ └── @ MultiTargetNode (location: (1,5)-(1,11)) + │ │ │ ├── lefts: (length: 2) + │ │ │ │ ├── @ RequiredParameterNode (location: (1,6)-(1,7)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── name: :a + │ │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :b + │ │ │ ├── rest: ∅ + │ │ │ ├── rights: (length: 0) + │ │ │ ├── lparen_loc: (1,5)-(1,6) = "(" + │ │ │ └── rparen_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) = "}" 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..66782f0793 --- /dev/null +++ b/test/prism/snapshots/seattlerb/iter_args_3.txt @@ -0,0 +1,52 @@ +@ ProgramNode (location: (1,0)-(1,20)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,20)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,20)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── 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)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :a + │ │ │ ├── @ MultiTargetNode (location: (1,8)-(1,14)) + │ │ │ │ ├── lefts: (length: 2) + │ │ │ │ │ ├── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ │ └── name: :b + │ │ │ │ │ └── @ RequiredParameterNode (location: (1,12)-(1,13)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── name: :c + │ │ │ │ ├── rest: ∅ + │ │ │ │ ├── rights: (length: 0) + │ │ │ │ ├── lparen_loc: (1,8)-(1,9) = "(" + │ │ │ │ └── rparen_loc: (1,13)-(1,14) = ")" + │ │ │ └── @ RequiredParameterNode (location: (1,16)-(1,17)) + │ │ │ ├── flags: ∅ + │ │ │ └── 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) = "}" 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..c4f2b47a03 --- /dev/null +++ b/test/prism/snapshots/seattlerb/iter_args_4.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)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── 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)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :a + │ │ ├── optionals: (length: 0) + │ │ ├── rest: + │ │ │ @ RestParameterNode (location: (1,8)-(1,10)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :b + │ │ │ ├── name_loc: (1,9)-(1,10) = "b" + │ │ │ └── operator_loc: (1,8)-(1,9) = "*" + │ │ ├── posts: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,12)-(1,13)) + │ │ │ ├── flags: ∅ + │ │ │ └── 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) = "}" 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..44940629b4 --- /dev/null +++ b/test/prism/snapshots/seattlerb/iter_args_5.txt @@ -0,0 +1,42 @@ +@ ProgramNode (location: (1,0)-(1,13)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,13)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,13)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── 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)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :a + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: + │ │ @ BlockParameterNode (location: (1,8)-(1,10)) + │ │ ├── flags: ∅ + │ │ ├── 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) = "}" 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..df3a405dff --- /dev/null +++ b/test/prism/snapshots/seattlerb/iter_args_6.txt @@ -0,0 +1,49 @@ +@ ProgramNode (location: (1,0)-(1,18)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,18)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,18)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── 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)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :a + │ │ ├── optionals: (length: 1) + │ │ │ └── @ OptionalParameterNode (location: (1,8)-(1,12)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :b + │ │ │ ├── name_loc: (1,8)-(1,9) = "b" + │ │ │ ├── operator_loc: (1,9)-(1,10) = "=" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (1,10)-(1,12)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 42 + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,14)-(1,15)) + │ │ │ ├── flags: ∅ + │ │ │ └── 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) = "}" 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..3f65fb8dc0 --- /dev/null +++ b/test/prism/snapshots/seattlerb/iter_args_7_1.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)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── 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)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :a + │ │ │ ├── name_loc: (1,5)-(1,6) = "a" + │ │ │ ├── operator_loc: (1,7)-(1,8) = "=" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (1,9)-(1,11)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 42 + │ │ ├── rest: + │ │ │ @ RestParameterNode (location: (1,13)-(1,15)) + │ │ │ ├── flags: ∅ + │ │ │ ├── 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) = "}" 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..112a5a1b6b --- /dev/null +++ b/test/prism/snapshots/seattlerb/iter_args_7_2.txt @@ -0,0 +1,53 @@ +@ ProgramNode (location: (1,0)-(1,22)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,22)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,22)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── 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)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :a + │ │ │ ├── name_loc: (1,5)-(1,6) = "a" + │ │ │ ├── operator_loc: (1,7)-(1,8) = "=" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (1,9)-(1,11)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 42 + │ │ ├── rest: + │ │ │ @ RestParameterNode (location: (1,13)-(1,15)) + │ │ │ ├── flags: ∅ + │ │ │ ├── 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)) + │ │ ├── flags: ∅ + │ │ ├── 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) = "}" 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..5591fcfc69 --- /dev/null +++ b/test/prism/snapshots/seattlerb/iter_args_8_1.txt @@ -0,0 +1,51 @@ +@ ProgramNode (location: (1,0)-(1,21)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,21)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,21)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── 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)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :a + │ │ │ ├── name_loc: (1,5)-(1,6) = "a" + │ │ │ ├── operator_loc: (1,7)-(1,8) = "=" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (1,9)-(1,11)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 42 + │ │ ├── rest: + │ │ │ @ RestParameterNode (location: (1,13)-(1,15)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :b + │ │ │ ├── name_loc: (1,14)-(1,15) = "b" + │ │ │ └── operator_loc: (1,13)-(1,14) = "*" + │ │ ├── posts: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,17)-(1,18)) + │ │ │ ├── flags: ∅ + │ │ │ └── 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) = "}" 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..8cb061d5a7 --- /dev/null +++ b/test/prism/snapshots/seattlerb/iter_args_8_2.txt @@ -0,0 +1,56 @@ +@ ProgramNode (location: (1,0)-(1,25)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,25)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,25)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── 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)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :a + │ │ │ ├── name_loc: (1,5)-(1,6) = "a" + │ │ │ ├── operator_loc: (1,7)-(1,8) = "=" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (1,9)-(1,11)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 42 + │ │ ├── rest: + │ │ │ @ RestParameterNode (location: (1,13)-(1,15)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :b + │ │ │ ├── name_loc: (1,14)-(1,15) = "b" + │ │ │ └── operator_loc: (1,13)-(1,14) = "*" + │ │ ├── posts: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,17)-(1,18)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :c + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: + │ │ @ BlockParameterNode (location: (1,20)-(1,22)) + │ │ ├── flags: ∅ + │ │ ├── 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) = "}" 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..70b2a6cb19 --- /dev/null +++ b/test/prism/snapshots/seattlerb/iter_args_9_1.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)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── 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)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :a + │ │ │ ├── name_loc: (1,5)-(1,6) = "a" + │ │ │ ├── operator_loc: (1,7)-(1,8) = "=" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (1,9)-(1,11)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 42 + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,13)-(1,14)) + │ │ │ ├── flags: ∅ + │ │ │ └── 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) = "}" 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..cad8b47e7f --- /dev/null +++ b/test/prism/snapshots/seattlerb/iter_args_9_2.txt @@ -0,0 +1,51 @@ +@ ProgramNode (location: (1,0)-(1,21)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,21)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,21)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── 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)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :a + │ │ │ ├── name_loc: (1,5)-(1,6) = "a" + │ │ │ ├── operator_loc: (1,7)-(1,8) = "=" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (1,9)-(1,11)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 42 + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,13)-(1,14)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :b + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: + │ │ @ BlockParameterNode (location: (1,16)-(1,18)) + │ │ ├── flags: ∅ + │ │ ├── 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) = "}" diff --git a/test/prism/snapshots/seattlerb/iter_kwarg.txt b/test/prism/snapshots/seattlerb/iter_kwarg.txt new file mode 100644 index 0000000000..13b9027661 --- /dev/null +++ b/test/prism/snapshots/seattlerb/iter_kwarg.txt @@ -0,0 +1,42 @@ +@ ProgramNode (location: (1,0)-(1,12)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,12)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,12)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── 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) + │ │ │ └── @ OptionalKeywordParameterNode (location: (1,5)-(1,9)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :b + │ │ │ ├── name_loc: (1,5)-(1,7) = "b:" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (1,8)-(1,9)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── 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) = "}" 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..321e15cb2b --- /dev/null +++ b/test/prism/snapshots/seattlerb/iter_kwarg_kwsplat.txt @@ -0,0 +1,47 @@ +@ ProgramNode (location: (1,0)-(1,17)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,17)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,17)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── 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) + │ │ │ └── @ OptionalKeywordParameterNode (location: (1,5)-(1,9)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :b + │ │ │ ├── name_loc: (1,5)-(1,7) = "b:" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (1,8)-(1,9)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── keyword_rest: + │ │ │ @ KeywordRestParameterNode (location: (1,11)-(1,14)) + │ │ │ ├── flags: ∅ + │ │ │ ├── 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) = "}" 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..c8d7af8f48 --- /dev/null +++ b/test/prism/snapshots/seattlerb/label_vs_string.txt @@ -0,0 +1,34 @@ +@ ProgramNode (location: (1,0)-(2,1)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,1)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(2,1)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,0)-(1,4)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :_buf + │ ├── message_loc: (1,0)-(1,4) = "_buf" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: ∅ + ├── name: :<< + ├── message_loc: (1,5)-(1,7) = "<<" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,8)-(2,1)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ StringNode (location: (1,8)-(2,1)) + │ ├── flags: ∅ + │ ├── opening_loc: (1,8)-(1,9) = "'" + │ ├── content_loc: (1,9)-(2,0) = ":\n" + │ ├── closing_loc: (2,0)-(2,1) = "'" + │ └── unescaped: ":\n" + ├── closing_loc: ∅ + └── block: ∅ 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..afc0d3d56f --- /dev/null +++ b/test/prism/snapshots/seattlerb/lambda_do_vs_brace.txt @@ -0,0 +1,95 @@ +@ ProgramNode (location: (1,0)-(7,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(7,9)) + └── body: (length: 4) + ├── @ CallNode (location: (1,0)-(1,11)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :f + │ ├── message_loc: (1,0)-(1,1) = "f" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,2)-(1,11)) + │ │ ├── flags: ∅ + │ │ └── 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: ∅ + ├── @ CallNode (location: (3,0)-(3,7)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :f + │ ├── message_loc: (3,0)-(3,1) = "f" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (3,2)-(3,7)) + │ │ ├── flags: ∅ + │ │ └── 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: ∅ + ├── @ CallNode (location: (5,0)-(5,13)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :f + │ ├── message_loc: (5,0)-(5,1) = "f" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (5,2)-(5,13)) + │ │ ├── flags: ∅ + │ │ └── 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: ∅ + └── @ CallNode (location: (7,0)-(7,9)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── message_loc: (7,0)-(7,1) = "f" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (7,2)-(7,9)) + │ ├── flags: ∅ + │ └── 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: ∅ 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..7bbef7055a --- /dev/null +++ b/test/prism/snapshots/seattlerb/lasgn_arg_rescue_arg.txt @@ -0,0 +1,21 @@ +@ 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 + │ │ └── value: 1 + │ ├── keyword_loc: (1,6)-(1,12) = "rescue" + │ └── rescue_expression: + │ @ IntegerNode (location: (1,13)-(1,14)) + │ ├── flags: decimal + │ └── value: 2 + └── 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..521fceaf1b --- /dev/null +++ b/test/prism/snapshots/seattlerb/lasgn_call_bracket_rescue_arg.txt @@ -0,0 +1,34 @@ +@ 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)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (1,4)-(1,5) = "b" + │ │ ├── opening_loc: (1,5)-(1,6) = "(" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (1,6)-(1,7)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (1,6)-(1,7)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── closing_loc: (1,7)-(1,8) = ")" + │ │ └── block: ∅ + │ ├── keyword_loc: (1,9)-(1,15) = "rescue" + │ └── rescue_expression: + │ @ IntegerNode (location: (1,16)-(1,17)) + │ ├── flags: decimal + │ └── value: 2 + └── 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..d730fb51cb --- /dev/null +++ b/test/prism/snapshots/seattlerb/lasgn_call_nobracket_rescue_arg.txt @@ -0,0 +1,34 @@ +@ 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: + │ @ RescueModifierNode (location: (1,4)-(1,16)) + │ ├── expression: + │ │ @ CallNode (location: (1,4)-(1,7)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (1,4)-(1,5) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (1,6)-(1,7)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (1,6)-(1,7)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── keyword_loc: (1,8)-(1,14) = "rescue" + │ └── rescue_expression: + │ @ IntegerNode (location: (1,15)-(1,16)) + │ ├── flags: decimal + │ └── value: 2 + └── 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..d6ed787b26 --- /dev/null +++ b/test/prism/snapshots/seattlerb/lasgn_command.txt @@ -0,0 +1,37 @@ +@ 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)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (1,4)-(1,5)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (1,4)-(1,5) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (1,5)-(1,6) = "." + │ ├── name: :c + │ ├── message_loc: (1,6)-(1,7) = "c" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,8)-(1,9)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (1,8)-(1,9)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── 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..a0ada99a9b --- /dev/null +++ b/test/prism/snapshots/seattlerb/lasgn_env.txt @@ -0,0 +1,14 @@ +@ 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 + │ └── value: 42 + └── 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..5675730477 --- /dev/null +++ b/test/prism/snapshots/seattlerb/lasgn_ivar_env.txt @@ -0,0 +1,13 @@ +@ 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 + │ └── value: 42 + └── 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..bb4b64e88c --- /dev/null +++ b/test/prism/snapshots/seattlerb/lasgn_lasgn_command_call.txt @@ -0,0 +1,33 @@ +@ 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)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :c + │ │ ├── message_loc: (1,8)-(1,9) = "c" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (1,10)-(1,11)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (1,10)-(1,11)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── 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..c113fef13f --- /dev/null +++ b/test/prism/snapshots/seattlerb/lasgn_middle_splat.txt @@ -0,0 +1,49 @@ +@ 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)) + │ ├── flags: contains_splat + │ ├── elements: (length: 3) + │ │ ├── @ CallNode (location: (1,4)-(1,5)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (1,4)-(1,5) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── @ SplatNode (location: (1,7)-(1,9)) + │ │ │ ├── operator_loc: (1,7)-(1,8) = "*" + │ │ │ └── expression: + │ │ │ @ CallNode (location: (1,8)-(1,9)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :c + │ │ │ ├── message_loc: (1,8)-(1,9) = "c" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── @ CallNode (location: (1,11)-(1,12)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :d + │ │ ├── message_loc: (1,11)-(1,12) = "d" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── 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..9c4ca884d2 --- /dev/null +++ b/test/prism/snapshots/seattlerb/magic_encoding_comment.txt @@ -0,0 +1,46 @@ +@ 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)) + │ │ │ ├── flags: ∅ + │ │ │ ├── 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..9ebcab3095 --- /dev/null +++ b/test/prism/snapshots/seattlerb/masgn_anon_splat_arg.txt @@ -0,0 +1,29 @@ +@ ProgramNode (location: (1,0)-(1,8)) +├── locals: [:a] +└── statements: + @ StatementsNode (location: (1,0)-(1,8)) + └── body: (length: 1) + └── @ MultiWriteNode (location: (1,0)-(1,8)) + ├── lefts: (length: 0) + ├── rest: + │ @ SplatNode (location: (1,0)-(1,1)) + │ ├── operator_loc: (1,0)-(1,1) = "*" + │ └── expression: ∅ + ├── rights: (length: 1) + │ └── @ 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)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :b + ├── message_loc: (1,7)-(1,8) = "b" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ 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..83613c42d1 --- /dev/null +++ b/test/prism/snapshots/seattlerb/masgn_arg_colon_arg.txt @@ -0,0 +1,42 @@ +@ ProgramNode (location: (1,0)-(1,11)) +├── locals: [:a] +└── statements: + @ StatementsNode (location: (1,0)-(1,11)) + └── body: (length: 1) + └── @ MultiWriteNode (location: (1,0)-(1,11)) + ├── lefts: (length: 2) + │ ├── @ LocalVariableTargetNode (location: (1,0)-(1,1)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ └── @ CallTargetNode (location: (1,3)-(1,7)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (1,3)-(1,4)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (1,3)-(1,4) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (1,4)-(1,6) = "::" + │ ├── name: :c= + │ └── message_loc: (1,6)-(1,7) = "c" + ├── rest: ∅ + ├── rights: (length: 0) + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── operator_loc: (1,8)-(1,9) = "=" + └── value: + @ CallNode (location: (1,10)-(1,11)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :d + ├── message_loc: (1,10)-(1,11) = "d" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ 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..f4c99648f0 --- /dev/null +++ b/test/prism/snapshots/seattlerb/masgn_arg_ident.txt @@ -0,0 +1,42 @@ +@ ProgramNode (location: (1,0)-(1,10)) +├── locals: [:a] +└── statements: + @ StatementsNode (location: (1,0)-(1,10)) + └── body: (length: 1) + └── @ MultiWriteNode (location: (1,0)-(1,10)) + ├── lefts: (length: 2) + │ ├── @ LocalVariableTargetNode (location: (1,0)-(1,1)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ └── @ CallTargetNode (location: (1,3)-(1,6)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (1,3)-(1,4)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (1,3)-(1,4) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (1,4)-(1,5) = "." + │ ├── name: :C= + │ └── message_loc: (1,5)-(1,6) = "C" + ├── rest: ∅ + ├── rights: (length: 0) + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── operator_loc: (1,7)-(1,8) = "=" + └── value: + @ CallNode (location: (1,9)-(1,10)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :d + ├── message_loc: (1,9)-(1,10) = "d" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ 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..48e58de076 --- /dev/null +++ b/test/prism/snapshots/seattlerb/masgn_arg_splat_arg.txt @@ -0,0 +1,35 @@ +@ 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)) + ├── lefts: (length: 1) + │ └── @ LocalVariableTargetNode (location: (1,0)-(1,1)) + │ ├── name: :a + │ └── depth: 0 + ├── rest: + │ @ SplatNode (location: (1,3)-(1,5)) + │ ├── operator_loc: (1,3)-(1,4) = "*" + │ └── expression: + │ @ LocalVariableTargetNode (location: (1,4)-(1,5)) + │ ├── name: :b + │ └── depth: 0 + ├── rights: (length: 1) + │ └── @ 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)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :d + ├── message_loc: (1,11)-(1,12) = "d" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/prism/snapshots/seattlerb/masgn_colon2.txt b/test/prism/snapshots/seattlerb/masgn_colon2.txt new file mode 100644 index 0000000000..a0dfe72ffc --- /dev/null +++ b/test/prism/snapshots/seattlerb/masgn_colon2.txt @@ -0,0 +1,42 @@ +@ ProgramNode (location: (1,0)-(1,14)) +├── locals: [:a] +└── statements: + @ StatementsNode (location: (1,0)-(1,14)) + └── body: (length: 1) + └── @ MultiWriteNode (location: (1,0)-(1,14)) + ├── lefts: (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)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (1,3)-(1,4) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── name: :C + │ ├── delimiter_loc: (1,4)-(1,6) = "::" + │ └── name_loc: (1,6)-(1,7) = "C" + ├── rest: ∅ + ├── rights: (length: 0) + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── operator_loc: (1,8)-(1,9) = "=" + └── value: + @ ArrayNode (location: (1,10)-(1,14)) + ├── flags: ∅ + ├── elements: (length: 2) + │ ├── @ IntegerNode (location: (1,10)-(1,11)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── @ IntegerNode (location: (1,13)-(1,14)) + │ ├── flags: decimal + │ └── value: 2 + ├── 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..f28ed7ecee --- /dev/null +++ b/test/prism/snapshots/seattlerb/masgn_colon3.txt @@ -0,0 +1,34 @@ +@ ProgramNode (location: (1,0)-(1,15)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,15)) + └── body: (length: 1) + └── @ MultiWriteNode (location: (1,0)-(1,15)) + ├── lefts: (length: 2) + │ ├── @ ConstantPathTargetNode (location: (1,0)-(1,3)) + │ │ ├── parent: ∅ + │ │ ├── name: :A + │ │ ├── delimiter_loc: (1,0)-(1,2) = "::" + │ │ └── name_loc: (1,2)-(1,3) = "A" + │ └── @ ConstantPathTargetNode (location: (1,5)-(1,8)) + │ ├── parent: ∅ + │ ├── name: :B + │ ├── delimiter_loc: (1,5)-(1,7) = "::" + │ └── name_loc: (1,7)-(1,8) = "B" + ├── rest: ∅ + ├── rights: (length: 0) + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── operator_loc: (1,9)-(1,10) = "=" + └── value: + @ ArrayNode (location: (1,11)-(1,15)) + ├── flags: ∅ + ├── elements: (length: 2) + │ ├── @ IntegerNode (location: (1,11)-(1,12)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── @ IntegerNode (location: (1,14)-(1,15)) + │ ├── flags: decimal + │ └── value: 2 + ├── 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..687ea38243 --- /dev/null +++ b/test/prism/snapshots/seattlerb/masgn_command_call.txt @@ -0,0 +1,43 @@ +@ ProgramNode (location: (1,0)-(1,10)) +├── locals: [:a] +└── statements: + @ StatementsNode (location: (1,0)-(1,10)) + └── body: (length: 1) + └── @ MultiWriteNode (location: (1,0)-(1,10)) + ├── lefts: (length: 1) + │ └── @ LocalVariableTargetNode (location: (1,0)-(1,1)) + │ ├── name: :a + │ └── depth: 0 + ├── rest: + │ @ ImplicitRestNode (location: (1,1)-(1,2)) + ├── rights: (length: 0) + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── operator_loc: (1,3)-(1,4) = "=" + └── value: + @ CallNode (location: (1,5)-(1,10)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,5)-(1,6)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :b + │ ├── message_loc: (1,5)-(1,6) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (1,6)-(1,7) = "." + ├── name: :c + ├── message_loc: (1,7)-(1,8) = "c" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,9)-(1,10)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,9)-(1,10)) + │ ├── flags: decimal + │ └── value: 1 + ├── closing_loc: ∅ + └── block: ∅ 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..590df8fa07 --- /dev/null +++ b/test/prism/snapshots/seattlerb/masgn_double_paren.txt @@ -0,0 +1,35 @@ +@ 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)) + ├── lefts: (length: 1) + │ └── @ MultiTargetNode (location: (1,1)-(1,6)) + │ ├── lefts: (length: 2) + │ │ ├── @ LocalVariableTargetNode (location: (1,2)-(1,3)) + │ │ │ ├── name: :a + │ │ │ └── depth: 0 + │ │ └── @ LocalVariableTargetNode (location: (1,4)-(1,5)) + │ │ ├── name: :b + │ │ └── depth: 0 + │ ├── rest: ∅ + │ ├── rights: (length: 0) + │ ├── lparen_loc: (1,1)-(1,2) = "(" + │ └── rparen_loc: (1,5)-(1,6) = ")" + ├── rest: ∅ + ├── rights: (length: 0) + ├── 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)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :c + ├── message_loc: (1,8)-(1,9) = "c" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ 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..771dd7c040 --- /dev/null +++ b/test/prism/snapshots/seattlerb/masgn_lhs_splat.txt @@ -0,0 +1,33 @@ +@ ProgramNode (location: (1,0)-(1,12)) +├── locals: [:a] +└── statements: + @ StatementsNode (location: (1,0)-(1,12)) + └── body: (length: 1) + └── @ MultiWriteNode (location: (1,0)-(1,12)) + ├── lefts: (length: 0) + ├── rest: + │ @ SplatNode (location: (1,0)-(1,2)) + │ ├── operator_loc: (1,0)-(1,1) = "*" + │ └── expression: + │ @ LocalVariableTargetNode (location: (1,1)-(1,2)) + │ ├── name: :a + │ └── depth: 0 + ├── rights: (length: 0) + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── operator_loc: (1,3)-(1,4) = "=" + └── value: + @ ArrayNode (location: (1,5)-(1,12)) + ├── flags: ∅ + ├── elements: (length: 3) + │ ├── @ IntegerNode (location: (1,5)-(1,6)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── @ IntegerNode (location: (1,8)-(1,9)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ └── @ IntegerNode (location: (1,11)-(1,12)) + │ ├── flags: decimal + │ └── value: 3 + ├── 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..5d79774d5e --- /dev/null +++ b/test/prism/snapshots/seattlerb/masgn_paren.txt @@ -0,0 +1,39 @@ +@ 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)) + ├── lefts: (length: 2) + │ ├── @ LocalVariableTargetNode (location: (1,1)-(1,2)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ └── @ LocalVariableTargetNode (location: (1,4)-(1,5)) + │ ├── name: :b + │ └── depth: 0 + ├── rest: ∅ + ├── rights: (length: 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)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,9)-(1,10)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :c + │ ├── message_loc: (1,9)-(1,10) = "c" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (1,10)-(1,11) = "." + ├── name: :d + ├── message_loc: (1,11)-(1,12) = "d" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ 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..b8113b126f --- /dev/null +++ b/test/prism/snapshots/seattlerb/masgn_splat_arg.txt @@ -0,0 +1,32 @@ +@ 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)) + ├── lefts: (length: 0) + ├── rest: + │ @ SplatNode (location: (1,0)-(1,2)) + │ ├── operator_loc: (1,0)-(1,1) = "*" + │ └── expression: + │ @ LocalVariableTargetNode (location: (1,1)-(1,2)) + │ ├── name: :a + │ └── depth: 0 + ├── rights: (length: 1) + │ └── @ 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)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :c + ├── message_loc: (1,8)-(1,9) = "c" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ 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..a832aef1e0 --- /dev/null +++ b/test/prism/snapshots/seattlerb/masgn_splat_arg_arg.txt @@ -0,0 +1,35 @@ +@ 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)) + ├── lefts: (length: 0) + ├── rest: + │ @ SplatNode (location: (1,0)-(1,2)) + │ ├── operator_loc: (1,0)-(1,1) = "*" + │ └── expression: + │ @ LocalVariableTargetNode (location: (1,1)-(1,2)) + │ ├── name: :a + │ └── depth: 0 + ├── rights: (length: 2) + │ ├── @ 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)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :d + ├── message_loc: (1,11)-(1,12) = "d" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/prism/snapshots/seattlerb/masgn_star.txt b/test/prism/snapshots/seattlerb/masgn_star.txt new file mode 100644 index 0000000000..3e01eef8a7 --- /dev/null +++ b/test/prism/snapshots/seattlerb/masgn_star.txt @@ -0,0 +1,19 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ MultiWriteNode (location: (1,0)-(1,5)) + ├── lefts: (length: 0) + ├── rest: + │ @ SplatNode (location: (1,0)-(1,1)) + │ ├── operator_loc: (1,0)-(1,1) = "*" + │ └── expression: ∅ + ├── rights: (length: 0) + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── operator_loc: (1,2)-(1,3) = "=" + └── value: + @ IntegerNode (location: (1,4)-(1,5)) + ├── flags: decimal + └── value: 1 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..37851efd6f --- /dev/null +++ b/test/prism/snapshots/seattlerb/masgn_var_star_var.txt @@ -0,0 +1,32 @@ +@ 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)) + ├── lefts: (length: 1) + │ └── @ LocalVariableTargetNode (location: (1,0)-(1,1)) + │ ├── name: :a + │ └── depth: 0 + ├── rest: + │ @ SplatNode (location: (1,3)-(1,4)) + │ ├── operator_loc: (1,3)-(1,4) = "*" + │ └── expression: ∅ + ├── rights: (length: 1) + │ └── @ 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)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :c + ├── message_loc: (1,10)-(1,11) = "c" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ 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..edef23044a --- /dev/null +++ b/test/prism/snapshots/seattlerb/messy_op_asgn_lineno.txt @@ -0,0 +1,59 @@ +@ ProgramNode (location: (1,0)-(1,15)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,15)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,15)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,15)) + │ ├── flags: ∅ + │ └── 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 + │ │ │ ├── name: :C + │ │ │ ├── delimiter_loc: (1,4)-(1,6) = "::" + │ │ │ └── name_loc: (1,6)-(1,7) = "C" + │ │ ├── binary_operator_loc: (1,8)-(1,10) = "*=" + │ │ ├── value: + │ │ │ @ CallNode (location: (1,11)-(1,14)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :d + │ │ │ ├── message_loc: (1,11)-(1,12) = "d" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (1,13)-(1,14)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ CallNode (location: (1,13)-(1,14)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :e + │ │ │ │ ├── message_loc: (1,13)-(1,14) = "e" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── binary_operator: :* + │ ├── opening_loc: (1,2)-(1,3) = "(" + │ └── closing_loc: (1,14)-(1,15) = ")" + ├── closing_loc: ∅ + └── block: ∅ 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..1bb8bd0bc1 --- /dev/null +++ b/test/prism/snapshots/seattlerb/method_call_assoc_trailing_comma.txt @@ -0,0 +1,41 @@ +@ ProgramNode (location: (1,0)-(1,10)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,10)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,10)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (1,1)-(1,2) = "." + ├── name: :f + ├── message_loc: (1,2)-(1,3) = "f" + ├── opening_loc: (1,3)-(1,4) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,4)-(1,8)) + │ ├── flags: contains_keywords + │ └── arguments: (length: 1) + │ └── @ KeywordHashNode (location: (1,4)-(1,8)) + │ ├── flags: ∅ + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (1,4)-(1,8)) + │ ├── key: + │ │ @ IntegerNode (location: (1,4)-(1,5)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── value: + │ │ @ IntegerNode (location: (1,7)-(1,8)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ └── operator_loc: (1,5)-(1,7) = "=>" + ├── closing_loc: (1,9)-(1,10) = ")" + └── block: ∅ 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..edf79062cf --- /dev/null +++ b/test/prism/snapshots/seattlerb/method_call_trailing_comma.txt @@ -0,0 +1,31 @@ +@ ProgramNode (location: (1,0)-(1,7)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,7)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,7)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (1,1)-(1,2) = "." + ├── name: :f + ├── message_loc: (1,2)-(1,3) = "f" + ├── opening_loc: (1,3)-(1,4) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,4)-(1,5)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,4)-(1,5)) + │ ├── flags: decimal + │ └── value: 1 + ├── closing_loc: (1,6)-(1,7) = ")" + └── block: ∅ 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..600f7f717b --- /dev/null +++ b/test/prism/snapshots/seattlerb/mlhs_back_anonsplat.txt @@ -0,0 +1,35 @@ +@ 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)) + ├── lefts: (length: 3) + │ ├── @ 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 + ├── rest: + │ @ SplatNode (location: (1,9)-(1,10)) + │ ├── operator_loc: (1,9)-(1,10) = "*" + │ └── expression: ∅ + ├── rights: (length: 0) + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── operator_loc: (1,11)-(1,12) = "=" + └── value: + @ CallNode (location: (1,13)-(1,14)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── message_loc: (1,13)-(1,14) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ 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..f5d3fe5ae9 --- /dev/null +++ b/test/prism/snapshots/seattlerb/mlhs_back_splat.txt @@ -0,0 +1,38 @@ +@ 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)) + ├── lefts: (length: 3) + │ ├── @ 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 + ├── rest: + │ @ SplatNode (location: (1,9)-(1,11)) + │ ├── operator_loc: (1,9)-(1,10) = "*" + │ └── expression: + │ @ LocalVariableTargetNode (location: (1,10)-(1,11)) + │ ├── name: :s + │ └── depth: 0 + ├── rights: (length: 0) + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── operator_loc: (1,12)-(1,13) = "=" + └── value: + @ CallNode (location: (1,14)-(1,15)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── message_loc: (1,14)-(1,15) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ 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..d4797031a5 --- /dev/null +++ b/test/prism/snapshots/seattlerb/mlhs_front_anonsplat.txt @@ -0,0 +1,35 @@ +@ 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)) + ├── lefts: (length: 0) + ├── rest: + │ @ SplatNode (location: (1,0)-(1,1)) + │ ├── operator_loc: (1,0)-(1,1) = "*" + │ └── expression: ∅ + ├── rights: (length: 3) + │ ├── @ 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)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── message_loc: (1,13)-(1,14) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ 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..47a7b8da7c --- /dev/null +++ b/test/prism/snapshots/seattlerb/mlhs_front_splat.txt @@ -0,0 +1,38 @@ +@ 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)) + ├── lefts: (length: 0) + ├── rest: + │ @ SplatNode (location: (1,0)-(1,2)) + │ ├── operator_loc: (1,0)-(1,1) = "*" + │ └── expression: + │ @ LocalVariableTargetNode (location: (1,1)-(1,2)) + │ ├── name: :s + │ └── depth: 0 + ├── rights: (length: 3) + │ ├── @ 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)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── message_loc: (1,14)-(1,15) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/prism/snapshots/seattlerb/mlhs_keyword.txt b/test/prism/snapshots/seattlerb/mlhs_keyword.txt new file mode 100644 index 0000000000..6142640b2c --- /dev/null +++ b/test/prism/snapshots/seattlerb/mlhs_keyword.txt @@ -0,0 +1,30 @@ +@ ProgramNode (location: (1,0)-(1,16)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,16)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,16)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (1,1)-(1,2) = "." + ├── name: :!= + ├── message_loc: (1,2)-(1,4) = "!=" + ├── opening_loc: (1,4)-(1,5) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,5)-(1,15)) + │ ├── flags: ∅ + │ └── arguments: (length: 2) + │ ├── @ TrueNode (location: (1,5)-(1,9)) + │ └── @ TrueNode (location: (1,11)-(1,15)) + ├── closing_loc: (1,15)-(1,16) = ")" + └── block: ∅ 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..b6306e1674 --- /dev/null +++ b/test/prism/snapshots/seattlerb/mlhs_mid_anonsplat.txt @@ -0,0 +1,44 @@ +@ 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)) + ├── lefts: (length: 3) + │ ├── @ 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 + ├── rest: + │ @ SplatNode (location: (1,9)-(1,10)) + │ ├── operator_loc: (1,9)-(1,10) = "*" + │ └── expression: ∅ + ├── rights: (length: 3) + │ ├── @ 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)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── message_loc: (1,22)-(1,23) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ 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..1dae24d911 --- /dev/null +++ b/test/prism/snapshots/seattlerb/mlhs_mid_splat.txt @@ -0,0 +1,47 @@ +@ 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)) + ├── lefts: (length: 3) + │ ├── @ 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 + ├── rest: + │ @ SplatNode (location: (1,9)-(1,11)) + │ ├── operator_loc: (1,9)-(1,10) = "*" + │ └── expression: + │ @ LocalVariableTargetNode (location: (1,10)-(1,11)) + │ ├── name: :s + │ └── depth: 0 + ├── rights: (length: 3) + │ ├── @ 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)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── message_loc: (1,23)-(1,24) = "f" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/prism/snapshots/seattlerb/mlhs_rescue.txt b/test/prism/snapshots/seattlerb/mlhs_rescue.txt new file mode 100644 index 0000000000..bd983cd3f9 --- /dev/null +++ b/test/prism/snapshots/seattlerb/mlhs_rescue.txt @@ -0,0 +1,36 @@ +@ 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)) + ├── lefts: (length: 2) + │ ├── @ LocalVariableTargetNode (location: (1,0)-(1,1)) + │ │ ├── name: :a + │ │ └── depth: 0 + │ └── @ LocalVariableTargetNode (location: (1,3)-(1,4)) + │ ├── name: :b + │ └── depth: 0 + ├── rest: ∅ + ├── rights: (length: 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)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :f + │ ├── message_loc: (1,7)-(1,8) = "f" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── keyword_loc: (1,9)-(1,15) = "rescue" + └── rescue_expression: + @ IntegerNode (location: (1,16)-(1,18)) + ├── flags: decimal + └── value: 42 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..ff28a1798b --- /dev/null +++ b/test/prism/snapshots/seattlerb/multiline_hash_declaration.txt @@ -0,0 +1,95 @@ +@ ProgramNode (location: (1,0)-(8,12)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(8,12)) + └── body: (length: 3) + ├── @ CallNode (location: (1,0)-(3,2)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :f + │ ├── message_loc: (1,0)-(1,1) = "f" + │ ├── opening_loc: (1,1)-(1,2) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,2)-(3,1)) + │ │ ├── flags: contains_keywords + │ │ └── arguments: (length: 1) + │ │ └── @ KeywordHashNode (location: (1,2)-(3,1)) + │ │ ├── flags: symbol_keys + │ │ └── elements: (length: 1) + │ │ └── @ AssocNode (location: (1,2)-(3,1)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (1,2)-(1,8)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── 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: ∅ + ├── @ CallNode (location: (5,0)-(6,2)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :f + │ ├── message_loc: (5,0)-(5,1) = "f" + │ ├── opening_loc: (5,1)-(5,2) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (5,2)-(6,1)) + │ │ ├── flags: contains_keywords + │ │ └── arguments: (length: 1) + │ │ └── @ KeywordHashNode (location: (5,2)-(6,1)) + │ │ ├── flags: symbol_keys + │ │ └── elements: (length: 1) + │ │ └── @ AssocNode (location: (5,2)-(6,1)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (5,2)-(5,8)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── 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: ∅ + └── @ CallNode (location: (8,0)-(8,12)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── message_loc: (8,0)-(8,1) = "f" + ├── opening_loc: (8,1)-(8,2) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (8,2)-(8,11)) + │ ├── flags: contains_keywords + │ └── arguments: (length: 1) + │ └── @ KeywordHashNode (location: (8,2)-(8,11)) + │ ├── flags: symbol_keys + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (8,2)-(8,11)) + │ ├── key: + │ │ @ SymbolNode (location: (8,2)-(8,8)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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: ∅ 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..cbf4ec4a08 --- /dev/null +++ b/test/prism/snapshots/seattlerb/non_interpolated_symbol_array_line_breaks.txt @@ -0,0 +1,25 @@ +@ ProgramNode (location: (1,0)-(5,1)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(5,1)) + └── body: (length: 2) + ├── @ ArrayNode (location: (1,0)-(4,1)) + │ ├── flags: ∅ + │ ├── elements: (length: 2) + │ │ ├── @ SymbolNode (location: (2,0)-(2,1)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (2,0)-(2,1) = "a" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a" + │ │ └── @ SymbolNode (location: (3,0)-(3,1)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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 + └── value: 1 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..e82f250098 --- /dev/null +++ b/test/prism/snapshots/seattlerb/non_interpolated_word_array_line_breaks.txt @@ -0,0 +1,25 @@ +@ ProgramNode (location: (1,0)-(5,1)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(5,1)) + └── body: (length: 2) + ├── @ ArrayNode (location: (1,0)-(4,1)) + │ ├── flags: ∅ + │ ├── 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 + └── value: 1 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..54aa06214f --- /dev/null +++ b/test/prism/snapshots/seattlerb/op_asgn_command_call.txt @@ -0,0 +1,37 @@ +@ 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)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (1,6)-(1,7)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (1,6)-(1,7) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (1,7)-(1,8) = "." + │ ├── name: :c + │ ├── message_loc: (1,8)-(1,9) = "c" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,10)-(1,11)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (1,10)-(1,11)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── 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..324c042b00 --- /dev/null +++ b/test/prism/snapshots/seattlerb/op_asgn_dot_ident_command_call.txt @@ -0,0 +1,32 @@ +@ ProgramNode (location: (1,0)-(1,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,11)) + └── body: (length: 1) + └── @ CallOrWriteNode (location: (1,0)-(1,11)) + ├── flags: ∅ + ├── receiver: + │ @ ConstantReadNode (location: (1,0)-(1,1)) + │ └── name: :A + ├── call_operator_loc: (1,1)-(1,2) = "." + ├── message_loc: (1,2)-(1,3) = "B" + ├── read_name: :B + ├── write_name: :B= + ├── operator_loc: (1,4)-(1,7) = "||=" + └── value: + @ CallNode (location: (1,8)-(1,11)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :c + ├── message_loc: (1,8)-(1,9) = "c" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,10)-(1,11)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,10)-(1,11)) + │ ├── flags: decimal + │ └── value: 1 + ├── closing_loc: ∅ + └── block: ∅ 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..ddee4cde49 --- /dev/null +++ b/test/prism/snapshots/seattlerb/op_asgn_index_command_call.txt @@ -0,0 +1,53 @@ +@ ProgramNode (location: (1,0)-(1,16)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,16)) + └── body: (length: 1) + └── @ IndexOrWriteNode (location: (1,0)-(1,16)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: ∅ + ├── opening_loc: (1,1)-(1,2) = "[" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,4)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ SymbolNode (location: (1,2)-(1,4)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (1,2)-(1,3) = ":" + │ ├── value_loc: (1,3)-(1,4) = "b" + │ ├── closing_loc: ∅ + │ └── unescaped: "b" + ├── closing_loc: (1,4)-(1,5) = "]" + ├── block: ∅ + ├── operator_loc: (1,6)-(1,9) = "||=" + └── value: + @ CallNode (location: (1,10)-(1,16)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :c + ├── message_loc: (1,10)-(1,11) = "c" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,12)-(1,16)) + │ ├── flags: ∅ + │ └── arguments: (length: 2) + │ ├── @ IntegerNode (location: (1,12)-(1,13)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── @ IntegerNode (location: (1,15)-(1,16)) + │ ├── flags: decimal + │ └── value: 2 + ├── closing_loc: ∅ + └── block: ∅ 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..523ccde455 --- /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 + │ ├── name: :B + │ ├── delimiter_loc: (1,1)-(1,3) = "::" + │ └── name_loc: (1,3)-(1,4) = "B" + ├── binary_operator_loc: (1,5)-(1,7) = "*=" + ├── value: + │ @ CallNode (location: (1,8)-(1,11)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :c + │ ├── message_loc: (1,8)-(1,9) = "c" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,10)-(1,11)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (1,10)-(1,11)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :d + │ │ ├── message_loc: (1,10)-(1,11) = "d" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── binary_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..b9d00edc30 --- /dev/null +++ b/test/prism/snapshots/seattlerb/op_asgn_primary_colon_identifier1.txt @@ -0,0 +1,20 @@ +@ ProgramNode (location: (1,0)-(1,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,9)) + └── body: (length: 1) + └── @ CallOperatorWriteNode (location: (1,0)-(1,9)) + ├── flags: ∅ + ├── receiver: + │ @ ConstantReadNode (location: (1,0)-(1,1)) + │ └── name: :A + ├── call_operator_loc: (1,1)-(1,3) = "::" + ├── message_loc: (1,3)-(1,4) = "b" + ├── read_name: :b + ├── write_name: :b= + ├── binary_operator: :+ + ├── binary_operator_loc: (1,5)-(1,7) = "+=" + └── value: + @ IntegerNode (location: (1,8)-(1,9)) + ├── flags: decimal + └── value: 1 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..c12ea3983c --- /dev/null +++ b/test/prism/snapshots/seattlerb/op_asgn_primary_colon_identifier_command_call.txt @@ -0,0 +1,40 @@ +@ ProgramNode (location: (1,0)-(1,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,11)) + └── body: (length: 1) + └── @ CallOperatorWriteNode (location: (1,0)-(1,11)) + ├── flags: ∅ + ├── receiver: + │ @ ConstantReadNode (location: (1,0)-(1,1)) + │ └── name: :A + ├── call_operator_loc: (1,1)-(1,3) = "::" + ├── message_loc: (1,3)-(1,4) = "b" + ├── read_name: :b + ├── write_name: :b= + ├── binary_operator: :* + ├── binary_operator_loc: (1,5)-(1,7) = "*=" + └── value: + @ CallNode (location: (1,8)-(1,11)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :c + ├── message_loc: (1,8)-(1,9) = "c" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,10)-(1,11)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (1,10)-(1,11)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :d + │ ├── message_loc: (1,10)-(1,11) = "d" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── closing_loc: ∅ + └── block: ∅ 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..b3b5709193 --- /dev/null +++ b/test/prism/snapshots/seattlerb/op_asgn_val_dot_ident_command_call.txt @@ -0,0 +1,40 @@ +@ ProgramNode (location: (1,0)-(1,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,11)) + └── body: (length: 1) + └── @ CallOrWriteNode (location: (1,0)-(1,11)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (1,1)-(1,2) = "." + ├── message_loc: (1,2)-(1,3) = "b" + ├── read_name: :b + ├── write_name: :b= + ├── operator_loc: (1,4)-(1,7) = "||=" + └── value: + @ CallNode (location: (1,8)-(1,11)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :c + ├── message_loc: (1,8)-(1,9) = "c" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,10)-(1,11)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,10)-(1,11)) + │ ├── flags: decimal + │ └── value: 1 + ├── closing_loc: ∅ + └── block: ∅ 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..763bd24efd --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_if_not_canonical.txt @@ -0,0 +1,62 @@ +@ 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)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (1,7)-(1,15)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (1,7)-(1,10)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :var + │ │ │ ├── message_loc: (1,7)-(1,10) = "var" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: (1,10)-(1,11) = "." + │ │ ├── name: :nil? + │ │ ├── message_loc: (1,11)-(1,15) = "nil?" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :! + │ ├── message_loc: (1,3)-(1,6) = "not" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── then_keyword_loc: (1,16)-(1,20) = "then" + ├── 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..763bd24efd --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_if_not_noncanonical.txt @@ -0,0 +1,62 @@ +@ 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)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (1,7)-(1,15)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (1,7)-(1,10)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :var + │ │ │ ├── message_loc: (1,7)-(1,10) = "var" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: (1,10)-(1,11) = "." + │ │ ├── name: :nil? + │ │ ├── message_loc: (1,11)-(1,15) = "nil?" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :! + │ ├── message_loc: (1,3)-(1,6) = "not" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── then_keyword_loc: (1,16)-(1,20) = "then" + ├── 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..623c08d50e --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_block.txt @@ -0,0 +1,30 @@ +@ 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 + │ │ └── value: 42 + │ └── operator_loc: (1,2)-(1,3) = "=" + └── @ CallNode (location: (2,0)-(2,3)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :p + ├── message_loc: (2,0)-(2,1) = "p" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (2,2)-(2,3)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ LocalVariableReadNode (location: (2,2)-(2,3)) + │ ├── name: :a + │ └── depth: 0 + ├── closing_loc: ∅ + └── block: ∅ 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..8495527cf4 --- /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)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (2,0)-(2,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :b + │ ├── message_loc: (2,0)-(2,1) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ CallNode (location: (3,0)-(3,1)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :c + ├── message_loc: (3,0)-(3,1) = "c" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ 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..f531a73a58 --- /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)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (4,0)-(4,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (5,0)-(5,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :b + │ ├── message_loc: (5,0)-(5,1) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ CallNode (location: (7,0)-(7,1)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :c + ├── message_loc: (7,0)-(7,1) = "c" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ 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..d4e962b355 --- /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)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (2,0)-(2,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :b + │ ├── message_loc: (2,0)-(2,1) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ CallNode (location: (4,0)-(4,1)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :c + ├── message_loc: (4,0)-(4,1) = "c" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ 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..a08f5419f1 --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_call_ivar_arg_no_parens_line_break.txt @@ -0,0 +1,20 @@ +@ ProgramNode (location: (1,0)-(1,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,4)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,4)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,4)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ InstanceVariableReadNode (location: (1,2)-(1,4)) + │ └── name: :@b + ├── closing_loc: ∅ + └── block: ∅ 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..dd58d92d3a --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_call_ivar_line_break_paren.txt @@ -0,0 +1,20 @@ +@ ProgramNode (location: (1,0)-(2,1)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,1)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(2,1)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: (1,1)-(1,2) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,4)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ InstanceVariableReadNode (location: (1,2)-(1,4)) + │ └── name: :@b + ├── closing_loc: (2,0)-(2,1) = ")" + └── block: ∅ 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..8a0fcd63af --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_call_no_args.txt @@ -0,0 +1,61 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(3,3)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── 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)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :x + │ │ │ └── @ RequiredParameterNode (location: (1,9)-(1,10)) + │ │ │ ├── flags: ∅ + │ │ │ └── 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)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ LocalVariableReadNode (location: (2,2)-(2,3)) + │ │ ├── name: :x + │ │ └── depth: 0 + │ ├── call_operator_loc: ∅ + │ ├── name: :+ + │ ├── message_loc: (2,4)-(2,5) = "+" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (2,6)-(2,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ LocalVariableReadNode (location: (2,6)-(2,7)) + │ │ ├── name: :y + │ │ └── depth: 0 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── opening_loc: (1,2)-(1,4) = "do" + └── closing_loc: (3,0)-(3,3) = "end" 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..84eef70b25 --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_defn_complex.txt @@ -0,0 +1,67 @@ +@ 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)) + │ │ ├── flags: ∅ + │ │ └── 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)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :p + │ │ ├── message_loc: (2,2)-(2,3) = "p" + │ │ ├── opening_loc: (2,3)-(2,4) = "(" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (2,4)-(2,5)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ LocalVariableReadNode (location: (2,4)-(2,5)) + │ │ │ ├── name: :y + │ │ │ └── depth: 0 + │ │ ├── closing_loc: (2,5)-(2,6) = ")" + │ │ └── block: ∅ + │ ├── @ LocalVariableOperatorWriteNode (location: (3,2)-(3,8)) + │ │ ├── name_loc: (3,2)-(3,3) = "y" + │ │ ├── binary_operator_loc: (3,4)-(3,6) = "*=" + │ │ ├── value: + │ │ │ @ IntegerNode (location: (3,7)-(3,8)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ ├── name: :y + │ │ ├── binary_operator: :* + │ │ └── depth: 0 + │ └── @ ReturnNode (location: (4,2)-(4,10)) + │ ├── flags: redundant + │ ├── keyword_loc: (4,2)-(4,8) = "return" + │ └── arguments: + │ @ ArgumentsNode (location: (4,9)-(4,10)) + │ ├── flags: ∅ + │ └── 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..8445743293 --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_defn_no_parens_args.txt @@ -0,0 +1,29 @@ +@ 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)) + │ │ ├── flags: ∅ + │ │ └── 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..9ccf5bdc99 --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_dot2.txt @@ -0,0 +1,51 @@ +@ ProgramNode (location: (1,0)-(5,1)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(5,1)) + └── body: (length: 3) + ├── @ RangeNode (location: (1,0)-(2,1)) + │ ├── flags: ∅ + │ ├── left: + │ │ @ IntegerNode (location: (1,0)-(1,1)) + │ │ ├── flags: decimal + │ │ └── value: 0 + │ ├── right: + │ │ @ IntegerNode (location: (2,0)-(2,1)) + │ │ ├── flags: decimal + │ │ └── value: 4 + │ └── operator_loc: (1,1)-(1,3) = ".." + ├── @ RangeNode (location: (3,0)-(4,1)) + │ ├── flags: ∅ + │ ├── left: + │ │ @ CallNode (location: (3,0)-(3,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (3,0)-(3,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── right: + │ │ @ CallNode (location: (4,0)-(4,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (4,0)-(4,1) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── operator_loc: (3,1)-(3,3) = ".." + └── @ CallNode (location: (5,0)-(5,1)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :c + ├── message_loc: (5,0)-(5,1) = "c" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ 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..f85fdd6d4b --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_dot2_open.txt @@ -0,0 +1,38 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 3) + ├── @ RangeNode (location: (1,0)-(1,3)) + │ ├── flags: ∅ + │ ├── left: + │ │ @ IntegerNode (location: (1,0)-(1,1)) + │ │ ├── flags: decimal + │ │ └── value: 0 + │ ├── right: ∅ + │ └── operator_loc: (1,1)-(1,3) = ".." + ├── @ RangeNode (location: (2,2)-(2,5)) + │ ├── flags: ∅ + │ ├── left: + │ │ @ CallNode (location: (2,2)-(2,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (2,2)-(2,3) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── right: ∅ + │ └── operator_loc: (2,3)-(2,5) = ".." + └── @ CallNode (location: (3,2)-(3,3)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :c + ├── message_loc: (3,2)-(3,3) = "c" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ 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..6364c1f136 --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_dot3.txt @@ -0,0 +1,51 @@ +@ ProgramNode (location: (1,0)-(5,1)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(5,1)) + └── body: (length: 3) + ├── @ RangeNode (location: (1,0)-(2,1)) + │ ├── flags: exclude_end + │ ├── left: + │ │ @ IntegerNode (location: (1,0)-(1,1)) + │ │ ├── flags: decimal + │ │ └── value: 0 + │ ├── right: + │ │ @ IntegerNode (location: (2,0)-(2,1)) + │ │ ├── flags: decimal + │ │ └── value: 4 + │ └── operator_loc: (1,1)-(1,4) = "..." + ├── @ RangeNode (location: (3,0)-(4,1)) + │ ├── flags: exclude_end + │ ├── left: + │ │ @ CallNode (location: (3,0)-(3,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (3,0)-(3,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── right: + │ │ @ CallNode (location: (4,0)-(4,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (4,0)-(4,1) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── operator_loc: (3,1)-(3,4) = "..." + └── @ CallNode (location: (5,0)-(5,1)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :c + ├── message_loc: (5,0)-(5,1) = "c" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ 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..35759d12e3 --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_dot3_open.txt @@ -0,0 +1,38 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 3) + ├── @ RangeNode (location: (1,0)-(1,4)) + │ ├── flags: exclude_end + │ ├── left: + │ │ @ IntegerNode (location: (1,0)-(1,1)) + │ │ ├── flags: decimal + │ │ └── value: 0 + │ ├── right: ∅ + │ └── operator_loc: (1,1)-(1,4) = "..." + ├── @ RangeNode (location: (2,2)-(2,6)) + │ ├── flags: exclude_end + │ ├── left: + │ │ @ CallNode (location: (2,2)-(2,3)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (2,2)-(2,3) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── right: ∅ + │ └── operator_loc: (2,3)-(2,6) = "..." + └── @ CallNode (location: (3,2)-(3,3)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :c + ├── message_loc: (3,2)-(3,3) = "c" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ 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..aada5a9477 --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_dstr_escaped_newline.txt @@ -0,0 +1,21 @@ +@ ProgramNode (location: (1,0)-(3,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,4)) + └── body: (length: 2) + ├── @ InterpolatedStringNode (location: (1,0)-(2,2)) + │ ├── flags: ∅ + │ ├── opening_loc: (1,0)-(1,1) = "\"" + │ ├── parts: (length: 2) + │ │ ├── @ StringNode (location: (1,1)-(1,4)) + │ │ │ ├── flags: frozen + │ │ │ ├── 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..7ef56acb76 --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_dstr_soft_newline.txt @@ -0,0 +1,21 @@ +@ ProgramNode (location: (1,0)-(4,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,4)) + └── body: (length: 2) + ├── @ InterpolatedStringNode (location: (1,0)-(3,2)) + │ ├── flags: ∅ + │ ├── opening_loc: (1,0)-(1,1) = "\"" + │ ├── parts: (length: 2) + │ │ ├── @ StringNode (location: (1,1)-(2,0)) + │ │ │ ├── flags: frozen + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (1,1)-(2,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..82f461e340 --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_evstr_after_break.txt @@ -0,0 +1,37 @@ +@ ProgramNode (location: (1,0)-(2,6)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,6)) + └── body: (length: 1) + └── @ InterpolatedStringNode (location: (1,0)-(2,6)) + ├── flags: ∅ + ├── opening_loc: ∅ + ├── parts: (length: 2) + │ ├── @ StringNode (location: (1,0)-(1,3)) + │ │ ├── flags: frozen + │ │ ├── opening_loc: (1,0)-(1,1) = "\"" + │ │ ├── content_loc: (1,1)-(1,2) = "a" + │ │ ├── closing_loc: (1,2)-(1,3) = "\"" + │ │ └── unescaped: "a" + │ └── @ InterpolatedStringNode (location: (2,0)-(2,6)) + │ ├── flags: ∅ + │ ├── 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)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (2,3)-(2,4) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── closing_loc: (2,4)-(2,5) = "}" + │ └── closing_loc: (2,5)-(2,6) = "\"" + └── closing_loc: ∅ 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..0f95a607aa --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_hash_lit.txt @@ -0,0 +1,22 @@ +@ 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)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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 + │ │ └── value: 1 + │ └── 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..ba00f01504 --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_heredoc.txt @@ -0,0 +1,43 @@ +@ 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)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ StringNode (location: (1,15)-(1,25)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (1,15)-(1,25) = "<<-HEREDOC" + │ │ │ ├── content_loc: (2,0)-(3,0) = " very long string\n" + │ │ │ ├── closing_loc: (3,0)-(4,0) = " HEREDOC\n" + │ │ │ └── unescaped: " very long string\n" + │ │ ├── call_operator_loc: (1,25)-(1,26) = "." + │ │ ├── name: :strip + │ │ ├── message_loc: (1,26)-(1,31) = "strip" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── operator_loc: (1,13)-(1,14) = "=" + └── @ CallNode (location: (4,6)-(4,17)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :puts + ├── message_loc: (4,6)-(4,10) = "puts" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (4,11)-(4,17)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ LocalVariableReadNode (location: (4,11)-(4,17)) + │ ├── name: :string + │ └── depth: 0 + ├── closing_loc: ∅ + └── block: ∅ 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..b251b2b344 --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_heredoc_evstr.txt @@ -0,0 +1,38 @@ +@ ProgramNode (location: (1,0)-(1,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,4)) + └── body: (length: 1) + └── @ InterpolatedStringNode (location: (1,0)-(1,4)) + ├── flags: ∅ + ├── opening_loc: (1,0)-(1,4) = "<<-A" + ├── parts: (length: 3) + │ ├── @ StringNode (location: (2,0)-(3,0)) + │ │ ├── flags: frozen + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (2,0)-(3,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)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (3,2)-(3,3) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── closing_loc: (3,3)-(3,4) = "}" + │ └── @ StringNode (location: (3,4)-(4,0)) + │ ├── flags: frozen + │ ├── opening_loc: ∅ + │ ├── content_loc: (3,4)-(4,0) = "\n" + │ ├── closing_loc: ∅ + │ └── unescaped: "\n" + └── closing_loc: (4,0)-(5,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..ad0f0dfd99 --- /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)-(3,0) = "\\n\\n\\n\\n\\n\\n\\n\\n\\n\n" + │ ├── closing_loc: (3,0)-(4,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..fdac30fab7 --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_heredoc_regexp_chars.txt @@ -0,0 +1,33 @@ +@ 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)-(3,0) = " very long string\n" + │ │ ├── closing_loc: (3,0)-(4,0) = " ^D\n" + │ │ └── unescaped: " very long string\n" + │ └── operator_loc: (1,13)-(1,14) = "=" + └── @ CallNode (location: (4,6)-(4,17)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :puts + ├── message_loc: (4,6)-(4,10) = "puts" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (4,11)-(4,17)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ LocalVariableReadNode (location: (4,11)-(4,17)) + │ ├── name: :string + │ └── depth: 0 + ├── closing_loc: ∅ + └── block: ∅ 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..8d9dbf24ab --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_iter_call_no_parens.txt @@ -0,0 +1,74 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(3,3)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,3)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (1,2)-(1,3)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,2)-(1,3) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── 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)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :x + │ │ │ └── @ RequiredParameterNode (location: (1,11)-(1,12)) + │ │ │ ├── flags: ∅ + │ │ │ └── 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)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ LocalVariableReadNode (location: (2,2)-(2,3)) + │ │ ├── name: :x + │ │ └── depth: 0 + │ ├── call_operator_loc: ∅ + │ ├── name: :+ + │ ├── message_loc: (2,4)-(2,5) = "+" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (2,6)-(2,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ LocalVariableReadNode (location: (2,6)-(2,7)) + │ │ ├── name: :y + │ │ └── depth: 0 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── opening_loc: (1,4)-(1,6) = "do" + └── closing_loc: (3,0)-(3,3) = "end" 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..663d870137 --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_iter_call_parens.txt @@ -0,0 +1,74 @@ +@ ProgramNode (location: (1,0)-(3,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,3)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(3,3)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :f + ├── message_loc: (1,0)-(1,1) = "f" + ├── opening_loc: (1,1)-(1,2) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,3)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (1,2)-(1,3)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,2)-(1,3) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── 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)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :x + │ │ │ └── @ RequiredParameterNode (location: (1,12)-(1,13)) + │ │ │ ├── flags: ∅ + │ │ │ └── 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)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ LocalVariableReadNode (location: (2,2)-(2,3)) + │ │ ├── name: :x + │ │ └── depth: 0 + │ ├── call_operator_loc: ∅ + │ ├── name: :+ + │ ├── message_loc: (2,4)-(2,5) = "+" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (2,6)-(2,7)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ LocalVariableReadNode (location: (2,6)-(2,7)) + │ │ ├── name: :y + │ │ └── depth: 0 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── opening_loc: (1,5)-(1,7) = "do" + └── closing_loc: (3,0)-(3,3) = "end" 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..8d4578eaec --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_multiline_str.txt @@ -0,0 +1,14 @@ +@ 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 + └── value: 1 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..49d31f5b1b --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_multiline_str_literal_n.txt @@ -0,0 +1,14 @@ +@ 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 + └── value: 1 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..d113f2af9d --- /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" + │ ├── binary_operator_loc: (1,10)-(1,12) = "+=" + │ ├── value: + │ │ @ CallNode (location: (2,8)-(2,11)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (2,8)-(2,11) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── name: :foo + │ ├── binary_operator: :+ + │ └── depth: 0 + └── @ CallNode (location: (3,6)-(3,9)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :baz + ├── message_loc: (3,6)-(3,9) = "baz" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ 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..68b5f02fe0 --- /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)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (2,0)-(2,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── 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..65ea22cf7d --- /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)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (2,0)-(2,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── 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..cb20d5403b --- /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)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (2,2)-(2,3) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── 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)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (4,2)-(4,3) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── 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)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :c + │ │ ├── message_loc: (6,2)-(6,3) = "c" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── 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..719a4da5da --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_return.txt @@ -0,0 +1,40 @@ +@ 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)) + │ ├── then_keyword_loc: (2,16)-(2,20) = "then" + │ ├── statements: + │ │ @ StatementsNode (location: (3,10)-(3,19)) + │ │ └── body: (length: 1) + │ │ └── @ ReturnNode (location: (3,10)-(3,19)) + │ │ ├── flags: redundant + │ │ ├── keyword_loc: (3,10)-(3,16) = "return" + │ │ └── arguments: + │ │ @ ArgumentsNode (location: (3,17)-(3,19)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (3,17)-(3,19)) + │ │ ├── flags: decimal + │ │ └── value: 42 + │ ├── 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..4a675d67c4 --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_str_with_newline_escape.txt @@ -0,0 +1,25 @@ +@ ProgramNode (location: (1,0)-(1,13)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,13)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,13)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: (1,1)-(1,2) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,12)) + │ ├── flags: ∅ + │ └── 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: ∅ 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..0485b0d2e3 --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_line_to_ary.txt @@ -0,0 +1,39 @@ +@ 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)) + │ ├── lefts: (length: 2) + │ │ ├── @ LocalVariableTargetNode (location: (1,0)-(1,1)) + │ │ │ ├── name: :a + │ │ │ └── depth: 0 + │ │ └── @ LocalVariableTargetNode (location: (2,0)-(2,1)) + │ │ ├── name: :b + │ │ └── depth: 0 + │ ├── rest: ∅ + │ ├── rights: (length: 0) + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── operator_loc: (2,2)-(2,3) = "=" + │ └── value: + │ @ CallNode (location: (2,4)-(2,5)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :c + │ ├── message_loc: (2,4)-(2,5) = "c" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ CallNode (location: (3,0)-(3,1)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :d + ├── message_loc: (3,0)-(3,1) = "d" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ 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..5cd7702847 --- /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)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ CallNode (location: (2,0)-(2,1)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :b + ├── message_loc: (2,0)-(2,1) = "b" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ 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..dc11e2ca3d --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_opt_call_args_assocs_comma.txt @@ -0,0 +1,34 @@ +@ ProgramNode (location: (1,0)-(1,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,8)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,8)) + ├── flags: ∅ + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── call_operator_loc: ∅ + ├── name: :[] + ├── message_loc: (1,1)-(1,8) = "[2=>3,]" + ├── opening_loc: (1,1)-(1,2) = "[" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,6)) + │ ├── flags: contains_keywords + │ └── arguments: (length: 1) + │ └── @ KeywordHashNode (location: (1,2)-(1,6)) + │ ├── flags: ∅ + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (1,2)-(1,6)) + │ ├── key: + │ │ @ IntegerNode (location: (1,2)-(1,3)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── value: + │ │ @ IntegerNode (location: (1,5)-(1,6)) + │ │ ├── flags: decimal + │ │ └── value: 3 + │ └── operator_loc: (1,3)-(1,5) = "=>" + ├── closing_loc: (1,7)-(1,8) = "]" + └── block: ∅ 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..d1d3d9335f --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_opt_call_args_lit_comma.txt @@ -0,0 +1,24 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,5)) + ├── flags: ∅ + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,1)) + │ ├── flags: decimal + │ └── value: 1 + ├── call_operator_loc: ∅ + ├── name: :[] + ├── message_loc: (1,1)-(1,5) = "[2,]" + ├── opening_loc: (1,1)-(1,2) = "[" + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,3)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,2)-(1,3)) + │ ├── flags: decimal + │ └── value: 2 + ├── closing_loc: (1,4)-(1,5) = "]" + └── block: ∅ 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..9e2500fbde --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_pattern_019.txt @@ -0,0 +1,33 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(4,3)) + ├── predicate: + │ @ IntegerNode (location: (1,5)-(1,6)) + │ ├── flags: decimal + │ └── value: 0 + ├── conditions: (length: 1) + │ └── @ InNode (location: (2,0)-(3,6)) + │ ├── pattern: + │ │ @ RangeNode (location: (2,3)-(2,8)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ IntegerNode (location: (2,3)-(2,5)) + │ │ │ ├── flags: decimal + │ │ │ └── value: -1 + │ │ ├── right: + │ │ │ @ IntegerNode (location: (2,7)-(2,8)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── operator_loc: (2,5)-(2,7) = ".." + │ ├── 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..951a5100b6 --- /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) + └── @ CaseMatchNode (location: (1,0)-(4,3)) + ├── predicate: + │ @ CallNode (location: (1,5)-(1,8)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :obj + │ ├── message_loc: (1,5)-(1,8) = "obj" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── 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..6c366e559f --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_pattern_051.txt @@ -0,0 +1,47 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(4,3)) + ├── predicate: + │ @ ArrayNode (location: (1,5)-(1,14)) + │ ├── flags: ∅ + │ ├── elements: (length: 3) + │ │ ├── @ IntegerNode (location: (1,6)-(1,7)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 0 + │ │ ├── @ IntegerNode (location: (1,9)-(1,10)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── @ IntegerNode (location: (1,12)-(1,13)) + │ │ ├── flags: decimal + │ │ └── value: 2 + │ ├── 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 + │ │ │ │ └── value: 0 + │ │ │ └── @ IntegerNode (location: (2,7)-(2,8)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── rest: + │ │ │ @ ImplicitRestNode (location: (2,8)-(2,9)) + │ │ ├── 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..8a4f8f8a68 --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_pattern_058.txt @@ -0,0 +1,73 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [:a, :rest] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CaseMatchNode (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)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── 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 + │ │ │ └── value: 0 + │ │ └── 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: ∅ + │ │ ├── elements: (length: 1) + │ │ │ └── @ AssocNode (location: (2,4)-(2,6)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (2,4)-(2,6)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (2,4)-(2,5) = "a" + │ │ │ │ ├── closing_loc: (2,5)-(2,6) = ":" + │ │ │ │ └── unescaped: "a" + │ │ │ ├── value: + │ │ │ │ @ ImplicitNode (location: (2,4)-(2,5)) + │ │ │ │ └── value: + │ │ │ │ @ LocalVariableTargetNode (location: (2,4)-(2,5)) + │ │ │ │ ├── name: :a + │ │ │ │ └── depth: 0 + │ │ │ └── operator_loc: ∅ + │ │ ├── rest: + │ │ │ @ AssocSplatNode (location: (2,8)-(2,14)) + │ │ │ ├── value: + │ │ │ │ @ LocalVariableTargetNode (location: (2,10)-(2,14)) + │ │ │ │ ├── name: :rest + │ │ │ │ └── depth: 0 + │ │ │ └── operator_loc: (2,8)-(2,10) = "**" + │ │ ├── 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)) + │ │ ├── flags: ∅ + │ │ ├── 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..3507d0f2cf --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_pattern_058_2.txt @@ -0,0 +1,67 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [:a] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CaseMatchNode (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)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── 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 + │ │ │ └── value: 0 + │ │ └── 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: ∅ + │ │ ├── elements: (length: 1) + │ │ │ └── @ AssocNode (location: (2,4)-(2,6)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (2,4)-(2,6)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (2,4)-(2,5) = "a" + │ │ │ │ ├── closing_loc: (2,5)-(2,6) = ":" + │ │ │ │ └── unescaped: "a" + │ │ │ ├── value: + │ │ │ │ @ ImplicitNode (location: (2,4)-(2,5)) + │ │ │ │ └── value: + │ │ │ │ @ LocalVariableTargetNode (location: (2,4)-(2,5)) + │ │ │ │ ├── name: :a + │ │ │ │ └── depth: 0 + │ │ │ └── operator_loc: ∅ + │ │ ├── rest: + │ │ │ @ AssocSplatNode (location: (2,8)-(2,10)) + │ │ │ ├── value: ∅ + │ │ │ └── operator_loc: (2,8)-(2,10) = "**" + │ │ ├── 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)) + │ │ ├── flags: ∅ + │ │ ├── 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..09ac7653c6 --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_pattern_069.txt @@ -0,0 +1,48 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(4,3)) + ├── predicate: + │ @ SymbolNode (location: (1,5)-(1,7)) + │ ├── flags: forced_us_ascii_encoding + │ ├── 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 + │ │ ├── elements: (length: 1) + │ │ │ └── @ AssocNode (location: (2,10)-(2,14)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (2,10)-(2,12)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── 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 + │ │ │ │ └── value: 1 + │ │ │ └── operator_loc: ∅ + │ │ ├── rest: ∅ + │ │ ├── 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 + │ │ └── value: 1 + │ ├── 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..60e71cd6fe --- /dev/null +++ b/test/prism/snapshots/seattlerb/parse_pattern_076.txt @@ -0,0 +1,58 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CaseMatchNode (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)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── 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 + │ │ │ └── value: 1 + │ │ └── 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: ∅ + │ │ ├── elements: (length: 1) + │ │ │ └── @ AssocNode (location: (2,4)-(2,8)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (2,4)-(2,6)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── 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 + │ │ │ │ └── value: 1 + │ │ │ └── operator_loc: ∅ + │ │ ├── rest: + │ │ │ @ NoKeywordsParameterNode (location: (2,10)-(2,15)) + │ │ │ ├── operator_loc: (2,10)-(2,12) = "**" + │ │ │ └── keyword_loc: (2,12)-(2,15) = "nil" + │ │ ├── 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..7d5ef19a05 --- /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)) + ├── flags: ∅ + ├── keyword_loc: (1,0)-(1,5) = "until" + ├── closing_loc: (3,0)-(3,3) = "end" + ├── predicate: + │ @ CallNode (location: (1,6)-(1,18)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (1,10)-(1,18)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (1,10)-(1,13)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :var + │ │ │ ├── message_loc: (1,10)-(1,13) = "var" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: (1,13)-(1,14) = "." + │ │ ├── name: :nil? + │ │ ├── message_loc: (1,14)-(1,18) = "nil?" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :! + │ ├── message_loc: (1,6)-(1,9) = "not" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── 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" 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..7d5ef19a05 --- /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)) + ├── flags: ∅ + ├── keyword_loc: (1,0)-(1,5) = "until" + ├── closing_loc: (3,0)-(3,3) = "end" + ├── predicate: + │ @ CallNode (location: (1,6)-(1,18)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (1,10)-(1,18)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (1,10)-(1,13)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :var + │ │ │ ├── message_loc: (1,10)-(1,13) = "var" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: (1,13)-(1,14) = "." + │ │ ├── name: :nil? + │ │ ├── message_loc: (1,14)-(1,18) = "nil?" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :! + │ ├── message_loc: (1,6)-(1,9) = "not" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── 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" 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..91eb88a70f --- /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)) + ├── flags: ∅ + ├── keyword_loc: (1,0)-(1,5) = "while" + ├── closing_loc: (3,0)-(3,3) = "end" + ├── predicate: + │ @ CallNode (location: (1,6)-(1,18)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (1,10)-(1,18)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (1,10)-(1,13)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :var + │ │ │ ├── message_loc: (1,10)-(1,13) = "var" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: (1,13)-(1,14) = "." + │ │ ├── name: :nil? + │ │ ├── message_loc: (1,14)-(1,18) = "nil?" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :! + │ ├── message_loc: (1,6)-(1,9) = "not" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── 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" 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..91eb88a70f --- /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)) + ├── flags: ∅ + ├── keyword_loc: (1,0)-(1,5) = "while" + ├── closing_loc: (3,0)-(3,3) = "end" + ├── predicate: + │ @ CallNode (location: (1,6)-(1,18)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (1,10)-(1,18)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (1,10)-(1,13)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :var + │ │ │ ├── message_loc: (1,10)-(1,13) = "var" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: (1,13)-(1,14) = "." + │ │ ├── name: :nil? + │ │ ├── message_loc: (1,14)-(1,18) = "nil?" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :! + │ ├── message_loc: (1,6)-(1,9) = "not" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── 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" diff --git a/test/prism/snapshots/seattlerb/pctW_lineno.txt b/test/prism/snapshots/seattlerb/pctW_lineno.txt new file mode 100644 index 0000000000..58efa9c59a --- /dev/null +++ b/test/prism/snapshots/seattlerb/pctW_lineno.txt @@ -0,0 +1,52 @@ +@ ProgramNode (location: (1,0)-(5,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(5,11)) + └── body: (length: 1) + └── @ ArrayNode (location: (1,0)-(5,11)) + ├── flags: ∅ + ├── 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: "e\nf" + │ ├── @ 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..c8a990c672 --- /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)-(2,0) = " \\\n" + ├── closing_loc: (2,0)-(2,1) = "}" + └── unescaped: " " diff --git a/test/prism/snapshots/seattlerb/pct_nl.txt b/test/prism/snapshots/seattlerb/pct_nl.txt new file mode 100644 index 0000000000..1009fcb51d --- /dev/null +++ b/test/prism/snapshots/seattlerb/pct_nl.txt @@ -0,0 +1,17 @@ +@ ProgramNode (location: (1,0)-(3,0)) +├── locals: [:x] +└── statements: + @ StatementsNode (location: (1,0)-(3,0)) + └── body: (length: 1) + └── @ LocalVariableWriteNode (location: (1,0)-(3,0)) + ├── name: :x + ├── depth: 0 + ├── name_loc: (1,0)-(1,1) = "x" + ├── value: + │ @ StringNode (location: (1,4)-(3,0)) + │ ├── flags: ∅ + │ ├── opening_loc: (1,4)-(2,0) = "%\n" + │ ├── content_loc: (2,0)-(2,0) = "" + │ ├── closing_loc: (2,0)-(3,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..1b8ec69b56 --- /dev/null +++ b/test/prism/snapshots/seattlerb/pct_w_heredoc_interp_nested.txt @@ -0,0 +1,51 @@ +@ ProgramNode (location: (1,0)-(4,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,11)) + └── body: (length: 1) + └── @ ArrayNode (location: (1,0)-(4,11)) + ├── flags: ∅ + ├── 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)) + │ │ ├── flags: mutable + │ │ ├── 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: frozen + │ │ │ │ ├── opening_loc: (1,8)-(1,11) = "<<A" + │ │ │ │ ├── content_loc: (2,0)-(3,0) = "2\n" + │ │ │ │ ├── closing_loc: (3,0)-(4,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..71fb4fbed5 --- /dev/null +++ b/test/prism/snapshots/seattlerb/pipe_semicolon.txt @@ -0,0 +1,39 @@ +@ ProgramNode (location: (1,0)-(1,18)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,18)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,18)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (1,1)-(1,2) = "." + ├── name: :b + ├── 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)) + │ │ ├── flags: ∅ + │ │ └── 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" diff --git a/test/prism/snapshots/seattlerb/pipe_space.txt b/test/prism/snapshots/seattlerb/pipe_space.txt new file mode 100644 index 0000000000..302d225337 --- /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)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (1,1)-(1,2) = "." + ├── name: :b + ├── 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" diff --git a/test/prism/snapshots/seattlerb/qWords_space.txt b/test/prism/snapshots/seattlerb/qWords_space.txt new file mode 100644 index 0000000000..95ae6d4075 --- /dev/null +++ b/test/prism/snapshots/seattlerb/qWords_space.txt @@ -0,0 +1,10 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ ArrayNode (location: (1,0)-(1,5)) + ├── flags: ∅ + ├── 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..8ba68638c5 --- /dev/null +++ b/test/prism/snapshots/seattlerb/qsymbols.txt @@ -0,0 +1,28 @@ +@ ProgramNode (location: (1,0)-(1,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,9)) + └── body: (length: 1) + └── @ ArrayNode (location: (1,0)-(1,9)) + ├── flags: ∅ + ├── elements: (length: 3) + │ ├── @ SymbolNode (location: (1,3)-(1,4)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (1,3)-(1,4) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── @ SymbolNode (location: (1,5)-(1,6)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (1,5)-(1,6) = "b" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "b" + │ └── @ SymbolNode (location: (1,7)-(1,8)) + │ ├── flags: forced_us_ascii_encoding + │ ├── 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..54aa3f77d7 --- /dev/null +++ b/test/prism/snapshots/seattlerb/qsymbols_empty.txt @@ -0,0 +1,10 @@ +@ ProgramNode (location: (1,0)-(1,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,4)) + └── body: (length: 1) + └── @ ArrayNode (location: (1,0)-(1,4)) + ├── flags: ∅ + ├── 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..624b922ce6 --- /dev/null +++ b/test/prism/snapshots/seattlerb/qsymbols_empty_space.txt @@ -0,0 +1,10 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ ArrayNode (location: (1,0)-(1,5)) + ├── flags: ∅ + ├── 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..97bc6754ff --- /dev/null +++ b/test/prism/snapshots/seattlerb/qsymbols_interp.txt @@ -0,0 +1,57 @@ +@ ProgramNode (location: (1,0)-(1,15)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,15)) + └── body: (length: 1) + └── @ ArrayNode (location: (1,0)-(1,15)) + ├── flags: ∅ + ├── elements: (length: 3) + │ ├── @ SymbolNode (location: (1,3)-(1,4)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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: frozen + │ │ │ │ ├── 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)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── receiver: + │ │ │ │ │ @ IntegerNode (location: (1,8)-(1,9)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 1 + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :+ + │ │ │ │ ├── message_loc: (1,9)-(1,10) = "+" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: + │ │ │ │ │ @ ArgumentsNode (location: (1,10)-(1,11)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── arguments: (length: 1) + │ │ │ │ │ └── @ IntegerNode (location: (1,10)-(1,11)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 1 + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── closing_loc: (1,11)-(1,12) = "}" + │ │ └── closing_loc: ∅ + │ └── @ SymbolNode (location: (1,13)-(1,14)) + │ ├── flags: forced_us_ascii_encoding + │ ├── 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..bbc19d50ef --- /dev/null +++ b/test/prism/snapshots/seattlerb/quoted_symbol_hash_arg.txt @@ -0,0 +1,35 @@ +@ ProgramNode (location: (1,0)-(1,12)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,12)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,12)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :puts + ├── message_loc: (1,0)-(1,4) = "puts" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,5)-(1,12)) + │ ├── flags: contains_keywords + │ └── arguments: (length: 1) + │ └── @ KeywordHashNode (location: (1,5)-(1,12)) + │ ├── flags: symbol_keys + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (1,5)-(1,12)) + │ ├── key: + │ │ @ SymbolNode (location: (1,5)-(1,9)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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: ∅ 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..96e6af51a4 --- /dev/null +++ b/test/prism/snapshots/seattlerb/quoted_symbol_keys.txt @@ -0,0 +1,25 @@ +@ 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)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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..d92c1da7a6 --- /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..e935b7eb68 --- /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..f9915c97c9 --- /dev/null +++ b/test/prism/snapshots/seattlerb/qwords_empty.txt @@ -0,0 +1,10 @@ +@ ProgramNode (location: (1,0)-(1,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,4)) + └── body: (length: 1) + └── @ ArrayNode (location: (1,0)-(1,4)) + ├── flags: ∅ + ├── 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..3ea5604b69 --- /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: forced_utf8_encoding + ├── 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..1eba1396fd --- /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: forced_utf8_encoding + ├── 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..06cf99264e --- /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)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (1,0)-(1,1) = "/" + │ ├── content_loc: (1,1)-(1,4) = "wtf" + │ ├── closing_loc: (1,4)-(1,5) = "/" + │ └── unescaped: "wtf" + ├── @ RegularExpressionNode (location: (3,0)-(3,6)) + │ ├── flags: multi_line, forced_us_ascii_encoding + │ ├── opening_loc: (3,0)-(3,1) = "/" + │ ├── content_loc: (3,1)-(3,4) = "wtf" + │ ├── closing_loc: (3,4)-(3,6) = "/m" + │ └── unescaped: "wtf" + ├── @ RegularExpressionNode (location: (5,0)-(5,6)) + │ ├── flags: ascii_8bit, forced_us_ascii_encoding + │ ├── opening_loc: (5,0)-(5,1) = "/" + │ ├── content_loc: (5,1)-(5,4) = "wtf" + │ ├── closing_loc: (5,4)-(5,6) = "/n" + │ └── unescaped: "wtf" + ├── @ RegularExpressionNode (location: (7,0)-(7,7)) + │ ├── flags: multi_line, ascii_8bit, forced_us_ascii_encoding + │ ├── opening_loc: (7,0)-(7,1) = "/" + │ ├── content_loc: (7,1)-(7,4) = "wtf" + │ ├── closing_loc: (7,4)-(7,7) = "/nm" + │ └── unescaped: "wtf" + └── @ RegularExpressionNode (location: (9,0)-(9,13)) + ├── flags: multi_line, ascii_8bit, forced_us_ascii_encoding + ├── opening_loc: (9,0)-(9,1) = "/" + ├── content_loc: (9,1)-(9,4) = "wtf" + ├── closing_loc: (9,4)-(9,13) = "/nmnmnmnm" + └── unescaped: "wtf" 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..4dbedc44ca --- /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)) + ├── flags: forced_us_ascii_encoding + ├── opening_loc: (1,0)-(1,1) = "/" + ├── content_loc: (1,1)-(1,6) = "\\cC\\d" + ├── closing_loc: (1,6)-(1,7) = "/" + └── unescaped: "\\x03\\d" 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..bca451eb3b --- /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)) + ├── flags: forced_us_ascii_encoding + ├── opening_loc: (1,0)-(1,1) = "/" + ├── content_loc: (1,1)-(1,16) = "[\\u0021-\\u0027]" + ├── closing_loc: (1,16)-(1,17) = "/" + └── unescaped: "[\\u0021-\\u0027]" 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..6568d2bd92 --- /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)) + ├── flags: ∅ + ├── opening_loc: (1,0)-(1,1) = "/" + ├── content_loc: (1,1)-(1,5) = "\\“" + ├── closing_loc: (1,5)-(1,6) = "/" + └── unescaped: "“" 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..487161b4d0 --- /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)) + │ ├── flags: forced_utf8_encoding + │ ├── opening_loc: (1,0)-(1,1) = "/" + │ ├── content_loc: (1,1)-(1,14) = "\\u{c0de babe}" + │ ├── closing_loc: (1,14)-(1,15) = "/" + │ └── unescaped: "\\u{c0de babe}" + └── @ RegularExpressionNode (location: (3,0)-(3,8)) + ├── flags: forced_utf8_encoding + ├── opening_loc: (3,0)-(3,1) = "/" + ├── content_loc: (3,1)-(3,7) = "\\u{df}" + ├── closing_loc: (3,7)-(3,8) = "/" + └── unescaped: "\\u{df}" 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..54595ac5cb --- /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) + │ │ ├── @ RequiredKeywordParameterNode (location: (1,6)-(1,8)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :a + │ │ │ └── name_loc: (1,6)-(1,8) = "a:" + │ │ └── @ RequiredKeywordParameterNode (location: (1,10)-(1,12)) + │ │ ├── flags: ∅ + │ │ ├── name: :b + │ │ └── name_loc: (1,10)-(1,12) = "b:" + │ ├── 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..21f8bb08a5 --- /dev/null +++ b/test/prism/snapshots/seattlerb/rescue_do_end_ensure_result.txt @@ -0,0 +1,58 @@ +@ ProgramNode (location: (1,0)-(5,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(5,8)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(5,8)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,0)-(5,3)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :proc + │ ├── message_loc: (1,0)-(1,4) = "proc" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (1,5)-(5,3)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ BeginNode (location: (1,5)-(5,3)) + │ │ ├── begin_keyword_loc: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (2,2)-(2,8)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ SymbolNode (location: (2,2)-(2,8)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── 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)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── 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" + ├── call_operator_loc: (5,3)-(5,4) = "." + ├── name: :call + ├── message_loc: (5,4)-(5,8) = "call" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ 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..aa4e85c171 --- /dev/null +++ b/test/prism/snapshots/seattlerb/rescue_do_end_no_raise.txt @@ -0,0 +1,75 @@ +@ ProgramNode (location: (1,0)-(9,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(9,3)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(9,3)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :tap + ├── message_loc: (1,0)-(1,3) = "tap" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,4)-(9,3)) + ├── locals: [] + ├── parameters: ∅ + ├── body: + │ @ BeginNode (location: (1,4)-(9,3)) + │ ├── begin_keyword_loc: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (2,2)-(2,8)) + │ │ └── body: (length: 1) + │ │ └── @ SymbolNode (location: (2,2)-(2,8)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── 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)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── 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)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── 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" 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..06f67fae69 --- /dev/null +++ b/test/prism/snapshots/seattlerb/rescue_do_end_raised.txt @@ -0,0 +1,52 @@ +@ ProgramNode (location: (1,0)-(5,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(5,3)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(5,3)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :tap + ├── message_loc: (1,0)-(1,3) = "tap" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,4)-(5,3)) + ├── locals: [] + ├── parameters: ∅ + ├── body: + │ @ BeginNode (location: (1,4)-(5,3)) + │ ├── begin_keyword_loc: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (2,2)-(2,7)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (2,2)-(2,7)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :raise + │ │ ├── message_loc: (2,2)-(2,7) = "raise" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── 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)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── 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" 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..b4576c3bb2 --- /dev/null +++ b/test/prism/snapshots/seattlerb/rescue_do_end_rescued.txt @@ -0,0 +1,79 @@ +@ ProgramNode (location: (1,0)-(9,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(9,3)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(9,3)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :tap + ├── message_loc: (1,0)-(1,3) = "tap" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,4)-(9,3)) + ├── locals: [] + ├── parameters: ∅ + ├── body: + │ @ BeginNode (location: (1,4)-(9,3)) + │ ├── begin_keyword_loc: ∅ + │ ├── statements: + │ │ @ StatementsNode (location: (2,2)-(2,7)) + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (2,2)-(2,7)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :raise + │ │ ├── message_loc: (2,2)-(2,7) = "raise" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── 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)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── 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)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── 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)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── 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" 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..daac2b6776 --- /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)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :blah + ├── message_loc: (1,0)-(1,4) = "blah" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,5)-(4,3)) + ├── locals: [] + ├── parameters: ∅ + ├── body: + │ @ BeginNode (location: (1,5)-(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)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :stuff + │ │ │ ├── message_loc: (3,2)-(3,7) = "stuff" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── 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" diff --git a/test/prism/snapshots/seattlerb/rescue_parens.txt b/test/prism/snapshots/seattlerb/rescue_parens.txt new file mode 100644 index 0000000000..d086095e7a --- /dev/null +++ b/test/prism/snapshots/seattlerb/rescue_parens.txt @@ -0,0 +1,48 @@ +@ ProgramNode (location: (1,0)-(1,14)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,14)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,14)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :a + ├── message_loc: (1,0)-(1,1) = "a" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,14)) + │ ├── flags: ∅ + │ └── 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)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (1,3)-(1,4) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── keyword_loc: (1,5)-(1,11) = "rescue" + │ │ └── rescue_expression: + │ │ @ CallNode (location: (1,12)-(1,13)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :c + │ │ ├── message_loc: (1,12)-(1,13) = "c" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "(" + │ └── closing_loc: (1,13)-(1,14) = ")" + ├── closing_loc: ∅ + └── block: ∅ 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..8948f7879b --- /dev/null +++ b/test/prism/snapshots/seattlerb/return_call_assocs.txt @@ -0,0 +1,218 @@ +@ ProgramNode (location: (1,0)-(11,14)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(11,14)) + └── body: (length: 6) + ├── @ ReturnNode (location: (1,0)-(1,17)) + │ ├── flags: ∅ + │ ├── keyword_loc: (1,0)-(1,6) = "return" + │ └── arguments: + │ @ ArgumentsNode (location: (1,7)-(1,17)) + │ ├── flags: contains_keywords + │ └── arguments: (length: 2) + │ ├── @ IntegerNode (location: (1,7)-(1,8)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── @ KeywordHashNode (location: (1,10)-(1,17)) + │ ├── flags: symbol_keys + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (1,10)-(1,17)) + │ ├── key: + │ │ @ SymbolNode (location: (1,10)-(1,12)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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 + │ │ └── value: 1 + │ └── operator_loc: (1,13)-(1,15) = "=>" + ├── @ ReturnNode (location: (3,0)-(3,26)) + │ ├── flags: ∅ + │ ├── keyword_loc: (3,0)-(3,6) = "return" + │ └── arguments: + │ @ ArgumentsNode (location: (3,7)-(3,26)) + │ ├── flags: contains_keywords + │ └── arguments: (length: 2) + │ ├── @ IntegerNode (location: (3,7)-(3,8)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── @ KeywordHashNode (location: (3,10)-(3,26)) + │ ├── flags: symbol_keys + │ └── elements: (length: 2) + │ ├── @ AssocNode (location: (3,10)-(3,17)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (3,10)-(3,12)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── 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 + │ │ │ └── value: 1 + │ │ └── operator_loc: (3,13)-(3,15) = "=>" + │ └── @ AssocNode (location: (3,19)-(3,26)) + │ ├── key: + │ │ @ SymbolNode (location: (3,19)-(3,21)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── 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 + │ │ └── value: 2 + │ └── operator_loc: (3,22)-(3,24) = "=>" + ├── @ ReturnNode (location: (5,0)-(5,14)) + │ ├── flags: ∅ + │ ├── keyword_loc: (5,0)-(5,6) = "return" + │ └── arguments: + │ @ ArgumentsNode (location: (5,7)-(5,14)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (5,7)-(5,14)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :y + │ ├── message_loc: (5,7)-(5,8) = "y" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (5,9)-(5,14)) + │ │ ├── flags: contains_keywords + │ │ └── arguments: (length: 1) + │ │ └── @ KeywordHashNode (location: (5,9)-(5,14)) + │ │ ├── flags: symbol_keys + │ │ └── elements: (length: 1) + │ │ └── @ AssocNode (location: (5,9)-(5,14)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (5,9)-(5,11)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── 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 + │ │ │ └── value: 1 + │ │ └── operator_loc: (5,11)-(5,13) = "=>" + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ ReturnNode (location: (7,0)-(7,12)) + │ ├── flags: ∅ + │ ├── keyword_loc: (7,0)-(7,6) = "return" + │ └── arguments: + │ @ ArgumentsNode (location: (7,7)-(7,12)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (7,7)-(7,12)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :y + │ ├── message_loc: (7,7)-(7,8) = "y" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (7,9)-(7,12)) + │ │ ├── flags: contains_keywords + │ │ └── arguments: (length: 1) + │ │ └── @ KeywordHashNode (location: (7,9)-(7,12)) + │ │ ├── flags: symbol_keys + │ │ └── elements: (length: 1) + │ │ └── @ AssocNode (location: (7,9)-(7,12)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (7,9)-(7,11)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── 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 + │ │ │ └── value: 1 + │ │ └── operator_loc: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ ReturnNode (location: (9,0)-(9,13)) + │ ├── flags: ∅ + │ ├── keyword_loc: (9,0)-(9,6) = "return" + │ └── arguments: + │ @ ArgumentsNode (location: (9,7)-(9,13)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (9,7)-(9,13)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :y + │ ├── message_loc: (9,7)-(9,8) = "y" + │ ├── opening_loc: (9,8)-(9,9) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (9,9)-(9,12)) + │ │ ├── flags: contains_keywords + │ │ └── arguments: (length: 1) + │ │ └── @ KeywordHashNode (location: (9,9)-(9,12)) + │ │ ├── flags: symbol_keys + │ │ └── elements: (length: 1) + │ │ └── @ AssocNode (location: (9,9)-(9,12)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (9,9)-(9,11)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── 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 + │ │ │ └── value: 1 + │ │ └── operator_loc: ∅ + │ ├── closing_loc: (9,12)-(9,13) = ")" + │ └── block: ∅ + └── @ ReturnNode (location: (11,0)-(11,14)) + ├── flags: ∅ + ├── keyword_loc: (11,0)-(11,6) = "return" + └── arguments: + @ ArgumentsNode (location: (11,7)-(11,14)) + ├── flags: ∅ + └── arguments: (length: 1) + └── @ CallNode (location: (11,7)-(11,14)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :y + ├── message_loc: (11,7)-(11,8) = "y" + ├── opening_loc: (11,8)-(11,9) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (11,9)-(11,13)) + │ ├── flags: contains_keywords + │ └── arguments: (length: 1) + │ └── @ KeywordHashNode (location: (11,9)-(11,13)) + │ ├── flags: ∅ + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (11,9)-(11,13)) + │ ├── key: + │ │ @ CallNode (location: (11,9)-(11,10)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :z + │ │ ├── message_loc: (11,9)-(11,10) = "z" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── value: + │ │ @ IntegerNode (location: (11,12)-(11,13)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ └── operator_loc: (11,10)-(11,12) = "=>" + ├── closing_loc: (11,13)-(11,14) = ")" + └── block: ∅ diff --git a/test/prism/snapshots/seattlerb/rhs_asgn.txt b/test/prism/snapshots/seattlerb/rhs_asgn.txt new file mode 100644 index 0000000000..9ee187218b --- /dev/null +++ b/test/prism/snapshots/seattlerb/rhs_asgn.txt @@ -0,0 +1,15 @@ +@ 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 + │ └── value: 42 + ├── 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..e7eec943f8 --- /dev/null +++ b/test/prism/snapshots/seattlerb/ruby21_numbers.txt @@ -0,0 +1,25 @@ +@ ProgramNode (location: (1,0)-(1,13)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,13)) + └── body: (length: 1) + └── @ ArrayNode (location: (1,0)-(1,13)) + ├── flags: ∅ + ├── elements: (length: 3) + │ ├── @ ImaginaryNode (location: (1,1)-(1,3)) + │ │ └── numeric: + │ │ @ IntegerNode (location: (1,1)-(1,2)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── @ RationalNode (location: (1,5)-(1,7)) + │ │ ├── flags: decimal + │ │ ├── numerator: 2 + │ │ └── denominator: 1 + │ └── @ ImaginaryNode (location: (1,9)-(1,12)) + │ └── numeric: + │ @ RationalNode (location: (1,9)-(1,11)) + │ ├── flags: decimal + │ ├── numerator: 3 + │ └── denominator: 1 + ├── 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..3cec95ae7c --- /dev/null +++ b/test/prism/snapshots/seattlerb/safe_attrasgn.txt @@ -0,0 +1,31 @@ +@ ProgramNode (location: (1,0)-(1,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,8)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,8)) + ├── flags: safe_navigation, attribute_write + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (1,1)-(1,3) = "&." + ├── name: :b= + ├── message_loc: (1,3)-(1,4) = "b" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,7)-(1,8)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,7)-(1,8)) + │ ├── flags: decimal + │ └── value: 1 + ├── closing_loc: ∅ + └── block: ∅ 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..baea063186 --- /dev/null +++ b/test/prism/snapshots/seattlerb/safe_attrasgn_constant.txt @@ -0,0 +1,31 @@ +@ ProgramNode (location: (1,0)-(1,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,8)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,8)) + ├── flags: safe_navigation, attribute_write + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (1,1)-(1,3) = "&." + ├── name: :B= + ├── message_loc: (1,3)-(1,4) = "B" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,7)-(1,8)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,7)-(1,8)) + │ ├── flags: decimal + │ └── value: 1 + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/prism/snapshots/seattlerb/safe_call.txt b/test/prism/snapshots/seattlerb/safe_call.txt new file mode 100644 index 0000000000..7b402d9ef2 --- /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)) + ├── flags: safe_navigation + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (1,1)-(1,3) = "&." + ├── name: :b + ├── message_loc: (1,3)-(1,4) = "b" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ 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..0a69cbc9e5 --- /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)) + ├── flags: safe_navigation + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (2,0)-(2,2) = "&." + ├── name: :b + ├── message_loc: (2,2)-(2,3) = "b" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ 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..1d6ba9e49e --- /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)) + ├── flags: safe_navigation + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (1,1)-(1,3) = "&." + ├── name: :call + ├── message_loc: ∅ + ├── opening_loc: (1,3)-(1,4) = "(" + ├── arguments: ∅ + ├── closing_loc: (1,4)-(1,5) = ")" + └── block: ∅ 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..7b402d9ef2 --- /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)) + ├── flags: safe_navigation + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (1,1)-(1,3) = "&." + ├── name: :b + ├── message_loc: (1,3)-(1,4) = "b" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ 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..d1f9b1ea9e --- /dev/null +++ b/test/prism/snapshots/seattlerb/safe_call_operator.txt @@ -0,0 +1,31 @@ +@ ProgramNode (location: (1,0)-(1,6)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,6)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,6)) + ├── flags: safe_navigation + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (1,1)-(1,3) = "&." + ├── name: :> + ├── message_loc: (1,3)-(1,4) = ">" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,5)-(1,6)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,5)-(1,6)) + │ ├── flags: decimal + │ └── value: 1 + ├── closing_loc: ∅ + └── block: ∅ 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..34790ebb33 --- /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)) + │ ├── flags: safe_navigation + │ ├── receiver: + │ │ @ CallNode (location: (1,4)-(1,5)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (1,4)-(1,5) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (1,5)-(1,7) = "&." + │ ├── name: :b + │ ├── message_loc: (1,7)-(1,8) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── 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..54e591d9c0 --- /dev/null +++ b/test/prism/snapshots/seattlerb/safe_calls.txt @@ -0,0 +1,41 @@ +@ ProgramNode (location: (1,0)-(1,10)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,10)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,10)) + ├── flags: safe_navigation + ├── receiver: + │ @ CallNode (location: (1,0)-(1,4)) + │ ├── flags: safe_navigation + │ ├── receiver: + │ │ @ CallNode (location: (1,0)-(1,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (1,0)-(1,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (1,1)-(1,3) = "&." + │ ├── name: :b + │ ├── message_loc: (1,3)-(1,4) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (1,4)-(1,6) = "&." + ├── name: :c + ├── message_loc: (1,6)-(1,7) = "c" + ├── opening_loc: (1,7)-(1,8) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (1,8)-(1,9)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,8)-(1,9)) + │ ├── flags: decimal + │ └── value: 1 + ├── closing_loc: (1,9)-(1,10) = ")" + └── block: ∅ 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..ebcedd6b5e --- /dev/null +++ b/test/prism/snapshots/seattlerb/safe_op_asgn.txt @@ -0,0 +1,41 @@ +@ ProgramNode (location: (1,0)-(1,11)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,11)) + └── body: (length: 1) + └── @ CallOperatorWriteNode (location: (1,0)-(1,11)) + ├── flags: safe_navigation + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (1,1)-(1,3) = "&." + ├── message_loc: (1,3)-(1,4) = "b" + ├── read_name: :b + ├── write_name: :b= + ├── binary_operator: :+ + ├── binary_operator_loc: (1,5)-(1,7) = "+=" + └── value: + @ CallNode (location: (1,8)-(1,11)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :x + ├── message_loc: (1,8)-(1,9) = "x" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,10)-(1,11)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,10)-(1,11)) + │ ├── flags: decimal + │ └── value: 1 + ├── closing_loc: ∅ + └── block: ∅ 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..bdb0e06156 --- /dev/null +++ b/test/prism/snapshots/seattlerb/safe_op_asgn2.txt @@ -0,0 +1,34 @@ +@ ProgramNode (location: (1,0)-(2,1)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,1)) + └── body: (length: 1) + └── @ CallOrWriteNode (location: (1,0)-(2,1)) + ├── flags: safe_navigation + ├── receiver: + │ @ CallNode (location: (1,0)-(1,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (1,1)-(1,3) = "&." + ├── message_loc: (1,3)-(1,4) = "b" + ├── read_name: :b + ├── write_name: :b= + ├── operator_loc: (1,5)-(1,8) = "||=" + └── value: + @ CallNode (location: (2,0)-(2,1)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :x + ├── message_loc: (2,0)-(2,1) = "x" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ 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..f9be33ffdd --- /dev/null +++ b/test/prism/snapshots/seattlerb/slashy_newlines_within_string.txt @@ -0,0 +1,57 @@ +@ ProgramNode (location: (1,0)-(6,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(6,5)) + └── body: (length: 2) + ├── @ CallNode (location: (1,0)-(4,8)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :puts + │ ├── message_loc: (1,0)-(1,4) = "puts" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,5)-(4,8)) + │ │ ├── flags: ∅ + │ │ └── 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: ∅ + └── @ CallNode (location: (6,0)-(6,5)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (6,0)-(6,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (6,0)-(6,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: ∅ + ├── name: :+ + ├── message_loc: (6,2)-(6,3) = "+" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (6,4)-(6,5)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (6,4)-(6,5)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :b + │ ├── message_loc: (6,4)-(6,5) = "b" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── closing_loc: ∅ + └── block: ∅ 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..e665565d38 --- /dev/null +++ b/test/prism/snapshots/seattlerb/stabby_arg_no_paren.txt @@ -0,0 +1,28 @@ +@ 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)) + │ │ │ ├── flags: ∅ + │ │ │ └── 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..0b0000ef33 --- /dev/null +++ b/test/prism/snapshots/seattlerb/stabby_arg_opt_splat_arg_block_omfg.txt @@ -0,0 +1,50 @@ +@ 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)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :b + │ │ ├── optionals: (length: 1) + │ │ │ └── @ OptionalParameterNode (location: (1,6)-(1,9)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :c + │ │ │ ├── name_loc: (1,6)-(1,7) = "c" + │ │ │ ├── operator_loc: (1,7)-(1,8) = "=" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (1,8)-(1,9)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── rest: + │ │ │ @ RestParameterNode (location: (1,11)-(1,13)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :d + │ │ │ ├── name_loc: (1,12)-(1,13) = "d" + │ │ │ └── operator_loc: (1,11)-(1,12) = "*" + │ │ ├── posts: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (1,15)-(1,16)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :e + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: + │ │ @ BlockParameterNode (location: (1,18)-(1,20)) + │ │ ├── flags: ∅ + │ │ ├── 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..e51c7d97ed --- /dev/null +++ b/test/prism/snapshots/seattlerb/stabby_block_iter_call.txt @@ -0,0 +1,58 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(4,3)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :x + ├── message_loc: (1,0)-(1,1) = "x" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(4,3)) + │ ├── flags: ∅ + │ └── 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)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (2,0)-(2,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :a + │ │ ├── message_loc: (2,0)-(2,1) = "a" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (2,1)-(2,2) = "." + │ ├── name: :b + │ ├── 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" + ├── closing_loc: ∅ + └── block: ∅ 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..d7a268a5d5 --- /dev/null +++ b/test/prism/snapshots/seattlerb/stabby_block_iter_call_no_target_with_arg.txt @@ -0,0 +1,54 @@ +@ ProgramNode (location: (1,0)-(4,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,3)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(4,3)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :x + ├── message_loc: (1,0)-(1,1) = "x" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(4,3)) + │ ├── flags: ∅ + │ └── 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)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (2,0)-(2,1) = "a" + │ ├── opening_loc: (2,1)-(2,2) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (2,2)-(2,3)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (2,2)-(2,3)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── 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" + ├── closing_loc: ∅ + └── block: ∅ 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..7addbb8b28 --- /dev/null +++ b/test/prism/snapshots/seattlerb/stabby_block_kw.txt @@ -0,0 +1,33 @@ +@ 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) + │ │ │ └── @ OptionalKeywordParameterNode (location: (1,4)-(1,8)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :k + │ │ │ ├── name_loc: (1,4)-(1,6) = "k:" + │ │ │ └── value: + │ │ │ @ IntegerNode (location: (1,6)-(1,8)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 42 + │ │ ├── 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..b5040d91db --- /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) + │ │ │ └── @ RequiredKeywordParameterNode (location: (1,4)-(1,6)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :k + │ │ │ └── name_loc: (1,4)-(1,6) = "k:" + │ │ ├── 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..898f823f24 --- /dev/null +++ b/test/prism/snapshots/seattlerb/stabby_proc_scope.txt @@ -0,0 +1,31 @@ +@ 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)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :a + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 1) + │ │ └── @ BlockLocalVariableNode (location: (1,6)-(1,7)) + │ │ ├── flags: ∅ + │ │ └── 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..ec41a89c38 --- /dev/null +++ b/test/prism/snapshots/seattlerb/str_backslashes.txt @@ -0,0 +1,24 @@ +@ ProgramNode (location: (1,0)-(1,204)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,204)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,204)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :x + ├── message_loc: (1,0)-(1,1) = "x" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,2)-(1,204)) + │ ├── flags: ∅ + │ └── 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: ∅ 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..620b43f631 --- /dev/null +++ b/test/prism/snapshots/seattlerb/str_double_double_escaped_newline.txt @@ -0,0 +1,34 @@ +@ ProgramNode (location: (1,0)-(1,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,9)) + └── body: (length: 2) + ├── @ CallNode (location: (1,0)-(1,7)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,2)-(1,7)) + │ │ ├── flags: ∅ + │ │ └── 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: ∅ + └── @ CallNode (location: (1,8)-(1,9)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :b + ├── message_loc: (1,8)-(1,9) = "b" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ 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..2aee91b75c --- /dev/null +++ b/test/prism/snapshots/seattlerb/str_double_escaped_newline.txt @@ -0,0 +1,34 @@ +@ ProgramNode (location: (1,0)-(1,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,8)) + └── body: (length: 2) + ├── @ CallNode (location: (1,0)-(1,6)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,2)-(1,6)) + │ │ ├── flags: ∅ + │ │ └── 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: ∅ + └── @ CallNode (location: (1,7)-(1,8)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :b + ├── message_loc: (1,7)-(1,8) = "b" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ 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..eb249cde8a --- /dev/null +++ b/test/prism/snapshots/seattlerb/str_double_newline.txt @@ -0,0 +1,34 @@ +@ ProgramNode (location: (1,0)-(2,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,3)) + └── body: (length: 2) + ├── @ CallNode (location: (1,0)-(2,1)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,2)-(2,1)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ StringNode (location: (1,2)-(2,1)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (1,2)-(1,3) = "\"" + │ │ ├── content_loc: (1,3)-(2,0) = "\n" + │ │ ├── closing_loc: (2,0)-(2,1) = "\"" + │ │ └── unescaped: "\n" + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ CallNode (location: (2,2)-(2,3)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :b + ├── message_loc: (2,2)-(2,3) = "b" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/prism/snapshots/seattlerb/str_evstr.txt b/test/prism/snapshots/seattlerb/str_evstr.txt new file mode 100644 index 0000000000..7010ad0a68 --- /dev/null +++ b/test/prism/snapshots/seattlerb/str_evstr.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)) + ├── flags: ∅ + ├── opening_loc: (1,0)-(1,1) = "\"" + ├── parts: (length: 2) + │ ├── @ StringNode (location: (1,1)-(1,3)) + │ │ ├── flags: frozen + │ │ ├── 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)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (1,5)-(1,6) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── 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..3867574c7c --- /dev/null +++ b/test/prism/snapshots/seattlerb/str_evstr_escape.txt @@ -0,0 +1,38 @@ +@ ProgramNode (location: (1,0)-(1,16)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,16)) + └── body: (length: 1) + └── @ InterpolatedStringNode (location: (1,0)-(1,16)) + ├── flags: ∅ + ├── opening_loc: (1,0)-(1,1) = "\"" + ├── parts: (length: 3) + │ ├── @ StringNode (location: (1,1)-(1,3)) + │ │ ├── flags: frozen + │ │ ├── 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)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (1,5)-(1,6) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── closing_loc: (1,6)-(1,7) = "}" + │ └── @ StringNode (location: (1,7)-(1,15)) + │ ├── flags: forced_utf8_encoding, frozen + │ ├── 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..bb7bbba259 --- /dev/null +++ b/test/prism/snapshots/seattlerb/str_heredoc_interp.txt @@ -0,0 +1,32 @@ +@ ProgramNode (location: (1,0)-(1,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,4)) + └── body: (length: 1) + └── @ InterpolatedStringNode (location: (1,0)-(1,4)) + ├── flags: ∅ + ├── 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)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :x + │ │ │ ├── message_loc: (2,2)-(2,3) = "x" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── closing_loc: (2,3)-(2,4) = "}" + │ └── @ StringNode (location: (2,4)-(4,0)) + │ ├── flags: frozen + │ ├── opening_loc: ∅ + │ ├── content_loc: (2,4)-(4,0) = "\nblah2\n" + │ ├── closing_loc: ∅ + │ └── unescaped: "\nblah2\n" + └── closing_loc: (4,0)-(5,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..5a2f435e0e --- /dev/null +++ b/test/prism/snapshots/seattlerb/str_interp_ternary_or_label.txt @@ -0,0 +1,105 @@ +@ ProgramNode (location: (1,0)-(1,23)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,23)) + └── body: (length: 1) + └── @ InterpolatedStringNode (location: (1,0)-(1,23)) + ├── flags: ∅ + ├── 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)) + │ │ │ ├── flags: ∅ + │ │ │ ├── receiver: + │ │ │ │ @ CallNode (location: (1,3)-(1,4)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :a + │ │ │ │ ├── message_loc: (1,3)-(1,4) = "a" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── call_operator_loc: (1,4)-(1,5) = "." + │ │ │ ├── name: :b? + │ │ │ ├── message_loc: (1,5)-(1,7) = "b?" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── then_keyword_loc: (1,8)-(1,9) = "?" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (1,10)-(1,17)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (1,10)-(1,17)) + │ │ │ ├── flags: ∅ + │ │ │ ├── receiver: + │ │ │ │ @ CallNode (location: (1,10)-(1,14)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── 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: ∅ + │ │ │ │ ├── name: :+ + │ │ │ │ ├── message_loc: (1,12)-(1,13) = "+" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: + │ │ │ │ │ @ ArgumentsNode (location: (1,13)-(1,14)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── arguments: (length: 1) + │ │ │ │ │ └── @ CallNode (location: (1,13)-(1,14)) + │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :a + │ │ │ │ │ ├── message_loc: (1,13)-(1,14) = "a" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :+ + │ │ │ ├── message_loc: (1,14)-(1,15) = "+" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (1,15)-(1,17)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── 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: ∅ + │ │ ├── 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..0066f66e84 --- /dev/null +++ b/test/prism/snapshots/seattlerb/str_lit_concat_bad_encodings.txt @@ -0,0 +1,22 @@ +@ ProgramNode (location: (1,0)-(2,66)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,66)) + └── body: (length: 1) + └── @ InterpolatedStringNode (location: (1,0)-(2,66)) + ├── flags: ∅ + ├── opening_loc: ∅ + ├── parts: (length: 2) + │ ├── @ StringNode (location: (1,0)-(1,62)) + │ │ ├── flags: forced_utf8_encoding, frozen + │ │ ├── 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" + │ └── @ StringNode (location: (2,8)-(2,66)) + │ ├── flags: forced_utf8_encoding, frozen + │ ├── 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" + └── closing_loc: ∅ 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..d55d965068 --- /dev/null +++ b/test/prism/snapshots/seattlerb/str_newline_hash_line_number.txt @@ -0,0 +1,14 @@ +@ 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 + └── value: 1 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..1db0e76270 --- /dev/null +++ b/test/prism/snapshots/seattlerb/str_pct_Q_nested.txt @@ -0,0 +1,38 @@ +@ ProgramNode (location: (1,0)-(1,26)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,26)) + └── body: (length: 1) + └── @ InterpolatedStringNode (location: (1,0)-(1,26)) + ├── flags: ∅ + ├── opening_loc: (1,0)-(1,3) = "%Q[" + ├── parts: (length: 3) + │ ├── @ StringNode (location: (1,3)-(1,11)) + │ │ ├── flags: frozen + │ │ ├── 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)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :nest + │ │ │ ├── message_loc: (1,13)-(1,17) = "nest" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── closing_loc: (1,17)-(1,18) = "}" + │ └── @ StringNode (location: (1,18)-(1,25)) + │ ├── flags: frozen + │ ├── 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..22c3031832 --- /dev/null +++ b/test/prism/snapshots/seattlerb/str_pct_nested_nested.txt @@ -0,0 +1,42 @@ +@ ProgramNode (location: (1,0)-(1,20)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,20)) + └── body: (length: 1) + └── @ InterpolatedStringNode (location: (1,0)-(1,20)) + ├── flags: ∅ + ├── opening_loc: (1,0)-(1,2) = "%{" + ├── parts: (length: 3) + │ ├── @ StringNode (location: (1,2)-(1,5)) + │ │ ├── flags: frozen + │ │ ├── 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)) + │ │ │ ├── flags: ∅ + │ │ │ ├── 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 + │ │ │ │ │ └── value: 1 + │ │ │ │ └── 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: frozen + │ ├── 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..8fa8886029 --- /dev/null +++ b/test/prism/snapshots/seattlerb/str_single_double_escaped_newline.txt @@ -0,0 +1,34 @@ +@ ProgramNode (location: (1,0)-(1,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,9)) + └── body: (length: 2) + ├── @ CallNode (location: (1,0)-(1,7)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,2)-(1,7)) + │ │ ├── flags: ∅ + │ │ └── 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: ∅ + └── @ CallNode (location: (1,8)-(1,9)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :b + ├── message_loc: (1,8)-(1,9) = "b" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ 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..c840c7688b --- /dev/null +++ b/test/prism/snapshots/seattlerb/str_single_escaped_newline.txt @@ -0,0 +1,34 @@ +@ ProgramNode (location: (1,0)-(1,8)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,8)) + └── body: (length: 2) + ├── @ CallNode (location: (1,0)-(1,6)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,2)-(1,6)) + │ │ ├── flags: ∅ + │ │ └── 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: ∅ + └── @ CallNode (location: (1,7)-(1,8)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :b + ├── message_loc: (1,7)-(1,8) = "b" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ 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..15b0f2ff72 --- /dev/null +++ b/test/prism/snapshots/seattlerb/str_single_newline.txt @@ -0,0 +1,34 @@ +@ ProgramNode (location: (1,0)-(2,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,3)) + └── body: (length: 2) + ├── @ CallNode (location: (1,0)-(2,1)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,0)-(1,1) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,2)-(2,1)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ StringNode (location: (1,2)-(2,1)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (1,2)-(1,3) = "'" + │ │ ├── content_loc: (1,3)-(2,0) = "\n" + │ │ ├── closing_loc: (2,0)-(2,1) = "'" + │ │ └── unescaped: "\n" + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ CallNode (location: (2,2)-(2,3)) + ├── flags: variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :b + ├── message_loc: (2,2)-(2,3) = "b" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/prism/snapshots/seattlerb/str_str.txt b/test/prism/snapshots/seattlerb/str_str.txt new file mode 100644 index 0000000000..97031c8a65 --- /dev/null +++ b/test/prism/snapshots/seattlerb/str_str.txt @@ -0,0 +1,28 @@ +@ ProgramNode (location: (1,0)-(1,10)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,10)) + └── body: (length: 1) + └── @ InterpolatedStringNode (location: (1,0)-(1,10)) + ├── flags: mutable + ├── opening_loc: (1,0)-(1,1) = "\"" + ├── parts: (length: 2) + │ ├── @ StringNode (location: (1,1)-(1,3)) + │ │ ├── flags: frozen + │ │ ├── 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: frozen + │ │ ├── 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..b592d380ef --- /dev/null +++ b/test/prism/snapshots/seattlerb/str_str_str.txt @@ -0,0 +1,34 @@ +@ ProgramNode (location: (1,0)-(1,12)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,12)) + └── body: (length: 1) + └── @ InterpolatedStringNode (location: (1,0)-(1,12)) + ├── flags: mutable + ├── opening_loc: (1,0)-(1,1) = "\"" + ├── parts: (length: 3) + │ ├── @ StringNode (location: (1,1)-(1,3)) + │ │ ├── flags: frozen + │ │ ├── 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: frozen + │ │ │ ├── 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: frozen + │ ├── 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..61b5f0b631 --- /dev/null +++ b/test/prism/snapshots/seattlerb/super_arg.txt @@ -0,0 +1,17 @@ +@ 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)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,6)-(1,8)) + │ ├── flags: decimal + │ └── value: 42 + ├── 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..e95543e925 --- /dev/null +++ b/test/prism/snapshots/seattlerb/symbol_empty.txt @@ -0,0 +1,11 @@ +@ ProgramNode (location: (1,0)-(1,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,3)) + └── body: (length: 1) + └── @ SymbolNode (location: (1,0)-(1,3)) + ├── flags: forced_us_ascii_encoding + ├── 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..6750160d50 --- /dev/null +++ b/test/prism/snapshots/seattlerb/symbol_list.txt @@ -0,0 +1,50 @@ +@ ProgramNode (location: (1,0)-(1,13)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,13)) + └── body: (length: 1) + └── @ ArrayNode (location: (1,0)-(1,13)) + ├── flags: ∅ + ├── 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)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :a + │ │ │ │ ├── message_loc: (1,5)-(1,6) = "a" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── 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)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :b + │ │ │ ├── message_loc: (1,10)-(1,11) = "b" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── 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..30cf57c528 --- /dev/null +++ b/test/prism/snapshots/seattlerb/symbols.txt @@ -0,0 +1,28 @@ +@ ProgramNode (location: (1,0)-(1,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,9)) + └── body: (length: 1) + └── @ ArrayNode (location: (1,0)-(1,9)) + ├── flags: ∅ + ├── elements: (length: 3) + │ ├── @ SymbolNode (location: (1,3)-(1,4)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (1,3)-(1,4) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── @ SymbolNode (location: (1,5)-(1,6)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (1,5)-(1,6) = "b" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "b" + │ └── @ SymbolNode (location: (1,7)-(1,8)) + │ ├── flags: forced_us_ascii_encoding + │ ├── 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..dc743e2be5 --- /dev/null +++ b/test/prism/snapshots/seattlerb/symbols_empty.txt @@ -0,0 +1,10 @@ +@ ProgramNode (location: (1,0)-(1,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,4)) + └── body: (length: 1) + └── @ ArrayNode (location: (1,0)-(1,4)) + ├── flags: ∅ + ├── 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..ea7ada9446 --- /dev/null +++ b/test/prism/snapshots/seattlerb/symbols_empty_space.txt @@ -0,0 +1,10 @@ +@ ProgramNode (location: (1,0)-(1,5)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,5)) + └── body: (length: 1) + └── @ ArrayNode (location: (1,0)-(1,5)) + ├── flags: ∅ + ├── 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..2ad3cc502d --- /dev/null +++ b/test/prism/snapshots/seattlerb/symbols_interp.txt @@ -0,0 +1,28 @@ +@ ProgramNode (location: (1,0)-(1,15)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,15)) + └── body: (length: 1) + └── @ ArrayNode (location: (1,0)-(1,15)) + ├── flags: ∅ + ├── elements: (length: 3) + │ ├── @ SymbolNode (location: (1,3)-(1,4)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (1,3)-(1,4) = "a" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "a" + │ ├── @ SymbolNode (location: (1,5)-(1,12)) + │ │ ├── flags: forced_us_ascii_encoding + │ │ ├── opening_loc: ∅ + │ │ ├── value_loc: (1,5)-(1,12) = "b\#{1+1}" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "b\#{1+1}" + │ └── @ SymbolNode (location: (1,13)-(1,14)) + │ ├── flags: forced_us_ascii_encoding + │ ├── 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..4dd2ac44a6 --- /dev/null +++ b/test/prism/snapshots/seattlerb/thingy.txt @@ -0,0 +1,57 @@ +@ ProgramNode (location: (1,0)-(3,7)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,7)) + └── body: (length: 2) + ├── @ CallNode (location: (1,0)-(1,6)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (1,0)-(1,1)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :f + │ │ ├── message_loc: (1,0)-(1,1) = "f" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: (1,1)-(1,2) = "." + │ ├── name: :call + │ ├── message_loc: ∅ + │ ├── opening_loc: (1,2)-(1,3) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,3)-(1,5)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (1,3)-(1,5)) + │ │ ├── flags: decimal + │ │ └── value: 42 + │ ├── closing_loc: (1,5)-(1,6) = ")" + │ └── block: ∅ + └── @ CallNode (location: (3,0)-(3,7)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (3,0)-(3,1)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :f + │ ├── message_loc: (3,0)-(3,1) = "f" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: (3,1)-(3,3) = "::" + ├── name: :call + ├── message_loc: ∅ + ├── opening_loc: (3,3)-(3,4) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (3,4)-(3,6)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (3,4)-(3,6)) + │ ├── flags: decimal + │ └── value: 42 + ├── closing_loc: (3,6)-(3,7) = ")" + └── block: ∅ diff --git a/test/prism/snapshots/seattlerb/uminus_float.txt b/test/prism/snapshots/seattlerb/uminus_float.txt new file mode 100644 index 0000000000..0578dbbd68 --- /dev/null +++ b/test/prism/snapshots/seattlerb/uminus_float.txt @@ -0,0 +1,7 @@ +@ ProgramNode (location: (1,0)-(1,4)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,4)) + └── body: (length: 1) + └── @ FloatNode (location: (1,0)-(1,4)) + └── value: -0.0 diff --git a/test/prism/snapshots/seattlerb/unary_minus.txt b/test/prism/snapshots/seattlerb/unary_minus.txt new file mode 100644 index 0000000000..79889bffb0 --- /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)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,1)-(1,2)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,1)-(1,2) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: ∅ + ├── name: :-@ + ├── message_loc: (1,0)-(1,1) = "-" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/prism/snapshots/seattlerb/unary_plus.txt b/test/prism/snapshots/seattlerb/unary_plus.txt new file mode 100644 index 0000000000..b570cbf73b --- /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)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,1)-(1,2)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,1)-(1,2) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: ∅ + ├── name: :+@ + ├── message_loc: (1,0)-(1,1) = "+" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ 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..4deb857536 --- /dev/null +++ b/test/prism/snapshots/seattlerb/unary_plus_on_literal.txt @@ -0,0 +1,21 @@ +@ ProgramNode (location: (1,0)-(1,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,3)) + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,3)) + ├── flags: ∅ + ├── receiver: + │ @ SymbolNode (location: (1,1)-(1,3)) + │ ├── flags: forced_us_ascii_encoding + │ ├── opening_loc: (1,1)-(1,2) = ":" + │ ├── value_loc: (1,2)-(1,3) = "a" + │ ├── closing_loc: ∅ + │ └── unescaped: "a" + ├── call_operator_loc: ∅ + ├── name: :+@ + ├── message_loc: (1,0)-(1,1) = "+" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/prism/snapshots/seattlerb/unary_tilde.txt b/test/prism/snapshots/seattlerb/unary_tilde.txt new file mode 100644 index 0000000000..5fd1a5d00e --- /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)) + ├── flags: ∅ + ├── receiver: + │ @ CallNode (location: (1,1)-(1,2)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,1)-(1,2) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: ∅ + ├── name: :~ + ├── message_loc: (1,0)-(1,1) = "~" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/prism/snapshots/seattlerb/utf8_bom.txt b/test/prism/snapshots/seattlerb/utf8_bom.txt new file mode 100644 index 0000000000..9f0eb83b05 --- /dev/null +++ b/test/prism/snapshots/seattlerb/utf8_bom.txt @@ -0,0 +1,21 @@ +@ ProgramNode (location: (2,0)-(2,3)) +├── locals: [] +└── statements: + @ StatementsNode (location: (2,0)-(2,3)) + └── body: (length: 1) + └── @ CallNode (location: (2,0)-(2,3)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :p + ├── message_loc: (2,0)-(2,1) = "p" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (2,2)-(2,3)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (2,2)-(2,3)) + │ ├── flags: decimal + │ └── value: 0 + ├── closing_loc: ∅ + └── block: ∅ diff --git a/test/prism/snapshots/seattlerb/when_splat.txt b/test/prism/snapshots/seattlerb/when_splat.txt new file mode 100644 index 0000000000..19e70019c0 --- /dev/null +++ b/test/prism/snapshots/seattlerb/when_splat.txt @@ -0,0 +1,39 @@ +@ 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)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :a + │ ├── message_loc: (1,5)-(1,6) = "a" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── conditions: (length: 1) + │ └── @ WhenNode (location: (1,8)-(1,20)) + │ ├── 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)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :b + │ │ ├── message_loc: (1,14)-(1,15) = "b" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── then_keyword_loc: (1,16)-(1,20) = "then" + │ └── 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..1175a6f476 --- /dev/null +++ b/test/prism/snapshots/seattlerb/words_interp.txt @@ -0,0 +1,30 @@ +@ ProgramNode (location: (1,0)-(1,9)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,9)) + └── body: (length: 1) + └── @ ArrayNode (location: (1,0)-(1,9)) + ├── flags: ∅ + ├── elements: (length: 1) + │ └── @ InterpolatedStringNode (location: (1,3)-(1,8)) + │ ├── flags: ∅ + │ ├── 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 + │ │ │ │ └── value: 1 + │ │ │ └── closing_loc: (1,6)-(1,7) = "}" + │ │ └── @ StringNode (location: (1,7)-(1,8)) + │ │ ├── flags: frozen + │ │ ├── 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..22e0c14f83 --- /dev/null +++ b/test/prism/snapshots/seattlerb/yield_arg.txt @@ -0,0 +1,16 @@ +@ 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)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ IntegerNode (location: (1,6)-(1,8)) + │ ├── flags: decimal + │ └── value: 42 + └── 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..c04273f5aa --- /dev/null +++ b/test/prism/snapshots/seattlerb/yield_call_assocs.txt @@ -0,0 +1,224 @@ +@ 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)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ IntegerNode (location: (1,6)-(1,7)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── @ KeywordHashNode (location: (1,9)-(1,16)) + │ │ ├── flags: symbol_keys + │ │ └── elements: (length: 1) + │ │ └── @ AssocNode (location: (1,9)-(1,16)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (1,9)-(1,11)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── 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 + │ │ │ └── value: 1 + │ │ └── 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)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ IntegerNode (location: (3,6)-(3,7)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── @ KeywordHashNode (location: (3,9)-(3,25)) + │ │ ├── flags: symbol_keys + │ │ └── elements: (length: 2) + │ │ ├── @ AssocNode (location: (3,9)-(3,16)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (3,9)-(3,11)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── 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 + │ │ │ │ └── value: 1 + │ │ │ └── operator_loc: (3,12)-(3,14) = "=>" + │ │ └── @ AssocNode (location: (3,18)-(3,25)) + │ │ ├── key: + │ │ │ @ SymbolNode (location: (3,18)-(3,20)) + │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ ├── 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 + │ │ │ └── value: 2 + │ │ └── 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)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (5,6)-(5,13)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :y + │ │ ├── message_loc: (5,6)-(5,7) = "y" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (5,8)-(5,13)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ KeywordHashNode (location: (5,8)-(5,13)) + │ │ │ ├── flags: symbol_keys + │ │ │ └── elements: (length: 1) + │ │ │ └── @ AssocNode (location: (5,8)-(5,13)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (5,8)-(5,10)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── 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 + │ │ │ │ └── value: 1 + │ │ │ └── operator_loc: (5,10)-(5,12) = "=>" + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── rparen_loc: ∅ + ├── @ YieldNode (location: (7,0)-(7,11)) + │ ├── keyword_loc: (7,0)-(7,5) = "yield" + │ ├── lparen_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (7,6)-(7,11)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (7,6)-(7,11)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :y + │ │ ├── message_loc: (7,6)-(7,7) = "y" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (7,8)-(7,11)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ KeywordHashNode (location: (7,8)-(7,11)) + │ │ │ ├── flags: symbol_keys + │ │ │ └── elements: (length: 1) + │ │ │ └── @ AssocNode (location: (7,8)-(7,11)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (7,8)-(7,10)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── 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 + │ │ │ │ └── value: 1 + │ │ │ └── operator_loc: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── rparen_loc: ∅ + ├── @ YieldNode (location: (9,0)-(9,12)) + │ ├── keyword_loc: (9,0)-(9,5) = "yield" + │ ├── lparen_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (9,6)-(9,12)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (9,6)-(9,12)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :y + │ │ ├── message_loc: (9,6)-(9,7) = "y" + │ │ ├── opening_loc: (9,7)-(9,8) = "(" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (9,8)-(9,11)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ KeywordHashNode (location: (9,8)-(9,11)) + │ │ │ ├── flags: symbol_keys + │ │ │ └── elements: (length: 1) + │ │ │ └── @ AssocNode (location: (9,8)-(9,11)) + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (9,8)-(9,10)) + │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ ├── 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 + │ │ │ │ └── value: 1 + │ │ │ └── operator_loc: ∅ + │ │ ├── closing_loc: (9,11)-(9,12) = ")" + │ │ └── block: ∅ + │ └── rparen_loc: ∅ + └── @ YieldNode (location: (11,0)-(11,13)) + ├── keyword_loc: (11,0)-(11,5) = "yield" + ├── lparen_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (11,6)-(11,13)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (11,6)-(11,13)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :y + │ ├── message_loc: (11,6)-(11,7) = "y" + │ ├── opening_loc: (11,7)-(11,8) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (11,8)-(11,12)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ KeywordHashNode (location: (11,8)-(11,12)) + │ │ ├── flags: ∅ + │ │ └── elements: (length: 1) + │ │ └── @ AssocNode (location: (11,8)-(11,12)) + │ │ ├── key: + │ │ │ @ CallNode (location: (11,8)-(11,9)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :z + │ │ │ ├── message_loc: (11,8)-(11,9) = "z" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── value: + │ │ │ @ IntegerNode (location: (11,11)-(11,12)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── operator_loc: (11,9)-(11,11) = "=>" + │ ├── closing_loc: (11,12)-(11,13) = ")" + │ └── block: ∅ + └── 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) = ")" |