diff options
| author | Kevin Newton <kddnewton@gmail.com> | 2024-04-02 12:19:39 -0400 |
|---|---|---|
| committer | Kevin Newton <kddnewton@gmail.com> | 2024-04-03 17:34:12 -0400 |
| commit | e454cf22023c95e80689bb26ab1abd2775015fbf (patch) | |
| tree | 0fa16c4d9723184daf177c844d5338de43c55732 /test | |
| parent | 7d9e5061aae276d1533bd0f9f6cdb09cad75881b (diff) | |
[ruby/prism] Update fixtures to be all valid Ruby
https://github.com/ruby/prism/commit/a0b978d25b
Diffstat (limited to 'test')
51 files changed, 1400 insertions, 1771 deletions
diff --git a/test/prism/fixtures/break.txt b/test/prism/fixtures/break.txt index 61859d8a8a..82fa45bdb4 100644 --- a/test/prism/fixtures/break.txt +++ b/test/prism/fixtures/break.txt @@ -1,24 +1,24 @@ -break +tap { break } -break (1), (2), (3) +tap { break (1), (2), (3) } -break 1 +tap { break 1 } -break 1, 2, -3 +tap { break 1, 2, +3 } -break 1, 2, 3 +tap { break 1, 2, 3 } -break [1, 2, 3] +tap { break [1, 2, 3] } -break( +tap { break( 1 2 -) +) } -break() +tap { break() } -break(1) +tap { break(1) } foo { break 42 } == 42 diff --git a/test/prism/fixtures/if.txt b/test/prism/fixtures/if.txt index c5281a6693..cede644a4c 100644 --- a/test/prism/fixtures/if.txt +++ b/test/prism/fixtures/if.txt @@ -7,13 +7,13 @@ if true then true elsif false then false elsif nil then nil else self end 1 if true -break if true +tap { break if true } -next if true +tap { next if true } return if true -if exit_loop then break 42 end +tap { if exit_loop then break 42 end } if foo then bar diff --git a/test/prism/fixtures/keywords.txt b/test/prism/fixtures/keywords.txt index 90cdfb41c7..6d24a9f476 100644 --- a/test/prism/fixtures/keywords.txt +++ b/test/prism/fixtures/keywords.txt @@ -1,6 +1,6 @@ -redo +tap { redo } -retry +begin; rescue; retry; end self diff --git a/test/prism/fixtures/next.txt b/test/prism/fixtures/next.txt index 476f17ffe3..2ef14c6304 100644 --- a/test/prism/fixtures/next.txt +++ b/test/prism/fixtures/next.txt @@ -1,24 +1,24 @@ -next +tap { next } -next (1), (2), (3) +tap { next (1), (2), (3) } -next 1 +tap { next 1 } -next 1, 2, -3 +tap { next 1, 2, +3 } -next 1, 2, 3 +tap { next 1, 2, 3 } -next [1, 2, 3] +tap { next [1, 2, 3] } -next( +tap { next( 1 2 -) +) } -next -1 +tap { next +1 } -next() +tap { next() } -next(1) +tap { next(1) } diff --git a/test/prism/fixtures/rescue.txt b/test/prism/fixtures/rescue.txt index 7cce866379..99170fbe0f 100644 --- a/test/prism/fixtures/rescue.txt +++ b/test/prism/fixtures/rescue.txt @@ -3,9 +3,9 @@ foo rescue nil foo rescue nil -break rescue nil +tap { break rescue nil } -next rescue nil +tap { next rescue nil } return rescue nil diff --git a/test/prism/fixtures/seattlerb/block_break.txt b/test/prism/fixtures/seattlerb/block_break.txt deleted file mode 100644 index 35eabee187..0000000000 --- a/test/prism/fixtures/seattlerb/block_break.txt +++ /dev/null @@ -1 +0,0 @@ -break foo arg do |bar| end diff --git a/test/prism/fixtures/seattlerb/block_next.txt b/test/prism/fixtures/seattlerb/block_next.txt deleted file mode 100644 index 760fcbf809..0000000000 --- a/test/prism/fixtures/seattlerb/block_next.txt +++ /dev/null @@ -1 +0,0 @@ -next foo arg do |bar| end diff --git a/test/prism/fixtures/seattlerb/dasgn_icky2.txt b/test/prism/fixtures/seattlerb/dasgn_icky2.txt deleted file mode 100644 index 2f50d32304..0000000000 --- a/test/prism/fixtures/seattlerb/dasgn_icky2.txt +++ /dev/null @@ -1,8 +0,0 @@ -a do - v = nil - begin - yield - rescue Exception => v - break - end -end diff --git a/test/prism/fixtures/seattlerb/yield_arg.txt b/test/prism/fixtures/seattlerb/yield_arg.txt deleted file mode 100644 index 7e752f62e2..0000000000 --- a/test/prism/fixtures/seattlerb/yield_arg.txt +++ /dev/null @@ -1 +0,0 @@ -yield 42 diff --git a/test/prism/fixtures/seattlerb/yield_call_assocs.txt b/test/prism/fixtures/seattlerb/yield_call_assocs.txt deleted file mode 100644 index 95963dfcf9..0000000000 --- a/test/prism/fixtures/seattlerb/yield_call_assocs.txt +++ /dev/null @@ -1,11 +0,0 @@ -yield 1, :z => 1 - -yield 1, :z => 1, :w => 2 - -yield y :z=>1 - -yield y z:1 - -yield y(z:1) - -yield y(z=>1) diff --git a/test/prism/fixtures/seattlerb/yield_empty_parens.txt b/test/prism/fixtures/seattlerb/yield_empty_parens.txt deleted file mode 100644 index cff86b243a..0000000000 --- a/test/prism/fixtures/seattlerb/yield_empty_parens.txt +++ /dev/null @@ -1 +0,0 @@ -yield() diff --git a/test/prism/fixtures/unless.txt b/test/prism/fixtures/unless.txt index 410d460e69..678d58991b 100644 --- a/test/prism/fixtures/unless.txt +++ b/test/prism/fixtures/unless.txt @@ -5,9 +5,9 @@ unless true 1 unless true -break unless true +tap { break unless true } -next unless true +tap { next unless true } return unless true diff --git a/test/prism/fixtures/unparser/corpus/literal/control.txt b/test/prism/fixtures/unparser/corpus/literal/control.txt deleted file mode 100644 index 648782bc96..0000000000 --- a/test/prism/fixtures/unparser/corpus/literal/control.txt +++ /dev/null @@ -1,15 +0,0 @@ -next -return -break -retry -redo -return 1 -return 1, 2 -return true ? 1 : 2 -break true ? 1 : 2 -next true ? 1 : 2 -return true, if true - 1 -else - 2 -end diff --git a/test/prism/fixtures/unparser/corpus/literal/yield.txt b/test/prism/fixtures/unparser/corpus/literal/yield.txt deleted file mode 100644 index c0b5820842..0000000000 --- a/test/prism/fixtures/unparser/corpus/literal/yield.txt +++ /dev/null @@ -1,3 +0,0 @@ -yield -yield(a) -yield(a, b) diff --git a/test/prism/fixtures/until.txt b/test/prism/fixtures/until.txt index 7dcb5d495d..652fc8c5a7 100644 --- a/test/prism/fixtures/until.txt +++ b/test/prism/fixtures/until.txt @@ -2,9 +2,9 @@ until true; 1; end 1 until true -break until true +tap { break until true } -next until true +tap { next until true } return until true diff --git a/test/prism/fixtures/while.txt b/test/prism/fixtures/while.txt index eecfbfdddd..b776f755ee 100644 --- a/test/prism/fixtures/while.txt +++ b/test/prism/fixtures/while.txt @@ -2,21 +2,21 @@ while true; 1; end 1 while true -break while true +tap { break while true } -next while true +tap { next while true } return while true foo :a, :b while bar? -while def self.foo a = tap do end; end; break; end +tap { while def self.foo a = tap do end; end; break; end } -while class Foo a = tap do end; end; break; end +tap { while class Foo a = tap do end; end; break; end } -while class << self; tap do end; end; break; end +tap { while class << self; tap do end; end; break; end } -while class << self; a = tap do end; end; break; end +tap { while class << self; a = tap do end; end; break; end } while def foo = bar do end; end diff --git a/test/prism/fixtures/whitequark/args_assocs.txt b/test/prism/fixtures/whitequark/args_assocs.txt deleted file mode 100644 index b33e131181..0000000000 --- a/test/prism/fixtures/whitequark/args_assocs.txt +++ /dev/null @@ -1,11 +0,0 @@ -fun(:foo => 1) - -fun(:foo => 1, &baz) - -self.[]= foo, :a => 1 - -self[:bar => 1] - -super(:foo => 42) - -yield(:foo => 42) diff --git a/test/prism/fixtures/whitequark/args_assocs_legacy.txt b/test/prism/fixtures/whitequark/args_assocs_legacy.txt deleted file mode 100644 index b33e131181..0000000000 --- a/test/prism/fixtures/whitequark/args_assocs_legacy.txt +++ /dev/null @@ -1,11 +0,0 @@ -fun(:foo => 1) - -fun(:foo => 1, &baz) - -self.[]= foo, :a => 1 - -self[:bar => 1] - -super(:foo => 42) - -yield(:foo => 42) diff --git a/test/prism/fixtures/whitequark/break.txt b/test/prism/fixtures/whitequark/break.txt deleted file mode 100644 index da51ec7c31..0000000000 --- a/test/prism/fixtures/whitequark/break.txt +++ /dev/null @@ -1,7 +0,0 @@ -break - -break foo - -break() - -break(foo) diff --git a/test/prism/fixtures/whitequark/break_block.txt b/test/prism/fixtures/whitequark/break_block.txt deleted file mode 100644 index 4b58c58d5e..0000000000 --- a/test/prism/fixtures/whitequark/break_block.txt +++ /dev/null @@ -1 +0,0 @@ -break fun foo do end diff --git a/test/prism/fixtures/whitequark/class_definition_in_while_cond.txt b/test/prism/fixtures/whitequark/class_definition_in_while_cond.txt deleted file mode 100644 index 10427314b5..0000000000 --- a/test/prism/fixtures/whitequark/class_definition_in_while_cond.txt +++ /dev/null @@ -1,7 +0,0 @@ -while class << self; a = tap do end; end; break; end - -while class << self; tap do end; end; break; end - -while class Foo a = tap do end; end; break; end - -while class Foo; tap do end; end; break; end diff --git a/test/prism/fixtures/whitequark/if_while_after_class__since_32.txt b/test/prism/fixtures/whitequark/if_while_after_class__since_32.txt deleted file mode 100644 index 1552494d28..0000000000 --- a/test/prism/fixtures/whitequark/if_while_after_class__since_32.txt +++ /dev/null @@ -1,7 +0,0 @@ -class if true; Object end::Kernel; end - -class while true; break Object end::Kernel; end - -module if true; Object end::Kernel; end - -module while true; break Object end::Kernel; end diff --git a/test/prism/fixtures/whitequark/method_definition_in_while_cond.txt b/test/prism/fixtures/whitequark/method_definition_in_while_cond.txt deleted file mode 100644 index 6ec38906a1..0000000000 --- a/test/prism/fixtures/whitequark/method_definition_in_while_cond.txt +++ /dev/null @@ -1,7 +0,0 @@ -while def foo a = tap do end; end; break; end - -while def foo; tap do end; end; break; end - -while def self.foo a = tap do end; end; break; end - -while def self.foo; tap do end; end; break; end diff --git a/test/prism/fixtures/whitequark/next.txt b/test/prism/fixtures/whitequark/next.txt deleted file mode 100644 index 7556ac2b74..0000000000 --- a/test/prism/fixtures/whitequark/next.txt +++ /dev/null @@ -1,7 +0,0 @@ -next - -next foo - -next() - -next(foo) diff --git a/test/prism/fixtures/whitequark/next_block.txt b/test/prism/fixtures/whitequark/next_block.txt deleted file mode 100644 index d3b51dfa21..0000000000 --- a/test/prism/fixtures/whitequark/next_block.txt +++ /dev/null @@ -1 +0,0 @@ -next fun foo do end diff --git a/test/prism/fixtures/whitequark/redo.txt b/test/prism/fixtures/whitequark/redo.txt deleted file mode 100644 index f49789cbab..0000000000 --- a/test/prism/fixtures/whitequark/redo.txt +++ /dev/null @@ -1 +0,0 @@ -redo diff --git a/test/prism/fixtures/whitequark/retry.txt b/test/prism/fixtures/whitequark/retry.txt deleted file mode 100644 index 77428f7b73..0000000000 --- a/test/prism/fixtures/whitequark/retry.txt +++ /dev/null @@ -1 +0,0 @@ -retry diff --git a/test/prism/fixtures/whitequark/yield.txt b/test/prism/fixtures/whitequark/yield.txt deleted file mode 100644 index 0ecf639589..0000000000 --- a/test/prism/fixtures/whitequark/yield.txt +++ /dev/null @@ -1,7 +0,0 @@ -yield - -yield foo - -yield() - -yield(foo) diff --git a/test/prism/fixtures/yield.txt b/test/prism/fixtures/yield.txt index d75ab57a18..752ba27a2e 100644 --- a/test/prism/fixtures/yield.txt +++ b/test/prism/fixtures/yield.txt @@ -1,7 +1,7 @@ -yield +def foo; yield; end -yield() +def foo; yield(); end -yield(1) +def foo; yield(1); end -yield(1, 2, 3) +def foo; yield(1, 2, 3); end diff --git a/test/prism/parse_test.rb b/test/prism/parse_test.rb index 4255553f51..735066332c 100644 --- a/test/prism/parse_test.rb +++ b/test/prism/parse_test.rb @@ -197,12 +197,14 @@ module Prism # It seems like there are some oddities with nested heredocs and ripper. # Waiting for feedback on https://bugs.ruby-lang.org/issues/19838. ripper_should_match = false if relative == "seattlerb/heredoc_nested.txt" + ripper_should_match = false if relative == "whitequark/dedenting_heredoc.txt" # Ripper seems to have a bug that the regex portions before and after the heredoc are combined # into a single token. See https://bugs.ruby-lang.org/issues/19838. # # Additionally, Ripper cannot parse the %w[] fixture in this file, so set ripper_should_parse to false. ripper_should_parse = false if relative == "spanning_heredoc.txt" + ripper_should_match = false if relative == "spanning_heredoc_newlines.txt" # Ruby < 3.3.0 cannot parse heredocs where there are leading whitespace characters in the heredoc start. # Example: <<~' EOF' or <<-' EOF' @@ -215,24 +217,9 @@ module Prism source = File.read(filepath, binmode: true, external_encoding: Encoding::UTF_8) if ripper_should_parse - src = source - - case relative - when /break|next|redo|if|unless|rescue|control|keywords|retry/ - # Uncaught syntax errors: Invalid break, Invalid next - src = "->do\nrescue\n#{src}\nend" - ripper_should_match = false - end - case src - when /^ *yield/ - # Uncaught syntax errors: Invalid yield - src = "def __invalid_yield__\n#{src}\nend" - ripper_should_match = false - end - - # Make sure that it can be correctly parsed by Ripper. If it can't, then we have a fixture - # that is invalid Ruby. - refute_nil(Ripper.sexp_raw(src), "Ripper failed to parse") + # Make sure that it can be correctly parsed by Ripper. If it can't, + # then we have a fixture that is invalid Ruby. + refute_nil(Ripper.sexp_raw(source), "Ripper failed to parse") end # Next, assert that there were no errors during parsing. diff --git a/test/prism/snapshots/break.txt b/test/prism/snapshots/break.txt index 984b9f7f22..c15a9e4675 100644 --- a/test/prism/snapshots/break.txt +++ b/test/prism/snapshots/break.txt @@ -3,144 +3,306 @@ └── statements: @ StatementsNode (location: (1,0)-(25,23)) └── body: (length: 11) - ├── @ BreakNode (location: (1,0)-(1,5)) + ├── @ CallNode (location: (1,0)-(1,13)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :tap + │ ├── message_loc: (1,0)-(1,3) = "tap" + │ ├── opening_loc: ∅ │ ├── arguments: ∅ - │ └── keyword_loc: (1,0)-(1,5) = "break" - ├── @ BreakNode (location: (3,0)-(3,19)) - │ ├── arguments: - │ │ @ ArgumentsNode (location: (3,6)-(3,19)) - │ │ ├── flags: ∅ - │ │ └── arguments: (length: 3) - │ │ ├── @ ParenthesesNode (location: (3,6)-(3,9)) - │ │ │ ├── body: - │ │ │ │ @ StatementsNode (location: (3,7)-(3,8)) - │ │ │ │ └── body: (length: 1) - │ │ │ │ └── @ IntegerNode (location: (3,7)-(3,8)) - │ │ │ │ ├── flags: decimal - │ │ │ │ └── value: 1 - │ │ │ ├── opening_loc: (3,6)-(3,7) = "(" - │ │ │ └── closing_loc: (3,8)-(3,9) = ")" - │ │ ├── @ ParenthesesNode (location: (3,11)-(3,14)) - │ │ │ ├── body: - │ │ │ │ @ StatementsNode (location: (3,12)-(3,13)) - │ │ │ │ └── body: (length: 1) - │ │ │ │ └── @ IntegerNode (location: (3,12)-(3,13)) - │ │ │ │ ├── flags: decimal - │ │ │ │ └── value: 2 - │ │ │ ├── opening_loc: (3,11)-(3,12) = "(" - │ │ │ └── closing_loc: (3,13)-(3,14) = ")" - │ │ └── @ ParenthesesNode (location: (3,16)-(3,19)) - │ │ ├── body: - │ │ │ @ StatementsNode (location: (3,17)-(3,18)) - │ │ │ └── body: (length: 1) - │ │ │ └── @ IntegerNode (location: (3,17)-(3,18)) - │ │ │ ├── flags: decimal - │ │ │ └── value: 3 - │ │ ├── opening_loc: (3,16)-(3,17) = "(" - │ │ └── closing_loc: (3,18)-(3,19) = ")" - │ └── keyword_loc: (3,0)-(3,5) = "break" - ├── @ BreakNode (location: (5,0)-(5,7)) - │ ├── arguments: - │ │ @ ArgumentsNode (location: (5,6)-(5,7)) - │ │ ├── flags: ∅ - │ │ └── arguments: (length: 1) - │ │ └── @ IntegerNode (location: (5,6)-(5,7)) - │ │ ├── flags: decimal - │ │ └── value: 1 - │ └── keyword_loc: (5,0)-(5,5) = "break" - ├── @ BreakNode (location: (7,0)-(8,1)) - │ ├── arguments: - │ │ @ ArgumentsNode (location: (7,6)-(8,1)) - │ │ ├── flags: ∅ - │ │ └── arguments: (length: 3) - │ │ ├── @ IntegerNode (location: (7,6)-(7,7)) - │ │ │ ├── flags: decimal - │ │ │ └── value: 1 - │ │ ├── @ IntegerNode (location: (7,9)-(7,10)) - │ │ │ ├── flags: decimal - │ │ │ └── value: 2 - │ │ └── @ IntegerNode (location: (8,0)-(8,1)) - │ │ ├── flags: decimal - │ │ └── value: 3 - │ └── keyword_loc: (7,0)-(7,5) = "break" - ├── @ BreakNode (location: (10,0)-(10,13)) - │ ├── arguments: - │ │ @ ArgumentsNode (location: (10,6)-(10,13)) - │ │ ├── flags: ∅ - │ │ └── arguments: (length: 3) - │ │ ├── @ IntegerNode (location: (10,6)-(10,7)) - │ │ │ ├── flags: decimal - │ │ │ └── value: 1 - │ │ ├── @ IntegerNode (location: (10,9)-(10,10)) - │ │ │ ├── flags: decimal - │ │ │ └── value: 2 - │ │ └── @ IntegerNode (location: (10,12)-(10,13)) - │ │ ├── flags: decimal - │ │ └── value: 3 - │ └── keyword_loc: (10,0)-(10,5) = "break" - ├── @ BreakNode (location: (12,0)-(12,15)) - │ ├── arguments: - │ │ @ ArgumentsNode (location: (12,6)-(12,15)) - │ │ ├── flags: ∅ - │ │ └── arguments: (length: 1) - │ │ └── @ ArrayNode (location: (12,6)-(12,15)) - │ │ ├── flags: ∅ - │ │ ├── elements: (length: 3) - │ │ │ ├── @ IntegerNode (location: (12,7)-(12,8)) - │ │ │ │ ├── flags: decimal - │ │ │ │ └── value: 1 - │ │ │ ├── @ IntegerNode (location: (12,10)-(12,11)) - │ │ │ │ ├── flags: decimal - │ │ │ │ └── value: 2 - │ │ │ └── @ IntegerNode (location: (12,13)-(12,14)) - │ │ │ ├── flags: decimal - │ │ │ └── value: 3 - │ │ ├── opening_loc: (12,6)-(12,7) = "[" - │ │ └── closing_loc: (12,14)-(12,15) = "]" - │ └── keyword_loc: (12,0)-(12,5) = "break" - ├── @ BreakNode (location: (14,0)-(17,1)) - │ ├── arguments: - │ │ @ ArgumentsNode (location: (14,5)-(17,1)) - │ │ ├── flags: ∅ - │ │ └── arguments: (length: 1) - │ │ └── @ ParenthesesNode (location: (14,5)-(17,1)) - │ │ ├── body: - │ │ │ @ StatementsNode (location: (15,2)-(16,3)) - │ │ │ └── body: (length: 2) - │ │ │ ├── @ IntegerNode (location: (15,2)-(15,3)) - │ │ │ │ ├── flags: decimal - │ │ │ │ └── value: 1 - │ │ │ └── @ IntegerNode (location: (16,2)-(16,3)) - │ │ │ ├── flags: decimal - │ │ │ └── value: 2 - │ │ ├── opening_loc: (14,5)-(14,6) = "(" - │ │ └── closing_loc: (17,0)-(17,1) = ")" - │ └── keyword_loc: (14,0)-(14,5) = "break" - ├── @ BreakNode (location: (19,0)-(19,7)) - │ ├── arguments: - │ │ @ ArgumentsNode (location: (19,5)-(19,7)) - │ │ ├── flags: ∅ - │ │ └── arguments: (length: 1) - │ │ └── @ ParenthesesNode (location: (19,5)-(19,7)) - │ │ ├── body: ∅ - │ │ ├── opening_loc: (19,5)-(19,6) = "(" - │ │ └── closing_loc: (19,6)-(19,7) = ")" - │ └── keyword_loc: (19,0)-(19,5) = "break" - ├── @ BreakNode (location: (21,0)-(21,8)) - │ ├── arguments: - │ │ @ ArgumentsNode (location: (21,5)-(21,8)) - │ │ ├── flags: ∅ - │ │ └── arguments: (length: 1) - │ │ └── @ ParenthesesNode (location: (21,5)-(21,8)) - │ │ ├── body: - │ │ │ @ StatementsNode (location: (21,6)-(21,7)) - │ │ │ └── body: (length: 1) - │ │ │ └── @ IntegerNode (location: (21,6)-(21,7)) - │ │ │ ├── flags: decimal - │ │ │ └── value: 1 - │ │ ├── opening_loc: (21,5)-(21,6) = "(" - │ │ └── closing_loc: (21,7)-(21,8) = ")" - │ └── keyword_loc: (21,0)-(21,5) = "break" + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (1,4)-(1,13)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (1,6)-(1,11)) + │ │ └── body: (length: 1) + │ │ └── @ BreakNode (location: (1,6)-(1,11)) + │ │ ├── arguments: ∅ + │ │ └── keyword_loc: (1,6)-(1,11) = "break" + │ ├── opening_loc: (1,4)-(1,5) = "{" + │ └── closing_loc: (1,12)-(1,13) = "}" + ├── @ CallNode (location: (3,0)-(3,27)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :tap + │ ├── message_loc: (3,0)-(3,3) = "tap" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (3,4)-(3,27)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (3,6)-(3,25)) + │ │ └── body: (length: 1) + │ │ └── @ BreakNode (location: (3,6)-(3,25)) + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (3,12)-(3,25)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 3) + │ │ │ ├── @ ParenthesesNode (location: (3,12)-(3,15)) + │ │ │ │ ├── body: + │ │ │ │ │ @ StatementsNode (location: (3,13)-(3,14)) + │ │ │ │ │ └── body: (length: 1) + │ │ │ │ │ └── @ IntegerNode (location: (3,13)-(3,14)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 1 + │ │ │ │ ├── opening_loc: (3,12)-(3,13) = "(" + │ │ │ │ └── closing_loc: (3,14)-(3,15) = ")" + │ │ │ ├── @ ParenthesesNode (location: (3,17)-(3,20)) + │ │ │ │ ├── body: + │ │ │ │ │ @ StatementsNode (location: (3,18)-(3,19)) + │ │ │ │ │ └── body: (length: 1) + │ │ │ │ │ └── @ IntegerNode (location: (3,18)-(3,19)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 2 + │ │ │ │ ├── opening_loc: (3,17)-(3,18) = "(" + │ │ │ │ └── closing_loc: (3,19)-(3,20) = ")" + │ │ │ └── @ ParenthesesNode (location: (3,22)-(3,25)) + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (3,23)-(3,24)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (3,23)-(3,24)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 3 + │ │ │ ├── opening_loc: (3,22)-(3,23) = "(" + │ │ │ └── closing_loc: (3,24)-(3,25) = ")" + │ │ └── keyword_loc: (3,6)-(3,11) = "break" + │ ├── opening_loc: (3,4)-(3,5) = "{" + │ └── closing_loc: (3,26)-(3,27) = "}" + ├── @ CallNode (location: (5,0)-(5,15)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :tap + │ ├── message_loc: (5,0)-(5,3) = "tap" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (5,4)-(5,15)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (5,6)-(5,13)) + │ │ └── body: (length: 1) + │ │ └── @ BreakNode (location: (5,6)-(5,13)) + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (5,12)-(5,13)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (5,12)-(5,13)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── keyword_loc: (5,6)-(5,11) = "break" + │ ├── opening_loc: (5,4)-(5,5) = "{" + │ └── closing_loc: (5,14)-(5,15) = "}" + ├── @ CallNode (location: (7,0)-(8,3)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :tap + │ ├── message_loc: (7,0)-(7,3) = "tap" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (7,4)-(8,3)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (7,6)-(8,1)) + │ │ └── body: (length: 1) + │ │ └── @ BreakNode (location: (7,6)-(8,1)) + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (7,12)-(8,1)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 3) + │ │ │ ├── @ IntegerNode (location: (7,12)-(7,13)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ ├── @ IntegerNode (location: (7,15)-(7,16)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 2 + │ │ │ └── @ IntegerNode (location: (8,0)-(8,1)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 3 + │ │ └── keyword_loc: (7,6)-(7,11) = "break" + │ ├── opening_loc: (7,4)-(7,5) = "{" + │ └── closing_loc: (8,2)-(8,3) = "}" + ├── @ CallNode (location: (10,0)-(10,21)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :tap + │ ├── message_loc: (10,0)-(10,3) = "tap" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (10,4)-(10,21)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (10,6)-(10,19)) + │ │ └── body: (length: 1) + │ │ └── @ BreakNode (location: (10,6)-(10,19)) + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (10,12)-(10,19)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 3) + │ │ │ ├── @ IntegerNode (location: (10,12)-(10,13)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ ├── @ IntegerNode (location: (10,15)-(10,16)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 2 + │ │ │ └── @ IntegerNode (location: (10,18)-(10,19)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 3 + │ │ └── keyword_loc: (10,6)-(10,11) = "break" + │ ├── opening_loc: (10,4)-(10,5) = "{" + │ └── closing_loc: (10,20)-(10,21) = "}" + ├── @ CallNode (location: (12,0)-(12,23)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :tap + │ ├── message_loc: (12,0)-(12,3) = "tap" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (12,4)-(12,23)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (12,6)-(12,21)) + │ │ └── body: (length: 1) + │ │ └── @ BreakNode (location: (12,6)-(12,21)) + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (12,12)-(12,21)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ ArrayNode (location: (12,12)-(12,21)) + │ │ │ ├── flags: ∅ + │ │ │ ├── elements: (length: 3) + │ │ │ │ ├── @ IntegerNode (location: (12,13)-(12,14)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 1 + │ │ │ │ ├── @ IntegerNode (location: (12,16)-(12,17)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 2 + │ │ │ │ └── @ IntegerNode (location: (12,19)-(12,20)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 3 + │ │ │ ├── opening_loc: (12,12)-(12,13) = "[" + │ │ │ └── closing_loc: (12,20)-(12,21) = "]" + │ │ └── keyword_loc: (12,6)-(12,11) = "break" + │ ├── opening_loc: (12,4)-(12,5) = "{" + │ └── closing_loc: (12,22)-(12,23) = "}" + ├── @ CallNode (location: (14,0)-(17,3)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :tap + │ ├── message_loc: (14,0)-(14,3) = "tap" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (14,4)-(17,3)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (14,6)-(17,1)) + │ │ └── body: (length: 1) + │ │ └── @ BreakNode (location: (14,6)-(17,1)) + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (14,11)-(17,1)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ ParenthesesNode (location: (14,11)-(17,1)) + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (15,2)-(16,3)) + │ │ │ │ └── body: (length: 2) + │ │ │ │ ├── @ IntegerNode (location: (15,2)-(15,3)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 1 + │ │ │ │ └── @ IntegerNode (location: (16,2)-(16,3)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 2 + │ │ │ ├── opening_loc: (14,11)-(14,12) = "(" + │ │ │ └── closing_loc: (17,0)-(17,1) = ")" + │ │ └── keyword_loc: (14,6)-(14,11) = "break" + │ ├── opening_loc: (14,4)-(14,5) = "{" + │ └── closing_loc: (17,2)-(17,3) = "}" + ├── @ CallNode (location: (19,0)-(19,15)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :tap + │ ├── message_loc: (19,0)-(19,3) = "tap" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (19,4)-(19,15)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (19,6)-(19,13)) + │ │ └── body: (length: 1) + │ │ └── @ BreakNode (location: (19,6)-(19,13)) + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (19,11)-(19,13)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ ParenthesesNode (location: (19,11)-(19,13)) + │ │ │ ├── body: ∅ + │ │ │ ├── opening_loc: (19,11)-(19,12) = "(" + │ │ │ └── closing_loc: (19,12)-(19,13) = ")" + │ │ └── keyword_loc: (19,6)-(19,11) = "break" + │ ├── opening_loc: (19,4)-(19,5) = "{" + │ └── closing_loc: (19,14)-(19,15) = "}" + ├── @ CallNode (location: (21,0)-(21,16)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :tap + │ ├── message_loc: (21,0)-(21,3) = "tap" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (21,4)-(21,16)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (21,6)-(21,14)) + │ │ └── body: (length: 1) + │ │ └── @ BreakNode (location: (21,6)-(21,14)) + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (21,11)-(21,14)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ ParenthesesNode (location: (21,11)-(21,14)) + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (21,12)-(21,13)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (21,12)-(21,13)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ ├── opening_loc: (21,11)-(21,12) = "(" + │ │ │ └── closing_loc: (21,13)-(21,14) = ")" + │ │ └── keyword_loc: (21,6)-(21,11) = "break" + │ ├── opening_loc: (21,4)-(21,5) = "{" + │ └── closing_loc: (21,15)-(21,16) = "}" ├── @ CallNode (location: (23,0)-(23,22)) │ ├── flags: ∅ │ ├── receiver: diff --git a/test/prism/snapshots/if.txt b/test/prism/snapshots/if.txt index f879ed3885..b618659756 100644 --- a/test/prism/snapshots/if.txt +++ b/test/prism/snapshots/if.txt @@ -91,32 +91,68 @@ │ │ └── value: 1 │ ├── consequent: ∅ │ └── end_keyword_loc: ∅ - ├── @ IfNode (location: (10,0)-(10,13)) - │ ├── if_keyword_loc: (10,6)-(10,8) = "if" - │ ├── predicate: - │ │ @ TrueNode (location: (10,9)-(10,13)) - │ ├── then_keyword_loc: ∅ - │ ├── statements: - │ │ @ StatementsNode (location: (10,0)-(10,5)) - │ │ └── body: (length: 1) - │ │ └── @ BreakNode (location: (10,0)-(10,5)) - │ │ ├── arguments: ∅ - │ │ └── keyword_loc: (10,0)-(10,5) = "break" - │ ├── consequent: ∅ - │ └── end_keyword_loc: ∅ - ├── @ IfNode (location: (12,0)-(12,12)) - │ ├── if_keyword_loc: (12,5)-(12,7) = "if" - │ ├── predicate: - │ │ @ TrueNode (location: (12,8)-(12,12)) - │ ├── then_keyword_loc: ∅ - │ ├── statements: - │ │ @ StatementsNode (location: (12,0)-(12,4)) - │ │ └── body: (length: 1) - │ │ └── @ NextNode (location: (12,0)-(12,4)) - │ │ ├── arguments: ∅ - │ │ └── keyword_loc: (12,0)-(12,4) = "next" - │ ├── consequent: ∅ - │ └── end_keyword_loc: ∅ + ├── @ CallNode (location: (10,0)-(10,21)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :tap + │ ├── message_loc: (10,0)-(10,3) = "tap" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (10,4)-(10,21)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (10,6)-(10,19)) + │ │ └── body: (length: 1) + │ │ └── @ IfNode (location: (10,6)-(10,19)) + │ │ ├── if_keyword_loc: (10,12)-(10,14) = "if" + │ │ ├── predicate: + │ │ │ @ TrueNode (location: (10,15)-(10,19)) + │ │ ├── then_keyword_loc: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (10,6)-(10,11)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ BreakNode (location: (10,6)-(10,11)) + │ │ │ ├── arguments: ∅ + │ │ │ └── keyword_loc: (10,6)-(10,11) = "break" + │ │ ├── consequent: ∅ + │ │ └── end_keyword_loc: ∅ + │ ├── opening_loc: (10,4)-(10,5) = "{" + │ └── closing_loc: (10,20)-(10,21) = "}" + ├── @ CallNode (location: (12,0)-(12,20)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :tap + │ ├── message_loc: (12,0)-(12,3) = "tap" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (12,4)-(12,20)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (12,6)-(12,18)) + │ │ └── body: (length: 1) + │ │ └── @ IfNode (location: (12,6)-(12,18)) + │ │ ├── if_keyword_loc: (12,11)-(12,13) = "if" + │ │ ├── predicate: + │ │ │ @ TrueNode (location: (12,14)-(12,18)) + │ │ ├── then_keyword_loc: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (12,6)-(12,10)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ NextNode (location: (12,6)-(12,10)) + │ │ │ ├── arguments: ∅ + │ │ │ └── keyword_loc: (12,6)-(12,10) = "next" + │ │ ├── consequent: ∅ + │ │ └── end_keyword_loc: ∅ + │ ├── opening_loc: (12,4)-(12,5) = "{" + │ └── closing_loc: (12,19)-(12,20) = "}" ├── @ IfNode (location: (14,0)-(14,14)) │ ├── if_keyword_loc: (14,7)-(14,9) = "if" │ ├── predicate: @@ -130,34 +166,52 @@ │ │ └── arguments: ∅ │ ├── consequent: ∅ │ └── end_keyword_loc: ∅ - ├── @ IfNode (location: (16,0)-(16,30)) - │ ├── if_keyword_loc: (16,0)-(16,2) = "if" - │ ├── predicate: - │ │ @ CallNode (location: (16,3)-(16,12)) - │ │ ├── flags: variable_call, ignore_visibility - │ │ ├── receiver: ∅ - │ │ ├── call_operator_loc: ∅ - │ │ ├── name: :exit_loop - │ │ ├── message_loc: (16,3)-(16,12) = "exit_loop" - │ │ ├── opening_loc: ∅ - │ │ ├── arguments: ∅ - │ │ ├── closing_loc: ∅ - │ │ └── block: ∅ - │ ├── then_keyword_loc: (16,13)-(16,17) = "then" - │ ├── statements: - │ │ @ StatementsNode (location: (16,18)-(16,26)) - │ │ └── body: (length: 1) - │ │ └── @ BreakNode (location: (16,18)-(16,26)) - │ │ ├── arguments: - │ │ │ @ ArgumentsNode (location: (16,24)-(16,26)) - │ │ │ ├── flags: ∅ - │ │ │ └── arguments: (length: 1) - │ │ │ └── @ IntegerNode (location: (16,24)-(16,26)) - │ │ │ ├── flags: decimal - │ │ │ └── value: 42 - │ │ └── keyword_loc: (16,18)-(16,23) = "break" - │ ├── consequent: ∅ - │ └── end_keyword_loc: (16,27)-(16,30) = "end" + ├── @ CallNode (location: (16,0)-(16,38)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :tap + │ ├── message_loc: (16,0)-(16,3) = "tap" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (16,4)-(16,38)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (16,6)-(16,36)) + │ │ └── body: (length: 1) + │ │ └── @ IfNode (location: (16,6)-(16,36)) + │ │ ├── if_keyword_loc: (16,6)-(16,8) = "if" + │ │ ├── predicate: + │ │ │ @ CallNode (location: (16,9)-(16,18)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :exit_loop + │ │ │ ├── message_loc: (16,9)-(16,18) = "exit_loop" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── then_keyword_loc: (16,19)-(16,23) = "then" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (16,24)-(16,32)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ BreakNode (location: (16,24)-(16,32)) + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (16,30)-(16,32)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (16,30)-(16,32)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 42 + │ │ │ └── keyword_loc: (16,24)-(16,29) = "break" + │ │ ├── consequent: ∅ + │ │ └── end_keyword_loc: (16,33)-(16,36) = "end" + │ ├── opening_loc: (16,4)-(16,5) = "{" + │ └── closing_loc: (16,37)-(16,38) = "}" ├── @ IfNode (location: (18,0)-(20,3)) │ ├── if_keyword_loc: (18,0)-(18,2) = "if" │ ├── predicate: diff --git a/test/prism/snapshots/keywords.txt b/test/prism/snapshots/keywords.txt index 8a93c38bfd..b3d5c5e1c3 100644 --- a/test/prism/snapshots/keywords.txt +++ b/test/prism/snapshots/keywords.txt @@ -3,8 +3,42 @@ └── statements: @ StatementsNode (location: (1,0)-(11,8)) └── body: (length: 6) - ├── @ RedoNode (location: (1,0)-(1,4)) - ├── @ RetryNode (location: (3,0)-(3,5)) + ├── @ CallNode (location: (1,0)-(1,12)) + │ ├── 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)-(1,12)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (1,6)-(1,10)) + │ │ └── body: (length: 1) + │ │ └── @ RedoNode (location: (1,6)-(1,10)) + │ ├── opening_loc: (1,4)-(1,5) = "{" + │ └── closing_loc: (1,11)-(1,12) = "}" + ├── @ BeginNode (location: (3,0)-(3,25)) + │ ├── begin_keyword_loc: (3,0)-(3,5) = "begin" + │ ├── statements: ∅ + │ ├── rescue_clause: + │ │ @ RescueNode (location: (3,7)-(3,20)) + │ │ ├── keyword_loc: (3,7)-(3,13) = "rescue" + │ │ ├── exceptions: (length: 0) + │ │ ├── operator_loc: ∅ + │ │ ├── reference: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (3,15)-(3,20)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ RetryNode (location: (3,15)-(3,20)) + │ │ └── consequent: ∅ + │ ├── else_clause: ∅ + │ ├── ensure_clause: ∅ + │ └── end_keyword_loc: (3,22)-(3,25) = "end" ├── @ SelfNode (location: (5,0)-(5,4)) ├── @ SourceEncodingNode (location: (7,0)-(7,12)) ├── @ SourceFileNode (location: (9,0)-(9,8)) diff --git a/test/prism/snapshots/next.txt b/test/prism/snapshots/next.txt index 64ec3ebc91..ce2e497de9 100644 --- a/test/prism/snapshots/next.txt +++ b/test/prism/snapshots/next.txt @@ -1,149 +1,329 @@ -@ ProgramNode (location: (1,0)-(24,7)) +@ ProgramNode (location: (1,0)-(24,15)) ├── locals: [] └── statements: - @ StatementsNode (location: (1,0)-(24,7)) - └── body: (length: 11) - ├── @ NextNode (location: (1,0)-(1,4)) + @ StatementsNode (location: (1,0)-(24,15)) + └── body: (length: 10) + ├── @ CallNode (location: (1,0)-(1,12)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :tap + │ ├── message_loc: (1,0)-(1,3) = "tap" + │ ├── opening_loc: ∅ │ ├── arguments: ∅ - │ └── keyword_loc: (1,0)-(1,4) = "next" - ├── @ NextNode (location: (3,0)-(3,18)) - │ ├── arguments: - │ │ @ ArgumentsNode (location: (3,5)-(3,18)) - │ │ ├── flags: ∅ - │ │ └── arguments: (length: 3) - │ │ ├── @ ParenthesesNode (location: (3,5)-(3,8)) - │ │ │ ├── body: - │ │ │ │ @ StatementsNode (location: (3,6)-(3,7)) - │ │ │ │ └── body: (length: 1) - │ │ │ │ └── @ IntegerNode (location: (3,6)-(3,7)) - │ │ │ │ ├── flags: decimal - │ │ │ │ └── value: 1 - │ │ │ ├── opening_loc: (3,5)-(3,6) = "(" - │ │ │ └── closing_loc: (3,7)-(3,8) = ")" - │ │ ├── @ ParenthesesNode (location: (3,10)-(3,13)) - │ │ │ ├── body: - │ │ │ │ @ StatementsNode (location: (3,11)-(3,12)) - │ │ │ │ └── body: (length: 1) - │ │ │ │ └── @ IntegerNode (location: (3,11)-(3,12)) - │ │ │ │ ├── flags: decimal - │ │ │ │ └── value: 2 - │ │ │ ├── opening_loc: (3,10)-(3,11) = "(" - │ │ │ └── closing_loc: (3,12)-(3,13) = ")" - │ │ └── @ ParenthesesNode (location: (3,15)-(3,18)) - │ │ ├── body: - │ │ │ @ StatementsNode (location: (3,16)-(3,17)) - │ │ │ └── body: (length: 1) - │ │ │ └── @ IntegerNode (location: (3,16)-(3,17)) - │ │ │ ├── flags: decimal - │ │ │ └── value: 3 - │ │ ├── opening_loc: (3,15)-(3,16) = "(" - │ │ └── closing_loc: (3,17)-(3,18) = ")" - │ └── keyword_loc: (3,0)-(3,4) = "next" - ├── @ NextNode (location: (5,0)-(5,6)) - │ ├── arguments: - │ │ @ ArgumentsNode (location: (5,5)-(5,6)) - │ │ ├── flags: ∅ - │ │ └── arguments: (length: 1) - │ │ └── @ IntegerNode (location: (5,5)-(5,6)) - │ │ ├── flags: decimal - │ │ └── value: 1 - │ └── keyword_loc: (5,0)-(5,4) = "next" - ├── @ NextNode (location: (7,0)-(8,1)) - │ ├── arguments: - │ │ @ ArgumentsNode (location: (7,5)-(8,1)) - │ │ ├── flags: ∅ - │ │ └── arguments: (length: 3) - │ │ ├── @ IntegerNode (location: (7,5)-(7,6)) - │ │ │ ├── flags: decimal - │ │ │ └── value: 1 - │ │ ├── @ IntegerNode (location: (7,8)-(7,9)) - │ │ │ ├── flags: decimal - │ │ │ └── value: 2 - │ │ └── @ IntegerNode (location: (8,0)-(8,1)) - │ │ ├── flags: decimal - │ │ └── value: 3 - │ └── keyword_loc: (7,0)-(7,4) = "next" - ├── @ NextNode (location: (10,0)-(10,12)) - │ ├── arguments: - │ │ @ ArgumentsNode (location: (10,5)-(10,12)) - │ │ ├── flags: ∅ - │ │ └── arguments: (length: 3) - │ │ ├── @ IntegerNode (location: (10,5)-(10,6)) - │ │ │ ├── flags: decimal - │ │ │ └── value: 1 - │ │ ├── @ IntegerNode (location: (10,8)-(10,9)) - │ │ │ ├── flags: decimal - │ │ │ └── value: 2 - │ │ └── @ IntegerNode (location: (10,11)-(10,12)) - │ │ ├── flags: decimal - │ │ └── value: 3 - │ └── keyword_loc: (10,0)-(10,4) = "next" - ├── @ NextNode (location: (12,0)-(12,14)) - │ ├── arguments: - │ │ @ ArgumentsNode (location: (12,5)-(12,14)) - │ │ ├── flags: ∅ - │ │ └── arguments: (length: 1) - │ │ └── @ ArrayNode (location: (12,5)-(12,14)) - │ │ ├── flags: ∅ - │ │ ├── elements: (length: 3) - │ │ │ ├── @ IntegerNode (location: (12,6)-(12,7)) - │ │ │ │ ├── flags: decimal - │ │ │ │ └── value: 1 - │ │ │ ├── @ IntegerNode (location: (12,9)-(12,10)) - │ │ │ │ ├── flags: decimal - │ │ │ │ └── value: 2 - │ │ │ └── @ IntegerNode (location: (12,12)-(12,13)) - │ │ │ ├── flags: decimal - │ │ │ └── value: 3 - │ │ ├── opening_loc: (12,5)-(12,6) = "[" - │ │ └── closing_loc: (12,13)-(12,14) = "]" - │ └── keyword_loc: (12,0)-(12,4) = "next" - ├── @ NextNode (location: (14,0)-(17,1)) - │ ├── arguments: - │ │ @ ArgumentsNode (location: (14,4)-(17,1)) - │ │ ├── flags: ∅ - │ │ └── arguments: (length: 1) - │ │ └── @ ParenthesesNode (location: (14,4)-(17,1)) - │ │ ├── body: - │ │ │ @ StatementsNode (location: (15,2)-(16,3)) - │ │ │ └── body: (length: 2) - │ │ │ ├── @ IntegerNode (location: (15,2)-(15,3)) - │ │ │ │ ├── flags: decimal - │ │ │ │ └── value: 1 - │ │ │ └── @ IntegerNode (location: (16,2)-(16,3)) - │ │ │ ├── flags: decimal - │ │ │ └── value: 2 - │ │ ├── opening_loc: (14,4)-(14,5) = "(" - │ │ └── closing_loc: (17,0)-(17,1) = ")" - │ └── keyword_loc: (14,0)-(14,4) = "next" - ├── @ NextNode (location: (19,0)-(19,4)) + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (1,4)-(1,12)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (1,6)-(1,10)) + │ │ └── body: (length: 1) + │ │ └── @ NextNode (location: (1,6)-(1,10)) + │ │ ├── arguments: ∅ + │ │ └── keyword_loc: (1,6)-(1,10) = "next" + │ ├── opening_loc: (1,4)-(1,5) = "{" + │ └── closing_loc: (1,11)-(1,12) = "}" + ├── @ CallNode (location: (3,0)-(3,26)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :tap + │ ├── message_loc: (3,0)-(3,3) = "tap" + │ ├── opening_loc: ∅ │ ├── arguments: ∅ - │ └── keyword_loc: (19,0)-(19,4) = "next" - ├── @ IntegerNode (location: (20,0)-(20,1)) - │ ├── flags: decimal - │ └── value: 1 - ├── @ NextNode (location: (22,0)-(22,6)) - │ ├── arguments: - │ │ @ ArgumentsNode (location: (22,4)-(22,6)) - │ │ ├── flags: ∅ - │ │ └── arguments: (length: 1) - │ │ └── @ ParenthesesNode (location: (22,4)-(22,6)) - │ │ ├── body: ∅ - │ │ ├── opening_loc: (22,4)-(22,5) = "(" - │ │ └── closing_loc: (22,5)-(22,6) = ")" - │ └── keyword_loc: (22,0)-(22,4) = "next" - └── @ NextNode (location: (24,0)-(24,7)) - ├── arguments: - │ @ ArgumentsNode (location: (24,4)-(24,7)) - │ ├── flags: ∅ - │ └── arguments: (length: 1) - │ └── @ ParenthesesNode (location: (24,4)-(24,7)) - │ ├── body: - │ │ @ StatementsNode (location: (24,5)-(24,6)) - │ │ └── body: (length: 1) - │ │ └── @ IntegerNode (location: (24,5)-(24,6)) - │ │ ├── flags: decimal - │ │ └── value: 1 - │ ├── opening_loc: (24,4)-(24,5) = "(" - │ └── closing_loc: (24,6)-(24,7) = ")" - └── keyword_loc: (24,0)-(24,4) = "next" + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (3,4)-(3,26)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (3,6)-(3,24)) + │ │ └── body: (length: 1) + │ │ └── @ NextNode (location: (3,6)-(3,24)) + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (3,11)-(3,24)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 3) + │ │ │ ├── @ ParenthesesNode (location: (3,11)-(3,14)) + │ │ │ │ ├── body: + │ │ │ │ │ @ StatementsNode (location: (3,12)-(3,13)) + │ │ │ │ │ └── body: (length: 1) + │ │ │ │ │ └── @ IntegerNode (location: (3,12)-(3,13)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 1 + │ │ │ │ ├── opening_loc: (3,11)-(3,12) = "(" + │ │ │ │ └── closing_loc: (3,13)-(3,14) = ")" + │ │ │ ├── @ ParenthesesNode (location: (3,16)-(3,19)) + │ │ │ │ ├── body: + │ │ │ │ │ @ StatementsNode (location: (3,17)-(3,18)) + │ │ │ │ │ └── body: (length: 1) + │ │ │ │ │ └── @ IntegerNode (location: (3,17)-(3,18)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 2 + │ │ │ │ ├── opening_loc: (3,16)-(3,17) = "(" + │ │ │ │ └── closing_loc: (3,18)-(3,19) = ")" + │ │ │ └── @ ParenthesesNode (location: (3,21)-(3,24)) + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (3,22)-(3,23)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (3,22)-(3,23)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 3 + │ │ │ ├── opening_loc: (3,21)-(3,22) = "(" + │ │ │ └── closing_loc: (3,23)-(3,24) = ")" + │ │ └── keyword_loc: (3,6)-(3,10) = "next" + │ ├── opening_loc: (3,4)-(3,5) = "{" + │ └── closing_loc: (3,25)-(3,26) = "}" + ├── @ CallNode (location: (5,0)-(5,14)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :tap + │ ├── message_loc: (5,0)-(5,3) = "tap" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (5,4)-(5,14)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (5,6)-(5,12)) + │ │ └── body: (length: 1) + │ │ └── @ NextNode (location: (5,6)-(5,12)) + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (5,11)-(5,12)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (5,11)-(5,12)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── keyword_loc: (5,6)-(5,10) = "next" + │ ├── opening_loc: (5,4)-(5,5) = "{" + │ └── closing_loc: (5,13)-(5,14) = "}" + ├── @ CallNode (location: (7,0)-(8,3)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :tap + │ ├── message_loc: (7,0)-(7,3) = "tap" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (7,4)-(8,3)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (7,6)-(8,1)) + │ │ └── body: (length: 1) + │ │ └── @ NextNode (location: (7,6)-(8,1)) + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (7,11)-(8,1)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 3) + │ │ │ ├── @ IntegerNode (location: (7,11)-(7,12)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ ├── @ IntegerNode (location: (7,14)-(7,15)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 2 + │ │ │ └── @ IntegerNode (location: (8,0)-(8,1)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 3 + │ │ └── keyword_loc: (7,6)-(7,10) = "next" + │ ├── opening_loc: (7,4)-(7,5) = "{" + │ └── closing_loc: (8,2)-(8,3) = "}" + ├── @ CallNode (location: (10,0)-(10,20)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :tap + │ ├── message_loc: (10,0)-(10,3) = "tap" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (10,4)-(10,20)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (10,6)-(10,18)) + │ │ └── body: (length: 1) + │ │ └── @ NextNode (location: (10,6)-(10,18)) + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (10,11)-(10,18)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 3) + │ │ │ ├── @ IntegerNode (location: (10,11)-(10,12)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 1 + │ │ │ ├── @ IntegerNode (location: (10,14)-(10,15)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 2 + │ │ │ └── @ IntegerNode (location: (10,17)-(10,18)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 3 + │ │ └── keyword_loc: (10,6)-(10,10) = "next" + │ ├── opening_loc: (10,4)-(10,5) = "{" + │ └── closing_loc: (10,19)-(10,20) = "}" + ├── @ CallNode (location: (12,0)-(12,22)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :tap + │ ├── message_loc: (12,0)-(12,3) = "tap" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (12,4)-(12,22)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (12,6)-(12,20)) + │ │ └── body: (length: 1) + │ │ └── @ NextNode (location: (12,6)-(12,20)) + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (12,11)-(12,20)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ ArrayNode (location: (12,11)-(12,20)) + │ │ │ ├── flags: ∅ + │ │ │ ├── elements: (length: 3) + │ │ │ │ ├── @ IntegerNode (location: (12,12)-(12,13)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 1 + │ │ │ │ ├── @ IntegerNode (location: (12,15)-(12,16)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 2 + │ │ │ │ └── @ IntegerNode (location: (12,18)-(12,19)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 3 + │ │ │ ├── opening_loc: (12,11)-(12,12) = "[" + │ │ │ └── closing_loc: (12,19)-(12,20) = "]" + │ │ └── keyword_loc: (12,6)-(12,10) = "next" + │ ├── opening_loc: (12,4)-(12,5) = "{" + │ └── closing_loc: (12,21)-(12,22) = "}" + ├── @ CallNode (location: (14,0)-(17,3)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :tap + │ ├── message_loc: (14,0)-(14,3) = "tap" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (14,4)-(17,3)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (14,6)-(17,1)) + │ │ └── body: (length: 1) + │ │ └── @ NextNode (location: (14,6)-(17,1)) + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (14,10)-(17,1)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ ParenthesesNode (location: (14,10)-(17,1)) + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (15,2)-(16,3)) + │ │ │ │ └── body: (length: 2) + │ │ │ │ ├── @ IntegerNode (location: (15,2)-(15,3)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 1 + │ │ │ │ └── @ IntegerNode (location: (16,2)-(16,3)) + │ │ │ │ ├── flags: decimal + │ │ │ │ └── value: 2 + │ │ │ ├── opening_loc: (14,10)-(14,11) = "(" + │ │ │ └── closing_loc: (17,0)-(17,1) = ")" + │ │ └── keyword_loc: (14,6)-(14,10) = "next" + │ ├── opening_loc: (14,4)-(14,5) = "{" + │ └── closing_loc: (17,2)-(17,3) = "}" + ├── @ CallNode (location: (19,0)-(20,3)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :tap + │ ├── message_loc: (19,0)-(19,3) = "tap" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (19,4)-(20,3)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (19,6)-(20,1)) + │ │ └── body: (length: 2) + │ │ ├── @ NextNode (location: (19,6)-(19,10)) + │ │ │ ├── arguments: ∅ + │ │ │ └── keyword_loc: (19,6)-(19,10) = "next" + │ │ └── @ IntegerNode (location: (20,0)-(20,1)) + │ │ ├── flags: decimal + │ │ └── value: 1 + │ ├── opening_loc: (19,4)-(19,5) = "{" + │ └── closing_loc: (20,2)-(20,3) = "}" + ├── @ CallNode (location: (22,0)-(22,14)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :tap + │ ├── message_loc: (22,0)-(22,3) = "tap" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (22,4)-(22,14)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (22,6)-(22,12)) + │ │ └── body: (length: 1) + │ │ └── @ NextNode (location: (22,6)-(22,12)) + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (22,10)-(22,12)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ ParenthesesNode (location: (22,10)-(22,12)) + │ │ │ ├── body: ∅ + │ │ │ ├── opening_loc: (22,10)-(22,11) = "(" + │ │ │ └── closing_loc: (22,11)-(22,12) = ")" + │ │ └── keyword_loc: (22,6)-(22,10) = "next" + │ ├── opening_loc: (22,4)-(22,5) = "{" + │ └── closing_loc: (22,13)-(22,14) = "}" + └── @ CallNode (location: (24,0)-(24,15)) + ├── flags: ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :tap + ├── message_loc: (24,0)-(24,3) = "tap" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (24,4)-(24,15)) + ├── locals: [] + ├── parameters: ∅ + ├── body: + │ @ StatementsNode (location: (24,6)-(24,13)) + │ └── body: (length: 1) + │ └── @ NextNode (location: (24,6)-(24,13)) + │ ├── arguments: + │ │ @ ArgumentsNode (location: (24,10)-(24,13)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ ParenthesesNode (location: (24,10)-(24,13)) + │ │ ├── body: + │ │ │ @ StatementsNode (location: (24,11)-(24,12)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ IntegerNode (location: (24,11)-(24,12)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── opening_loc: (24,10)-(24,11) = "(" + │ │ └── closing_loc: (24,12)-(24,13) = ")" + │ └── keyword_loc: (24,6)-(24,10) = "next" + ├── opening_loc: (24,4)-(24,5) = "{" + └── closing_loc: (24,14)-(24,15) = "}" diff --git a/test/prism/snapshots/rescue.txt b/test/prism/snapshots/rescue.txt index d987c49617..57cafde5a6 100644 --- a/test/prism/snapshots/rescue.txt +++ b/test/prism/snapshots/rescue.txt @@ -33,22 +33,58 @@ │ ├── keyword_loc: (3,4)-(3,10) = "rescue" │ └── rescue_expression: │ @ NilNode (location: (4,0)-(4,3)) - ├── @ RescueModifierNode (location: (6,0)-(6,16)) - │ ├── expression: - │ │ @ BreakNode (location: (6,0)-(6,5)) - │ │ ├── arguments: ∅ - │ │ └── keyword_loc: (6,0)-(6,5) = "break" - │ ├── keyword_loc: (6,6)-(6,12) = "rescue" - │ └── rescue_expression: - │ @ NilNode (location: (6,13)-(6,16)) - ├── @ RescueModifierNode (location: (8,0)-(8,15)) - │ ├── expression: - │ │ @ NextNode (location: (8,0)-(8,4)) - │ │ ├── arguments: ∅ - │ │ └── keyword_loc: (8,0)-(8,4) = "next" - │ ├── keyword_loc: (8,5)-(8,11) = "rescue" - │ └── rescue_expression: - │ @ NilNode (location: (8,12)-(8,15)) + ├── @ CallNode (location: (6,0)-(6,24)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :tap + │ ├── message_loc: (6,0)-(6,3) = "tap" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (6,4)-(6,24)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (6,6)-(6,22)) + │ │ └── body: (length: 1) + │ │ └── @ RescueModifierNode (location: (6,6)-(6,22)) + │ │ ├── expression: + │ │ │ @ BreakNode (location: (6,6)-(6,11)) + │ │ │ ├── arguments: ∅ + │ │ │ └── keyword_loc: (6,6)-(6,11) = "break" + │ │ ├── keyword_loc: (6,12)-(6,18) = "rescue" + │ │ └── rescue_expression: + │ │ @ NilNode (location: (6,19)-(6,22)) + │ ├── opening_loc: (6,4)-(6,5) = "{" + │ └── closing_loc: (6,23)-(6,24) = "}" + ├── @ CallNode (location: (8,0)-(8,23)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :tap + │ ├── message_loc: (8,0)-(8,3) = "tap" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (8,4)-(8,23)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (8,6)-(8,21)) + │ │ └── body: (length: 1) + │ │ └── @ RescueModifierNode (location: (8,6)-(8,21)) + │ │ ├── expression: + │ │ │ @ NextNode (location: (8,6)-(8,10)) + │ │ │ ├── arguments: ∅ + │ │ │ └── keyword_loc: (8,6)-(8,10) = "next" + │ │ ├── keyword_loc: (8,11)-(8,17) = "rescue" + │ │ └── rescue_expression: + │ │ @ NilNode (location: (8,18)-(8,21)) + │ ├── opening_loc: (8,4)-(8,5) = "{" + │ └── closing_loc: (8,22)-(8,23) = "}" ├── @ RescueModifierNode (location: (10,0)-(10,17)) │ ├── expression: │ │ @ ReturnNode (location: (10,0)-(10,6)) diff --git a/test/prism/snapshots/seattlerb/block_break.txt b/test/prism/snapshots/seattlerb/block_break.txt deleted file mode 100644 index ce61b2f0d1..0000000000 --- a/test/prism/snapshots/seattlerb/block_break.txt +++ /dev/null @@ -1,56 +0,0 @@ -@ ProgramNode (location: (1,0)-(1,26)) -├── locals: [] -└── statements: - @ StatementsNode (location: (1,0)-(1,26)) - └── body: (length: 1) - └── @ BreakNode (location: (1,0)-(1,26)) - ├── arguments: - │ @ ArgumentsNode (location: (1,6)-(1,26)) - │ ├── flags: ∅ - │ └── arguments: (length: 1) - │ └── @ CallNode (location: (1,6)-(1,26)) - │ ├── flags: ignore_visibility - │ ├── receiver: ∅ - │ ├── call_operator_loc: ∅ - │ ├── name: :foo - │ ├── message_loc: (1,6)-(1,9) = "foo" - │ ├── opening_loc: ∅ - │ ├── arguments: - │ │ @ ArgumentsNode (location: (1,10)-(1,13)) - │ │ ├── flags: ∅ - │ │ └── arguments: (length: 1) - │ │ └── @ CallNode (location: (1,10)-(1,13)) - │ │ ├── flags: variable_call, ignore_visibility - │ │ ├── receiver: ∅ - │ │ ├── call_operator_loc: ∅ - │ │ ├── name: :arg - │ │ ├── message_loc: (1,10)-(1,13) = "arg" - │ │ ├── opening_loc: ∅ - │ │ ├── arguments: ∅ - │ │ ├── closing_loc: ∅ - │ │ └── block: ∅ - │ ├── closing_loc: ∅ - │ └── block: - │ @ BlockNode (location: (1,14)-(1,26)) - │ ├── locals: [:bar] - │ ├── parameters: - │ │ @ BlockParametersNode (location: (1,17)-(1,22)) - │ │ ├── parameters: - │ │ │ @ ParametersNode (location: (1,18)-(1,21)) - │ │ │ ├── requireds: (length: 1) - │ │ │ │ └── @ RequiredParameterNode (location: (1,18)-(1,21)) - │ │ │ │ ├── flags: ∅ - │ │ │ │ └── name: :bar - │ │ │ ├── optionals: (length: 0) - │ │ │ ├── rest: ∅ - │ │ │ ├── posts: (length: 0) - │ │ │ ├── keywords: (length: 0) - │ │ │ ├── keyword_rest: ∅ - │ │ │ └── block: ∅ - │ │ ├── locals: (length: 0) - │ │ ├── opening_loc: (1,17)-(1,18) = "|" - │ │ └── closing_loc: (1,21)-(1,22) = "|" - │ ├── body: ∅ - │ ├── opening_loc: (1,14)-(1,16) = "do" - │ └── closing_loc: (1,23)-(1,26) = "end" - └── keyword_loc: (1,0)-(1,5) = "break" diff --git a/test/prism/snapshots/seattlerb/block_next.txt b/test/prism/snapshots/seattlerb/block_next.txt deleted file mode 100644 index 71f2deb2dd..0000000000 --- a/test/prism/snapshots/seattlerb/block_next.txt +++ /dev/null @@ -1,56 +0,0 @@ -@ ProgramNode (location: (1,0)-(1,25)) -├── locals: [] -└── statements: - @ StatementsNode (location: (1,0)-(1,25)) - └── body: (length: 1) - └── @ NextNode (location: (1,0)-(1,25)) - ├── arguments: - │ @ ArgumentsNode (location: (1,5)-(1,25)) - │ ├── flags: ∅ - │ └── arguments: (length: 1) - │ └── @ CallNode (location: (1,5)-(1,25)) - │ ├── flags: ignore_visibility - │ ├── receiver: ∅ - │ ├── call_operator_loc: ∅ - │ ├── name: :foo - │ ├── message_loc: (1,5)-(1,8) = "foo" - │ ├── opening_loc: ∅ - │ ├── arguments: - │ │ @ ArgumentsNode (location: (1,9)-(1,12)) - │ │ ├── flags: ∅ - │ │ └── arguments: (length: 1) - │ │ └── @ CallNode (location: (1,9)-(1,12)) - │ │ ├── flags: variable_call, ignore_visibility - │ │ ├── receiver: ∅ - │ │ ├── call_operator_loc: ∅ - │ │ ├── name: :arg - │ │ ├── message_loc: (1,9)-(1,12) = "arg" - │ │ ├── opening_loc: ∅ - │ │ ├── arguments: ∅ - │ │ ├── closing_loc: ∅ - │ │ └── block: ∅ - │ ├── closing_loc: ∅ - │ └── block: - │ @ BlockNode (location: (1,13)-(1,25)) - │ ├── locals: [:bar] - │ ├── parameters: - │ │ @ BlockParametersNode (location: (1,16)-(1,21)) - │ │ ├── parameters: - │ │ │ @ ParametersNode (location: (1,17)-(1,20)) - │ │ │ ├── requireds: (length: 1) - │ │ │ │ └── @ RequiredParameterNode (location: (1,17)-(1,20)) - │ │ │ │ ├── flags: ∅ - │ │ │ │ └── name: :bar - │ │ │ ├── optionals: (length: 0) - │ │ │ ├── rest: ∅ - │ │ │ ├── posts: (length: 0) - │ │ │ ├── keywords: (length: 0) - │ │ │ ├── keyword_rest: ∅ - │ │ │ └── block: ∅ - │ │ ├── locals: (length: 0) - │ │ ├── opening_loc: (1,16)-(1,17) = "|" - │ │ └── closing_loc: (1,20)-(1,21) = "|" - │ ├── body: ∅ - │ ├── opening_loc: (1,13)-(1,15) = "do" - │ └── closing_loc: (1,22)-(1,25) = "end" - └── keyword_loc: (1,0)-(1,4) = "next" diff --git a/test/prism/snapshots/unless.txt b/test/prism/snapshots/unless.txt index df16f90fd8..6611ffe63d 100644 --- a/test/prism/snapshots/unless.txt +++ b/test/prism/snapshots/unless.txt @@ -51,32 +51,68 @@ │ │ └── value: 1 │ ├── consequent: ∅ │ └── end_keyword_loc: ∅ - ├── @ UnlessNode (location: (8,0)-(8,17)) - │ ├── keyword_loc: (8,6)-(8,12) = "unless" - │ ├── predicate: - │ │ @ TrueNode (location: (8,13)-(8,17)) - │ ├── then_keyword_loc: ∅ - │ ├── statements: - │ │ @ StatementsNode (location: (8,0)-(8,5)) - │ │ └── body: (length: 1) - │ │ └── @ BreakNode (location: (8,0)-(8,5)) - │ │ ├── arguments: ∅ - │ │ └── keyword_loc: (8,0)-(8,5) = "break" - │ ├── consequent: ∅ - │ └── end_keyword_loc: ∅ - ├── @ UnlessNode (location: (10,0)-(10,16)) - │ ├── keyword_loc: (10,5)-(10,11) = "unless" - │ ├── predicate: - │ │ @ TrueNode (location: (10,12)-(10,16)) - │ ├── then_keyword_loc: ∅ - │ ├── statements: - │ │ @ StatementsNode (location: (10,0)-(10,4)) - │ │ └── body: (length: 1) - │ │ └── @ NextNode (location: (10,0)-(10,4)) - │ │ ├── arguments: ∅ - │ │ └── keyword_loc: (10,0)-(10,4) = "next" - │ ├── consequent: ∅ - │ └── end_keyword_loc: ∅ + ├── @ CallNode (location: (8,0)-(8,25)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :tap + │ ├── message_loc: (8,0)-(8,3) = "tap" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (8,4)-(8,25)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (8,6)-(8,23)) + │ │ └── body: (length: 1) + │ │ └── @ UnlessNode (location: (8,6)-(8,23)) + │ │ ├── keyword_loc: (8,12)-(8,18) = "unless" + │ │ ├── predicate: + │ │ │ @ TrueNode (location: (8,19)-(8,23)) + │ │ ├── then_keyword_loc: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (8,6)-(8,11)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ BreakNode (location: (8,6)-(8,11)) + │ │ │ ├── arguments: ∅ + │ │ │ └── keyword_loc: (8,6)-(8,11) = "break" + │ │ ├── consequent: ∅ + │ │ └── end_keyword_loc: ∅ + │ ├── opening_loc: (8,4)-(8,5) = "{" + │ └── closing_loc: (8,24)-(8,25) = "}" + ├── @ CallNode (location: (10,0)-(10,24)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :tap + │ ├── message_loc: (10,0)-(10,3) = "tap" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (10,4)-(10,24)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (10,6)-(10,22)) + │ │ └── body: (length: 1) + │ │ └── @ UnlessNode (location: (10,6)-(10,22)) + │ │ ├── keyword_loc: (10,11)-(10,17) = "unless" + │ │ ├── predicate: + │ │ │ @ TrueNode (location: (10,18)-(10,22)) + │ │ ├── then_keyword_loc: ∅ + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (10,6)-(10,10)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ NextNode (location: (10,6)-(10,10)) + │ │ │ ├── arguments: ∅ + │ │ │ └── keyword_loc: (10,6)-(10,10) = "next" + │ │ ├── consequent: ∅ + │ │ └── end_keyword_loc: ∅ + │ ├── opening_loc: (10,4)-(10,5) = "{" + │ └── closing_loc: (10,23)-(10,24) = "}" ├── @ UnlessNode (location: (12,0)-(12,18)) │ ├── keyword_loc: (12,7)-(12,13) = "unless" │ ├── predicate: diff --git a/test/prism/snapshots/unparser/corpus/literal/control.txt b/test/prism/snapshots/unparser/corpus/literal/control.txt deleted file mode 100644 index 9bb303fed4..0000000000 --- a/test/prism/snapshots/unparser/corpus/literal/control.txt +++ /dev/null @@ -1,150 +0,0 @@ -@ ProgramNode (location: (1,0)-(15,3)) -├── locals: [] -└── statements: - @ StatementsNode (location: (1,0)-(15,3)) - └── body: (length: 11) - ├── @ NextNode (location: (1,0)-(1,4)) - │ ├── arguments: ∅ - │ └── keyword_loc: (1,0)-(1,4) = "next" - ├── @ ReturnNode (location: (2,0)-(2,6)) - │ ├── keyword_loc: (2,0)-(2,6) = "return" - │ └── arguments: ∅ - ├── @ BreakNode (location: (3,0)-(3,5)) - │ ├── arguments: ∅ - │ └── keyword_loc: (3,0)-(3,5) = "break" - ├── @ RetryNode (location: (4,0)-(4,5)) - ├── @ RedoNode (location: (5,0)-(5,4)) - ├── @ ReturnNode (location: (6,0)-(6,8)) - │ ├── keyword_loc: (6,0)-(6,6) = "return" - │ └── arguments: - │ @ ArgumentsNode (location: (6,7)-(6,8)) - │ ├── flags: ∅ - │ └── arguments: (length: 1) - │ └── @ IntegerNode (location: (6,7)-(6,8)) - │ ├── flags: decimal - │ └── value: 1 - ├── @ ReturnNode (location: (7,0)-(7,11)) - │ ├── keyword_loc: (7,0)-(7,6) = "return" - │ └── arguments: - │ @ ArgumentsNode (location: (7,7)-(7,11)) - │ ├── flags: ∅ - │ └── arguments: (length: 2) - │ ├── @ IntegerNode (location: (7,7)-(7,8)) - │ │ ├── flags: decimal - │ │ └── value: 1 - │ └── @ IntegerNode (location: (7,10)-(7,11)) - │ ├── flags: decimal - │ └── value: 2 - ├── @ ReturnNode (location: (8,0)-(8,19)) - │ ├── keyword_loc: (8,0)-(8,6) = "return" - │ └── arguments: - │ @ ArgumentsNode (location: (8,7)-(8,19)) - │ ├── flags: ∅ - │ └── arguments: (length: 1) - │ └── @ IfNode (location: (8,7)-(8,19)) - │ ├── if_keyword_loc: ∅ - │ ├── predicate: - │ │ @ TrueNode (location: (8,7)-(8,11)) - │ ├── then_keyword_loc: (8,12)-(8,13) = "?" - │ ├── statements: - │ │ @ StatementsNode (location: (8,14)-(8,15)) - │ │ └── body: (length: 1) - │ │ └── @ IntegerNode (location: (8,14)-(8,15)) - │ │ ├── flags: decimal - │ │ └── value: 1 - │ ├── consequent: - │ │ @ ElseNode (location: (8,16)-(8,19)) - │ │ ├── else_keyword_loc: (8,16)-(8,17) = ":" - │ │ ├── statements: - │ │ │ @ StatementsNode (location: (8,18)-(8,19)) - │ │ │ └── body: (length: 1) - │ │ │ └── @ IntegerNode (location: (8,18)-(8,19)) - │ │ │ ├── flags: decimal - │ │ │ └── value: 2 - │ │ └── end_keyword_loc: ∅ - │ └── end_keyword_loc: ∅ - ├── @ BreakNode (location: (9,0)-(9,18)) - │ ├── arguments: - │ │ @ ArgumentsNode (location: (9,6)-(9,18)) - │ │ ├── flags: ∅ - │ │ └── arguments: (length: 1) - │ │ └── @ IfNode (location: (9,6)-(9,18)) - │ │ ├── if_keyword_loc: ∅ - │ │ ├── predicate: - │ │ │ @ TrueNode (location: (9,6)-(9,10)) - │ │ ├── then_keyword_loc: (9,11)-(9,12) = "?" - │ │ ├── statements: - │ │ │ @ StatementsNode (location: (9,13)-(9,14)) - │ │ │ └── body: (length: 1) - │ │ │ └── @ IntegerNode (location: (9,13)-(9,14)) - │ │ │ ├── flags: decimal - │ │ │ └── value: 1 - │ │ ├── consequent: - │ │ │ @ ElseNode (location: (9,15)-(9,18)) - │ │ │ ├── else_keyword_loc: (9,15)-(9,16) = ":" - │ │ │ ├── statements: - │ │ │ │ @ StatementsNode (location: (9,17)-(9,18)) - │ │ │ │ └── body: (length: 1) - │ │ │ │ └── @ IntegerNode (location: (9,17)-(9,18)) - │ │ │ │ ├── flags: decimal - │ │ │ │ └── value: 2 - │ │ │ └── end_keyword_loc: ∅ - │ │ └── end_keyword_loc: ∅ - │ └── keyword_loc: (9,0)-(9,5) = "break" - ├── @ NextNode (location: (10,0)-(10,17)) - │ ├── arguments: - │ │ @ ArgumentsNode (location: (10,5)-(10,17)) - │ │ ├── flags: ∅ - │ │ └── arguments: (length: 1) - │ │ └── @ IfNode (location: (10,5)-(10,17)) - │ │ ├── if_keyword_loc: ∅ - │ │ ├── predicate: - │ │ │ @ TrueNode (location: (10,5)-(10,9)) - │ │ ├── then_keyword_loc: (10,10)-(10,11) = "?" - │ │ ├── statements: - │ │ │ @ StatementsNode (location: (10,12)-(10,13)) - │ │ │ └── body: (length: 1) - │ │ │ └── @ IntegerNode (location: (10,12)-(10,13)) - │ │ │ ├── flags: decimal - │ │ │ └── value: 1 - │ │ ├── consequent: - │ │ │ @ ElseNode (location: (10,14)-(10,17)) - │ │ │ ├── else_keyword_loc: (10,14)-(10,15) = ":" - │ │ │ ├── statements: - │ │ │ │ @ StatementsNode (location: (10,16)-(10,17)) - │ │ │ │ └── body: (length: 1) - │ │ │ │ └── @ IntegerNode (location: (10,16)-(10,17)) - │ │ │ │ ├── flags: decimal - │ │ │ │ └── value: 2 - │ │ │ └── end_keyword_loc: ∅ - │ │ └── end_keyword_loc: ∅ - │ └── keyword_loc: (10,0)-(10,4) = "next" - └── @ ReturnNode (location: (11,0)-(15,3)) - ├── keyword_loc: (11,0)-(11,6) = "return" - └── arguments: - @ ArgumentsNode (location: (11,7)-(15,3)) - ├── flags: ∅ - └── arguments: (length: 2) - ├── @ TrueNode (location: (11,7)-(11,11)) - └── @ IfNode (location: (11,13)-(15,3)) - ├── if_keyword_loc: (11,13)-(11,15) = "if" - ├── predicate: - │ @ TrueNode (location: (11,16)-(11,20)) - ├── then_keyword_loc: ∅ - ├── statements: - │ @ StatementsNode (location: (12,2)-(12,3)) - │ └── body: (length: 1) - │ └── @ IntegerNode (location: (12,2)-(12,3)) - │ ├── flags: decimal - │ └── value: 1 - ├── consequent: - │ @ ElseNode (location: (13,0)-(15,3)) - │ ├── else_keyword_loc: (13,0)-(13,4) = "else" - │ ├── statements: - │ │ @ StatementsNode (location: (14,2)-(14,3)) - │ │ └── body: (length: 1) - │ │ └── @ IntegerNode (location: (14,2)-(14,3)) - │ │ ├── flags: decimal - │ │ └── value: 2 - │ └── end_keyword_loc: (15,0)-(15,3) = "end" - └── end_keyword_loc: (15,0)-(15,3) = "end" diff --git a/test/prism/snapshots/until.txt b/test/prism/snapshots/until.txt index fc7cb92c91..d45e39644b 100644 --- a/test/prism/snapshots/until.txt +++ b/test/prism/snapshots/until.txt @@ -27,30 +27,66 @@ │ └── @ IntegerNode (location: (3,0)-(3,1)) │ ├── flags: decimal │ └── value: 1 - ├── @ UntilNode (location: (5,0)-(5,16)) - │ ├── flags: ∅ - │ ├── keyword_loc: (5,6)-(5,11) = "until" + ├── @ CallNode (location: (5,0)-(5,24)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :tap + │ ├── message_loc: (5,0)-(5,3) = "tap" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ │ ├── closing_loc: ∅ - │ ├── predicate: - │ │ @ TrueNode (location: (5,12)-(5,16)) - │ └── statements: - │ @ StatementsNode (location: (5,0)-(5,5)) - │ └── body: (length: 1) - │ └── @ BreakNode (location: (5,0)-(5,5)) - │ ├── arguments: ∅ - │ └── keyword_loc: (5,0)-(5,5) = "break" - ├── @ UntilNode (location: (7,0)-(7,15)) - │ ├── flags: ∅ - │ ├── keyword_loc: (7,5)-(7,10) = "until" + │ └── block: + │ @ BlockNode (location: (5,4)-(5,24)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (5,6)-(5,22)) + │ │ └── body: (length: 1) + │ │ └── @ UntilNode (location: (5,6)-(5,22)) + │ │ ├── flags: ∅ + │ │ ├── keyword_loc: (5,12)-(5,17) = "until" + │ │ ├── closing_loc: ∅ + │ │ ├── predicate: + │ │ │ @ TrueNode (location: (5,18)-(5,22)) + │ │ └── statements: + │ │ @ StatementsNode (location: (5,6)-(5,11)) + │ │ └── body: (length: 1) + │ │ └── @ BreakNode (location: (5,6)-(5,11)) + │ │ ├── arguments: ∅ + │ │ └── keyword_loc: (5,6)-(5,11) = "break" + │ ├── opening_loc: (5,4)-(5,5) = "{" + │ └── closing_loc: (5,23)-(5,24) = "}" + ├── @ CallNode (location: (7,0)-(7,23)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :tap + │ ├── message_loc: (7,0)-(7,3) = "tap" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ │ ├── closing_loc: ∅ - │ ├── predicate: - │ │ @ TrueNode (location: (7,11)-(7,15)) - │ └── statements: - │ @ StatementsNode (location: (7,0)-(7,4)) - │ └── body: (length: 1) - │ └── @ NextNode (location: (7,0)-(7,4)) - │ ├── arguments: ∅ - │ └── keyword_loc: (7,0)-(7,4) = "next" + │ └── block: + │ @ BlockNode (location: (7,4)-(7,23)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (7,6)-(7,21)) + │ │ └── body: (length: 1) + │ │ └── @ UntilNode (location: (7,6)-(7,21)) + │ │ ├── flags: ∅ + │ │ ├── keyword_loc: (7,11)-(7,16) = "until" + │ │ ├── closing_loc: ∅ + │ │ ├── predicate: + │ │ │ @ TrueNode (location: (7,17)-(7,21)) + │ │ └── statements: + │ │ @ StatementsNode (location: (7,6)-(7,10)) + │ │ └── body: (length: 1) + │ │ └── @ NextNode (location: (7,6)-(7,10)) + │ │ ├── arguments: ∅ + │ │ └── keyword_loc: (7,6)-(7,10) = "next" + │ ├── opening_loc: (7,4)-(7,5) = "{" + │ └── closing_loc: (7,22)-(7,23) = "}" ├── @ UntilNode (location: (9,0)-(9,17)) │ ├── flags: ∅ │ ├── keyword_loc: (9,7)-(9,12) = "until" diff --git a/test/prism/snapshots/while.txt b/test/prism/snapshots/while.txt index 9f19164798..36fab49960 100644 --- a/test/prism/snapshots/while.txt +++ b/test/prism/snapshots/while.txt @@ -27,30 +27,66 @@ │ └── @ IntegerNode (location: (3,0)-(3,1)) │ ├── flags: decimal │ └── value: 1 - ├── @ WhileNode (location: (5,0)-(5,16)) - │ ├── flags: ∅ - │ ├── keyword_loc: (5,6)-(5,11) = "while" + ├── @ CallNode (location: (5,0)-(5,24)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :tap + │ ├── message_loc: (5,0)-(5,3) = "tap" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ │ ├── closing_loc: ∅ - │ ├── predicate: - │ │ @ TrueNode (location: (5,12)-(5,16)) - │ └── statements: - │ @ StatementsNode (location: (5,0)-(5,5)) - │ └── body: (length: 1) - │ └── @ BreakNode (location: (5,0)-(5,5)) - │ ├── arguments: ∅ - │ └── keyword_loc: (5,0)-(5,5) = "break" - ├── @ WhileNode (location: (7,0)-(7,15)) - │ ├── flags: ∅ - │ ├── keyword_loc: (7,5)-(7,10) = "while" + │ └── block: + │ @ BlockNode (location: (5,4)-(5,24)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (5,6)-(5,22)) + │ │ └── body: (length: 1) + │ │ └── @ WhileNode (location: (5,6)-(5,22)) + │ │ ├── flags: ∅ + │ │ ├── keyword_loc: (5,12)-(5,17) = "while" + │ │ ├── closing_loc: ∅ + │ │ ├── predicate: + │ │ │ @ TrueNode (location: (5,18)-(5,22)) + │ │ └── statements: + │ │ @ StatementsNode (location: (5,6)-(5,11)) + │ │ └── body: (length: 1) + │ │ └── @ BreakNode (location: (5,6)-(5,11)) + │ │ ├── arguments: ∅ + │ │ └── keyword_loc: (5,6)-(5,11) = "break" + │ ├── opening_loc: (5,4)-(5,5) = "{" + │ └── closing_loc: (5,23)-(5,24) = "}" + ├── @ CallNode (location: (7,0)-(7,23)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :tap + │ ├── message_loc: (7,0)-(7,3) = "tap" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ │ ├── closing_loc: ∅ - │ ├── predicate: - │ │ @ TrueNode (location: (7,11)-(7,15)) - │ └── statements: - │ @ StatementsNode (location: (7,0)-(7,4)) - │ └── body: (length: 1) - │ └── @ NextNode (location: (7,0)-(7,4)) - │ ├── arguments: ∅ - │ └── keyword_loc: (7,0)-(7,4) = "next" + │ └── block: + │ @ BlockNode (location: (7,4)-(7,23)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (7,6)-(7,21)) + │ │ └── body: (length: 1) + │ │ └── @ WhileNode (location: (7,6)-(7,21)) + │ │ ├── flags: ∅ + │ │ ├── keyword_loc: (7,11)-(7,16) = "while" + │ │ ├── closing_loc: ∅ + │ │ ├── predicate: + │ │ │ @ TrueNode (location: (7,17)-(7,21)) + │ │ └── statements: + │ │ @ StatementsNode (location: (7,6)-(7,10)) + │ │ └── body: (length: 1) + │ │ └── @ NextNode (location: (7,6)-(7,10)) + │ │ ├── arguments: ∅ + │ │ └── keyword_loc: (7,6)-(7,10) = "next" + │ ├── opening_loc: (7,4)-(7,5) = "{" + │ └── closing_loc: (7,22)-(7,23) = "}" ├── @ WhileNode (location: (9,0)-(9,17)) │ ├── flags: ∅ │ ├── keyword_loc: (9,7)-(9,12) = "while" @@ -106,187 +142,259 @@ │ │ └── unescaped: "b" │ ├── closing_loc: ∅ │ └── block: ∅ - ├── @ WhileNode (location: (13,0)-(13,50)) - │ ├── flags: ∅ - │ ├── keyword_loc: (13,0)-(13,5) = "while" - │ ├── closing_loc: (13,47)-(13,50) = "end" - │ ├── predicate: - │ │ @ DefNode (location: (13,6)-(13,38)) - │ │ ├── name: :foo - │ │ ├── name_loc: (13,15)-(13,18) = "foo" - │ │ ├── receiver: - │ │ │ @ SelfNode (location: (13,10)-(13,14)) - │ │ ├── parameters: - │ │ │ @ ParametersNode (location: (13,19)-(13,33)) - │ │ │ ├── requireds: (length: 0) - │ │ │ ├── optionals: (length: 1) - │ │ │ │ └── @ OptionalParameterNode (location: (13,19)-(13,33)) - │ │ │ │ ├── flags: ∅ - │ │ │ │ ├── name: :a - │ │ │ │ ├── name_loc: (13,19)-(13,20) = "a" - │ │ │ │ ├── operator_loc: (13,21)-(13,22) = "=" - │ │ │ │ └── value: - │ │ │ │ @ CallNode (location: (13,23)-(13,33)) - │ │ │ │ ├── flags: ignore_visibility - │ │ │ │ ├── receiver: ∅ - │ │ │ │ ├── call_operator_loc: ∅ - │ │ │ │ ├── name: :tap - │ │ │ │ ├── message_loc: (13,23)-(13,26) = "tap" - │ │ │ │ ├── opening_loc: ∅ - │ │ │ │ ├── arguments: ∅ - │ │ │ │ ├── closing_loc: ∅ - │ │ │ │ └── block: - │ │ │ │ @ BlockNode (location: (13,27)-(13,33)) - │ │ │ │ ├── locals: [] - │ │ │ │ ├── parameters: ∅ - │ │ │ │ ├── body: ∅ - │ │ │ │ ├── opening_loc: (13,27)-(13,29) = "do" - │ │ │ │ └── closing_loc: (13,30)-(13,33) = "end" - │ │ │ ├── rest: ∅ - │ │ │ ├── posts: (length: 0) - │ │ │ ├── keywords: (length: 0) - │ │ │ ├── keyword_rest: ∅ - │ │ │ └── block: ∅ - │ │ ├── body: ∅ - │ │ ├── locals: [:a] - │ │ ├── def_keyword_loc: (13,6)-(13,9) = "def" - │ │ ├── operator_loc: (13,14)-(13,15) = "." - │ │ ├── lparen_loc: ∅ - │ │ ├── rparen_loc: ∅ - │ │ ├── equal_loc: ∅ - │ │ └── end_keyword_loc: (13,35)-(13,38) = "end" - │ └── statements: - │ @ StatementsNode (location: (13,40)-(13,45)) - │ └── body: (length: 1) - │ └── @ BreakNode (location: (13,40)-(13,45)) - │ ├── arguments: ∅ - │ └── keyword_loc: (13,40)-(13,45) = "break" - ├── @ WhileNode (location: (15,0)-(15,47)) - │ ├── flags: ∅ - │ ├── keyword_loc: (15,0)-(15,5) = "while" - │ ├── closing_loc: (15,44)-(15,47) = "end" - │ ├── predicate: - │ │ @ ClassNode (location: (15,6)-(15,35)) - │ │ ├── locals: [:a] - │ │ ├── class_keyword_loc: (15,6)-(15,11) = "class" - │ │ ├── constant_path: - │ │ │ @ ConstantReadNode (location: (15,12)-(15,15)) - │ │ │ └── name: :Foo - │ │ ├── inheritance_operator_loc: ∅ - │ │ ├── superclass: ∅ - │ │ ├── body: - │ │ │ @ StatementsNode (location: (15,16)-(15,30)) - │ │ │ └── body: (length: 1) - │ │ │ └── @ LocalVariableWriteNode (location: (15,16)-(15,30)) - │ │ │ ├── name: :a - │ │ │ ├── depth: 0 - │ │ │ ├── name_loc: (15,16)-(15,17) = "a" - │ │ │ ├── value: - │ │ │ │ @ CallNode (location: (15,20)-(15,30)) - │ │ │ │ ├── flags: ignore_visibility - │ │ │ │ ├── receiver: ∅ - │ │ │ │ ├── call_operator_loc: ∅ - │ │ │ │ ├── name: :tap - │ │ │ │ ├── message_loc: (15,20)-(15,23) = "tap" - │ │ │ │ ├── opening_loc: ∅ - │ │ │ │ ├── arguments: ∅ - │ │ │ │ ├── closing_loc: ∅ - │ │ │ │ └── block: - │ │ │ │ @ BlockNode (location: (15,24)-(15,30)) - │ │ │ │ ├── locals: [] - │ │ │ │ ├── parameters: ∅ - │ │ │ │ ├── body: ∅ - │ │ │ │ ├── opening_loc: (15,24)-(15,26) = "do" - │ │ │ │ └── closing_loc: (15,27)-(15,30) = "end" - │ │ │ └── operator_loc: (15,18)-(15,19) = "=" - │ │ ├── end_keyword_loc: (15,32)-(15,35) = "end" - │ │ └── name: :Foo - │ └── statements: - │ @ StatementsNode (location: (15,37)-(15,42)) - │ └── body: (length: 1) - │ └── @ BreakNode (location: (15,37)-(15,42)) - │ ├── arguments: ∅ - │ └── keyword_loc: (15,37)-(15,42) = "break" - ├── @ WhileNode (location: (17,0)-(17,48)) - │ ├── flags: ∅ - │ ├── keyword_loc: (17,0)-(17,5) = "while" - │ ├── closing_loc: (17,45)-(17,48) = "end" - │ ├── predicate: - │ │ @ SingletonClassNode (location: (17,6)-(17,36)) - │ │ ├── locals: [] - │ │ ├── class_keyword_loc: (17,6)-(17,11) = "class" - │ │ ├── operator_loc: (17,12)-(17,14) = "<<" - │ │ ├── expression: - │ │ │ @ SelfNode (location: (17,15)-(17,19)) - │ │ ├── body: - │ │ │ @ StatementsNode (location: (17,21)-(17,31)) - │ │ │ └── body: (length: 1) - │ │ │ └── @ CallNode (location: (17,21)-(17,31)) - │ │ │ ├── flags: ignore_visibility - │ │ │ ├── receiver: ∅ - │ │ │ ├── call_operator_loc: ∅ - │ │ │ ├── name: :tap - │ │ │ ├── message_loc: (17,21)-(17,24) = "tap" - │ │ │ ├── opening_loc: ∅ - │ │ │ ├── arguments: ∅ - │ │ │ ├── closing_loc: ∅ - │ │ │ └── block: - │ │ │ @ BlockNode (location: (17,25)-(17,31)) - │ │ │ ├── locals: [] - │ │ │ ├── parameters: ∅ - │ │ │ ├── body: ∅ - │ │ │ ├── opening_loc: (17,25)-(17,27) = "do" - │ │ │ └── closing_loc: (17,28)-(17,31) = "end" - │ │ └── end_keyword_loc: (17,33)-(17,36) = "end" - │ └── statements: - │ @ StatementsNode (location: (17,38)-(17,43)) - │ └── body: (length: 1) - │ └── @ BreakNode (location: (17,38)-(17,43)) - │ ├── arguments: ∅ - │ └── keyword_loc: (17,38)-(17,43) = "break" - ├── @ WhileNode (location: (19,0)-(19,52)) - │ ├── flags: ∅ - │ ├── keyword_loc: (19,0)-(19,5) = "while" - │ ├── closing_loc: (19,49)-(19,52) = "end" - │ ├── predicate: - │ │ @ SingletonClassNode (location: (19,6)-(19,40)) - │ │ ├── locals: [:a] - │ │ ├── class_keyword_loc: (19,6)-(19,11) = "class" - │ │ ├── operator_loc: (19,12)-(19,14) = "<<" - │ │ ├── expression: - │ │ │ @ SelfNode (location: (19,15)-(19,19)) - │ │ ├── body: - │ │ │ @ StatementsNode (location: (19,21)-(19,35)) - │ │ │ └── body: (length: 1) - │ │ │ └── @ LocalVariableWriteNode (location: (19,21)-(19,35)) - │ │ │ ├── name: :a - │ │ │ ├── depth: 0 - │ │ │ ├── name_loc: (19,21)-(19,22) = "a" - │ │ │ ├── value: - │ │ │ │ @ CallNode (location: (19,25)-(19,35)) - │ │ │ │ ├── flags: ignore_visibility - │ │ │ │ ├── receiver: ∅ - │ │ │ │ ├── call_operator_loc: ∅ - │ │ │ │ ├── name: :tap - │ │ │ │ ├── message_loc: (19,25)-(19,28) = "tap" - │ │ │ │ ├── opening_loc: ∅ - │ │ │ │ ├── arguments: ∅ - │ │ │ │ ├── closing_loc: ∅ - │ │ │ │ └── block: - │ │ │ │ @ BlockNode (location: (19,29)-(19,35)) - │ │ │ │ ├── locals: [] - │ │ │ │ ├── parameters: ∅ - │ │ │ │ ├── body: ∅ - │ │ │ │ ├── opening_loc: (19,29)-(19,31) = "do" - │ │ │ │ └── closing_loc: (19,32)-(19,35) = "end" - │ │ │ └── operator_loc: (19,23)-(19,24) = "=" - │ │ └── end_keyword_loc: (19,37)-(19,40) = "end" - │ └── statements: - │ @ StatementsNode (location: (19,42)-(19,47)) - │ └── body: (length: 1) - │ └── @ BreakNode (location: (19,42)-(19,47)) - │ ├── arguments: ∅ - │ └── keyword_loc: (19,42)-(19,47) = "break" + ├── @ CallNode (location: (13,0)-(13,58)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :tap + │ ├── message_loc: (13,0)-(13,3) = "tap" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (13,4)-(13,58)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (13,6)-(13,56)) + │ │ └── body: (length: 1) + │ │ └── @ WhileNode (location: (13,6)-(13,56)) + │ │ ├── flags: ∅ + │ │ ├── keyword_loc: (13,6)-(13,11) = "while" + │ │ ├── closing_loc: (13,53)-(13,56) = "end" + │ │ ├── predicate: + │ │ │ @ DefNode (location: (13,12)-(13,44)) + │ │ │ ├── name: :foo + │ │ │ ├── name_loc: (13,21)-(13,24) = "foo" + │ │ │ ├── receiver: + │ │ │ │ @ SelfNode (location: (13,16)-(13,20)) + │ │ │ ├── parameters: + │ │ │ │ @ ParametersNode (location: (13,25)-(13,39)) + │ │ │ │ ├── requireds: (length: 0) + │ │ │ │ ├── optionals: (length: 1) + │ │ │ │ │ └── @ OptionalParameterNode (location: (13,25)-(13,39)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ ├── name: :a + │ │ │ │ │ ├── name_loc: (13,25)-(13,26) = "a" + │ │ │ │ │ ├── operator_loc: (13,27)-(13,28) = "=" + │ │ │ │ │ └── value: + │ │ │ │ │ @ CallNode (location: (13,29)-(13,39)) + │ │ │ │ │ ├── flags: ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :tap + │ │ │ │ │ ├── message_loc: (13,29)-(13,32) = "tap" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: + │ │ │ │ │ @ BlockNode (location: (13,33)-(13,39)) + │ │ │ │ │ ├── locals: [] + │ │ │ │ │ ├── parameters: ∅ + │ │ │ │ │ ├── body: ∅ + │ │ │ │ │ ├── opening_loc: (13,33)-(13,35) = "do" + │ │ │ │ │ └── closing_loc: (13,36)-(13,39) = "end" + │ │ │ │ ├── rest: ∅ + │ │ │ │ ├── posts: (length: 0) + │ │ │ │ ├── keywords: (length: 0) + │ │ │ │ ├── keyword_rest: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── body: ∅ + │ │ │ ├── locals: [:a] + │ │ │ ├── def_keyword_loc: (13,12)-(13,15) = "def" + │ │ │ ├── operator_loc: (13,20)-(13,21) = "." + │ │ │ ├── lparen_loc: ∅ + │ │ │ ├── rparen_loc: ∅ + │ │ │ ├── equal_loc: ∅ + │ │ │ └── end_keyword_loc: (13,41)-(13,44) = "end" + │ │ └── statements: + │ │ @ StatementsNode (location: (13,46)-(13,51)) + │ │ └── body: (length: 1) + │ │ └── @ BreakNode (location: (13,46)-(13,51)) + │ │ ├── arguments: ∅ + │ │ └── keyword_loc: (13,46)-(13,51) = "break" + │ ├── opening_loc: (13,4)-(13,5) = "{" + │ └── closing_loc: (13,57)-(13,58) = "}" + ├── @ CallNode (location: (15,0)-(15,55)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :tap + │ ├── message_loc: (15,0)-(15,3) = "tap" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (15,4)-(15,55)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (15,6)-(15,53)) + │ │ └── body: (length: 1) + │ │ └── @ WhileNode (location: (15,6)-(15,53)) + │ │ ├── flags: ∅ + │ │ ├── keyword_loc: (15,6)-(15,11) = "while" + │ │ ├── closing_loc: (15,50)-(15,53) = "end" + │ │ ├── predicate: + │ │ │ @ ClassNode (location: (15,12)-(15,41)) + │ │ │ ├── locals: [:a] + │ │ │ ├── class_keyword_loc: (15,12)-(15,17) = "class" + │ │ │ ├── constant_path: + │ │ │ │ @ ConstantReadNode (location: (15,18)-(15,21)) + │ │ │ │ └── name: :Foo + │ │ │ ├── inheritance_operator_loc: ∅ + │ │ │ ├── superclass: ∅ + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (15,22)-(15,36)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ LocalVariableWriteNode (location: (15,22)-(15,36)) + │ │ │ │ ├── name: :a + │ │ │ │ ├── depth: 0 + │ │ │ │ ├── name_loc: (15,22)-(15,23) = "a" + │ │ │ │ ├── value: + │ │ │ │ │ @ CallNode (location: (15,26)-(15,36)) + │ │ │ │ │ ├── flags: ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :tap + │ │ │ │ │ ├── message_loc: (15,26)-(15,29) = "tap" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: + │ │ │ │ │ @ BlockNode (location: (15,30)-(15,36)) + │ │ │ │ │ ├── locals: [] + │ │ │ │ │ ├── parameters: ∅ + │ │ │ │ │ ├── body: ∅ + │ │ │ │ │ ├── opening_loc: (15,30)-(15,32) = "do" + │ │ │ │ │ └── closing_loc: (15,33)-(15,36) = "end" + │ │ │ │ └── operator_loc: (15,24)-(15,25) = "=" + │ │ │ ├── end_keyword_loc: (15,38)-(15,41) = "end" + │ │ │ └── name: :Foo + │ │ └── statements: + │ │ @ StatementsNode (location: (15,43)-(15,48)) + │ │ └── body: (length: 1) + │ │ └── @ BreakNode (location: (15,43)-(15,48)) + │ │ ├── arguments: ∅ + │ │ └── keyword_loc: (15,43)-(15,48) = "break" + │ ├── opening_loc: (15,4)-(15,5) = "{" + │ └── closing_loc: (15,54)-(15,55) = "}" + ├── @ CallNode (location: (17,0)-(17,56)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :tap + │ ├── message_loc: (17,0)-(17,3) = "tap" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (17,4)-(17,56)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (17,6)-(17,54)) + │ │ └── body: (length: 1) + │ │ └── @ WhileNode (location: (17,6)-(17,54)) + │ │ ├── flags: ∅ + │ │ ├── keyword_loc: (17,6)-(17,11) = "while" + │ │ ├── closing_loc: (17,51)-(17,54) = "end" + │ │ ├── predicate: + │ │ │ @ SingletonClassNode (location: (17,12)-(17,42)) + │ │ │ ├── locals: [] + │ │ │ ├── class_keyword_loc: (17,12)-(17,17) = "class" + │ │ │ ├── operator_loc: (17,18)-(17,20) = "<<" + │ │ │ ├── expression: + │ │ │ │ @ SelfNode (location: (17,21)-(17,25)) + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (17,27)-(17,37)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (17,27)-(17,37)) + │ │ │ │ ├── flags: ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :tap + │ │ │ │ ├── message_loc: (17,27)-(17,30) = "tap" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: + │ │ │ │ @ BlockNode (location: (17,31)-(17,37)) + │ │ │ │ ├── locals: [] + │ │ │ │ ├── parameters: ∅ + │ │ │ │ ├── body: ∅ + │ │ │ │ ├── opening_loc: (17,31)-(17,33) = "do" + │ │ │ │ └── closing_loc: (17,34)-(17,37) = "end" + │ │ │ └── end_keyword_loc: (17,39)-(17,42) = "end" + │ │ └── statements: + │ │ @ StatementsNode (location: (17,44)-(17,49)) + │ │ └── body: (length: 1) + │ │ └── @ BreakNode (location: (17,44)-(17,49)) + │ │ ├── arguments: ∅ + │ │ └── keyword_loc: (17,44)-(17,49) = "break" + │ ├── opening_loc: (17,4)-(17,5) = "{" + │ └── closing_loc: (17,55)-(17,56) = "}" + ├── @ CallNode (location: (19,0)-(19,60)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :tap + │ ├── message_loc: (19,0)-(19,3) = "tap" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (19,4)-(19,60)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (19,6)-(19,58)) + │ │ └── body: (length: 1) + │ │ └── @ WhileNode (location: (19,6)-(19,58)) + │ │ ├── flags: ∅ + │ │ ├── keyword_loc: (19,6)-(19,11) = "while" + │ │ ├── closing_loc: (19,55)-(19,58) = "end" + │ │ ├── predicate: + │ │ │ @ SingletonClassNode (location: (19,12)-(19,46)) + │ │ │ ├── locals: [:a] + │ │ │ ├── class_keyword_loc: (19,12)-(19,17) = "class" + │ │ │ ├── operator_loc: (19,18)-(19,20) = "<<" + │ │ │ ├── expression: + │ │ │ │ @ SelfNode (location: (19,21)-(19,25)) + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (19,27)-(19,41)) + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ LocalVariableWriteNode (location: (19,27)-(19,41)) + │ │ │ │ ├── name: :a + │ │ │ │ ├── depth: 0 + │ │ │ │ ├── name_loc: (19,27)-(19,28) = "a" + │ │ │ │ ├── value: + │ │ │ │ │ @ CallNode (location: (19,31)-(19,41)) + │ │ │ │ │ ├── flags: ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :tap + │ │ │ │ │ ├── message_loc: (19,31)-(19,34) = "tap" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: + │ │ │ │ │ @ BlockNode (location: (19,35)-(19,41)) + │ │ │ │ │ ├── locals: [] + │ │ │ │ │ ├── parameters: ∅ + │ │ │ │ │ ├── body: ∅ + │ │ │ │ │ ├── opening_loc: (19,35)-(19,37) = "do" + │ │ │ │ │ └── closing_loc: (19,38)-(19,41) = "end" + │ │ │ │ └── operator_loc: (19,29)-(19,30) = "=" + │ │ │ └── end_keyword_loc: (19,43)-(19,46) = "end" + │ │ └── statements: + │ │ @ StatementsNode (location: (19,48)-(19,53)) + │ │ └── body: (length: 1) + │ │ └── @ BreakNode (location: (19,48)-(19,53)) + │ │ ├── arguments: ∅ + │ │ └── keyword_loc: (19,48)-(19,53) = "break" + │ ├── opening_loc: (19,4)-(19,5) = "{" + │ └── closing_loc: (19,59)-(19,60) = "}" ├── @ WhileNode (location: (21,0)-(21,31)) │ ├── flags: ∅ │ ├── keyword_loc: (21,0)-(21,5) = "while" diff --git a/test/prism/snapshots/whitequark/break.txt b/test/prism/snapshots/whitequark/break.txt deleted file mode 100644 index 7ce2bfa136..0000000000 --- a/test/prism/snapshots/whitequark/break.txt +++ /dev/null @@ -1,56 +0,0 @@ -@ ProgramNode (location: (1,0)-(7,10)) -├── locals: [] -└── statements: - @ StatementsNode (location: (1,0)-(7,10)) - └── body: (length: 4) - ├── @ BreakNode (location: (1,0)-(1,5)) - │ ├── arguments: ∅ - │ └── keyword_loc: (1,0)-(1,5) = "break" - ├── @ BreakNode (location: (3,0)-(3,9)) - │ ├── arguments: - │ │ @ ArgumentsNode (location: (3,6)-(3,9)) - │ │ ├── flags: ∅ - │ │ └── arguments: (length: 1) - │ │ └── @ CallNode (location: (3,6)-(3,9)) - │ │ ├── flags: variable_call, ignore_visibility - │ │ ├── receiver: ∅ - │ │ ├── call_operator_loc: ∅ - │ │ ├── name: :foo - │ │ ├── message_loc: (3,6)-(3,9) = "foo" - │ │ ├── opening_loc: ∅ - │ │ ├── arguments: ∅ - │ │ ├── closing_loc: ∅ - │ │ └── block: ∅ - │ └── keyword_loc: (3,0)-(3,5) = "break" - ├── @ BreakNode (location: (5,0)-(5,7)) - │ ├── arguments: - │ │ @ ArgumentsNode (location: (5,5)-(5,7)) - │ │ ├── flags: ∅ - │ │ └── arguments: (length: 1) - │ │ └── @ ParenthesesNode (location: (5,5)-(5,7)) - │ │ ├── body: ∅ - │ │ ├── opening_loc: (5,5)-(5,6) = "(" - │ │ └── closing_loc: (5,6)-(5,7) = ")" - │ └── keyword_loc: (5,0)-(5,5) = "break" - └── @ BreakNode (location: (7,0)-(7,10)) - ├── arguments: - │ @ ArgumentsNode (location: (7,5)-(7,10)) - │ ├── flags: ∅ - │ └── arguments: (length: 1) - │ └── @ ParenthesesNode (location: (7,5)-(7,10)) - │ ├── body: - │ │ @ StatementsNode (location: (7,6)-(7,9)) - │ │ └── body: (length: 1) - │ │ └── @ CallNode (location: (7,6)-(7,9)) - │ │ ├── flags: variable_call, ignore_visibility - │ │ ├── receiver: ∅ - │ │ ├── call_operator_loc: ∅ - │ │ ├── name: :foo - │ │ ├── message_loc: (7,6)-(7,9) = "foo" - │ │ ├── opening_loc: ∅ - │ │ ├── arguments: ∅ - │ │ ├── closing_loc: ∅ - │ │ └── block: ∅ - │ ├── opening_loc: (7,5)-(7,6) = "(" - │ └── closing_loc: (7,9)-(7,10) = ")" - └── keyword_loc: (7,0)-(7,5) = "break" diff --git a/test/prism/snapshots/whitequark/break_block.txt b/test/prism/snapshots/whitequark/break_block.txt deleted file mode 100644 index 9322868944..0000000000 --- a/test/prism/snapshots/whitequark/break_block.txt +++ /dev/null @@ -1,40 +0,0 @@ -@ ProgramNode (location: (1,0)-(1,20)) -├── locals: [] -└── statements: - @ StatementsNode (location: (1,0)-(1,20)) - └── body: (length: 1) - └── @ BreakNode (location: (1,0)-(1,20)) - ├── arguments: - │ @ ArgumentsNode (location: (1,6)-(1,20)) - │ ├── flags: ∅ - │ └── arguments: (length: 1) - │ └── @ CallNode (location: (1,6)-(1,20)) - │ ├── flags: ignore_visibility - │ ├── receiver: ∅ - │ ├── call_operator_loc: ∅ - │ ├── name: :fun - │ ├── message_loc: (1,6)-(1,9) = "fun" - │ ├── opening_loc: ∅ - │ ├── arguments: - │ │ @ ArgumentsNode (location: (1,10)-(1,13)) - │ │ ├── flags: ∅ - │ │ └── arguments: (length: 1) - │ │ └── @ CallNode (location: (1,10)-(1,13)) - │ │ ├── flags: variable_call, ignore_visibility - │ │ ├── receiver: ∅ - │ │ ├── call_operator_loc: ∅ - │ │ ├── name: :foo - │ │ ├── message_loc: (1,10)-(1,13) = "foo" - │ │ ├── opening_loc: ∅ - │ │ ├── arguments: ∅ - │ │ ├── closing_loc: ∅ - │ │ └── block: ∅ - │ ├── closing_loc: ∅ - │ └── block: - │ @ BlockNode (location: (1,14)-(1,20)) - │ ├── locals: [] - │ ├── parameters: ∅ - │ ├── body: ∅ - │ ├── opening_loc: (1,14)-(1,16) = "do" - │ └── closing_loc: (1,17)-(1,20) = "end" - └── keyword_loc: (1,0)-(1,5) = "break" diff --git a/test/prism/snapshots/whitequark/class_definition_in_while_cond.txt b/test/prism/snapshots/whitequark/class_definition_in_while_cond.txt deleted file mode 100644 index c02c88e79b..0000000000 --- a/test/prism/snapshots/whitequark/class_definition_in_while_cond.txt +++ /dev/null @@ -1,171 +0,0 @@ -@ ProgramNode (location: (1,0)-(7,44)) -├── locals: [] -└── statements: - @ StatementsNode (location: (1,0)-(7,44)) - └── body: (length: 4) - ├── @ WhileNode (location: (1,0)-(1,52)) - │ ├── flags: ∅ - │ ├── keyword_loc: (1,0)-(1,5) = "while" - │ ├── closing_loc: (1,49)-(1,52) = "end" - │ ├── predicate: - │ │ @ SingletonClassNode (location: (1,6)-(1,40)) - │ │ ├── locals: [:a] - │ │ ├── class_keyword_loc: (1,6)-(1,11) = "class" - │ │ ├── operator_loc: (1,12)-(1,14) = "<<" - │ │ ├── expression: - │ │ │ @ SelfNode (location: (1,15)-(1,19)) - │ │ ├── body: - │ │ │ @ StatementsNode (location: (1,21)-(1,35)) - │ │ │ └── body: (length: 1) - │ │ │ └── @ LocalVariableWriteNode (location: (1,21)-(1,35)) - │ │ │ ├── name: :a - │ │ │ ├── depth: 0 - │ │ │ ├── name_loc: (1,21)-(1,22) = "a" - │ │ │ ├── value: - │ │ │ │ @ CallNode (location: (1,25)-(1,35)) - │ │ │ │ ├── flags: ignore_visibility - │ │ │ │ ├── receiver: ∅ - │ │ │ │ ├── call_operator_loc: ∅ - │ │ │ │ ├── name: :tap - │ │ │ │ ├── message_loc: (1,25)-(1,28) = "tap" - │ │ │ │ ├── opening_loc: ∅ - │ │ │ │ ├── arguments: ∅ - │ │ │ │ ├── closing_loc: ∅ - │ │ │ │ └── block: - │ │ │ │ @ BlockNode (location: (1,29)-(1,35)) - │ │ │ │ ├── locals: [] - │ │ │ │ ├── parameters: ∅ - │ │ │ │ ├── body: ∅ - │ │ │ │ ├── opening_loc: (1,29)-(1,31) = "do" - │ │ │ │ └── closing_loc: (1,32)-(1,35) = "end" - │ │ │ └── operator_loc: (1,23)-(1,24) = "=" - │ │ └── end_keyword_loc: (1,37)-(1,40) = "end" - │ └── statements: - │ @ StatementsNode (location: (1,42)-(1,47)) - │ └── body: (length: 1) - │ └── @ BreakNode (location: (1,42)-(1,47)) - │ ├── arguments: ∅ - │ └── keyword_loc: (1,42)-(1,47) = "break" - ├── @ WhileNode (location: (3,0)-(3,48)) - │ ├── flags: ∅ - │ ├── keyword_loc: (3,0)-(3,5) = "while" - │ ├── closing_loc: (3,45)-(3,48) = "end" - │ ├── predicate: - │ │ @ SingletonClassNode (location: (3,6)-(3,36)) - │ │ ├── locals: [] - │ │ ├── class_keyword_loc: (3,6)-(3,11) = "class" - │ │ ├── operator_loc: (3,12)-(3,14) = "<<" - │ │ ├── expression: - │ │ │ @ SelfNode (location: (3,15)-(3,19)) - │ │ ├── body: - │ │ │ @ StatementsNode (location: (3,21)-(3,31)) - │ │ │ └── body: (length: 1) - │ │ │ └── @ CallNode (location: (3,21)-(3,31)) - │ │ │ ├── flags: ignore_visibility - │ │ │ ├── receiver: ∅ - │ │ │ ├── call_operator_loc: ∅ - │ │ │ ├── name: :tap - │ │ │ ├── message_loc: (3,21)-(3,24) = "tap" - │ │ │ ├── opening_loc: ∅ - │ │ │ ├── arguments: ∅ - │ │ │ ├── closing_loc: ∅ - │ │ │ └── block: - │ │ │ @ BlockNode (location: (3,25)-(3,31)) - │ │ │ ├── locals: [] - │ │ │ ├── parameters: ∅ - │ │ │ ├── body: ∅ - │ │ │ ├── opening_loc: (3,25)-(3,27) = "do" - │ │ │ └── closing_loc: (3,28)-(3,31) = "end" - │ │ └── end_keyword_loc: (3,33)-(3,36) = "end" - │ └── statements: - │ @ StatementsNode (location: (3,38)-(3,43)) - │ └── body: (length: 1) - │ └── @ BreakNode (location: (3,38)-(3,43)) - │ ├── arguments: ∅ - │ └── keyword_loc: (3,38)-(3,43) = "break" - ├── @ WhileNode (location: (5,0)-(5,47)) - │ ├── flags: ∅ - │ ├── keyword_loc: (5,0)-(5,5) = "while" - │ ├── closing_loc: (5,44)-(5,47) = "end" - │ ├── predicate: - │ │ @ ClassNode (location: (5,6)-(5,35)) - │ │ ├── locals: [:a] - │ │ ├── class_keyword_loc: (5,6)-(5,11) = "class" - │ │ ├── constant_path: - │ │ │ @ ConstantReadNode (location: (5,12)-(5,15)) - │ │ │ └── name: :Foo - │ │ ├── inheritance_operator_loc: ∅ - │ │ ├── superclass: ∅ - │ │ ├── body: - │ │ │ @ StatementsNode (location: (5,16)-(5,30)) - │ │ │ └── body: (length: 1) - │ │ │ └── @ LocalVariableWriteNode (location: (5,16)-(5,30)) - │ │ │ ├── name: :a - │ │ │ ├── depth: 0 - │ │ │ ├── name_loc: (5,16)-(5,17) = "a" - │ │ │ ├── value: - │ │ │ │ @ CallNode (location: (5,20)-(5,30)) - │ │ │ │ ├── flags: ignore_visibility - │ │ │ │ ├── receiver: ∅ - │ │ │ │ ├── call_operator_loc: ∅ - │ │ │ │ ├── name: :tap - │ │ │ │ ├── message_loc: (5,20)-(5,23) = "tap" - │ │ │ │ ├── opening_loc: ∅ - │ │ │ │ ├── arguments: ∅ - │ │ │ │ ├── closing_loc: ∅ - │ │ │ │ └── block: - │ │ │ │ @ BlockNode (location: (5,24)-(5,30)) - │ │ │ │ ├── locals: [] - │ │ │ │ ├── parameters: ∅ - │ │ │ │ ├── body: ∅ - │ │ │ │ ├── opening_loc: (5,24)-(5,26) = "do" - │ │ │ │ └── closing_loc: (5,27)-(5,30) = "end" - │ │ │ └── operator_loc: (5,18)-(5,19) = "=" - │ │ ├── end_keyword_loc: (5,32)-(5,35) = "end" - │ │ └── name: :Foo - │ └── statements: - │ @ StatementsNode (location: (5,37)-(5,42)) - │ └── body: (length: 1) - │ └── @ BreakNode (location: (5,37)-(5,42)) - │ ├── arguments: ∅ - │ └── keyword_loc: (5,37)-(5,42) = "break" - └── @ WhileNode (location: (7,0)-(7,44)) - ├── flags: ∅ - ├── keyword_loc: (7,0)-(7,5) = "while" - ├── closing_loc: (7,41)-(7,44) = "end" - ├── predicate: - │ @ ClassNode (location: (7,6)-(7,32)) - │ ├── locals: [] - │ ├── class_keyword_loc: (7,6)-(7,11) = "class" - │ ├── constant_path: - │ │ @ ConstantReadNode (location: (7,12)-(7,15)) - │ │ └── name: :Foo - │ ├── inheritance_operator_loc: ∅ - │ ├── superclass: ∅ - │ ├── body: - │ │ @ StatementsNode (location: (7,17)-(7,27)) - │ │ └── body: (length: 1) - │ │ └── @ CallNode (location: (7,17)-(7,27)) - │ │ ├── flags: ignore_visibility - │ │ ├── receiver: ∅ - │ │ ├── call_operator_loc: ∅ - │ │ ├── name: :tap - │ │ ├── message_loc: (7,17)-(7,20) = "tap" - │ │ ├── opening_loc: ∅ - │ │ ├── arguments: ∅ - │ │ ├── closing_loc: ∅ - │ │ └── block: - │ │ @ BlockNode (location: (7,21)-(7,27)) - │ │ ├── locals: [] - │ │ ├── parameters: ∅ - │ │ ├── body: ∅ - │ │ ├── opening_loc: (7,21)-(7,23) = "do" - │ │ └── closing_loc: (7,24)-(7,27) = "end" - │ ├── end_keyword_loc: (7,29)-(7,32) = "end" - │ └── name: :Foo - └── statements: - @ StatementsNode (location: (7,34)-(7,39)) - └── body: (length: 1) - └── @ BreakNode (location: (7,34)-(7,39)) - ├── arguments: ∅ - └── keyword_loc: (7,34)-(7,39) = "break" diff --git a/test/prism/snapshots/whitequark/if_while_after_class__since_32.txt b/test/prism/snapshots/whitequark/if_while_after_class__since_32.txt deleted file mode 100644 index 0a2982ed35..0000000000 --- a/test/prism/snapshots/whitequark/if_while_after_class__since_32.txt +++ /dev/null @@ -1,119 +0,0 @@ -@ ProgramNode (location: (1,0)-(7,48)) -├── locals: [] -└── statements: - @ StatementsNode (location: (1,0)-(7,48)) - └── body: (length: 4) - ├── @ ClassNode (location: (1,0)-(1,38)) - │ ├── locals: [] - │ ├── class_keyword_loc: (1,0)-(1,5) = "class" - │ ├── constant_path: - │ │ @ ConstantPathNode (location: (1,6)-(1,33)) - │ │ ├── parent: - │ │ │ @ IfNode (location: (1,6)-(1,25)) - │ │ │ ├── if_keyword_loc: (1,6)-(1,8) = "if" - │ │ │ ├── predicate: - │ │ │ │ @ TrueNode (location: (1,9)-(1,13)) - │ │ │ ├── then_keyword_loc: ∅ - │ │ │ ├── statements: - │ │ │ │ @ StatementsNode (location: (1,15)-(1,21)) - │ │ │ │ └── body: (length: 1) - │ │ │ │ └── @ ConstantReadNode (location: (1,15)-(1,21)) - │ │ │ │ └── name: :Object - │ │ │ ├── consequent: ∅ - │ │ │ └── end_keyword_loc: (1,22)-(1,25) = "end" - │ │ ├── child: - │ │ │ @ ConstantReadNode (location: (1,27)-(1,33)) - │ │ │ └── name: :Kernel - │ │ └── delimiter_loc: (1,25)-(1,27) = "::" - │ ├── inheritance_operator_loc: ∅ - │ ├── superclass: ∅ - │ ├── body: ∅ - │ ├── end_keyword_loc: (1,35)-(1,38) = "end" - │ └── name: :Kernel - ├── @ ClassNode (location: (3,0)-(3,47)) - │ ├── locals: [] - │ ├── class_keyword_loc: (3,0)-(3,5) = "class" - │ ├── constant_path: - │ │ @ ConstantPathNode (location: (3,6)-(3,42)) - │ │ ├── parent: - │ │ │ @ WhileNode (location: (3,6)-(3,34)) - │ │ │ ├── flags: ∅ - │ │ │ ├── keyword_loc: (3,6)-(3,11) = "while" - │ │ │ ├── closing_loc: (3,31)-(3,34) = "end" - │ │ │ ├── predicate: - │ │ │ │ @ TrueNode (location: (3,12)-(3,16)) - │ │ │ └── statements: - │ │ │ @ StatementsNode (location: (3,18)-(3,30)) - │ │ │ └── body: (length: 1) - │ │ │ └── @ BreakNode (location: (3,18)-(3,30)) - │ │ │ ├── arguments: - │ │ │ │ @ ArgumentsNode (location: (3,24)-(3,30)) - │ │ │ │ ├── flags: ∅ - │ │ │ │ └── arguments: (length: 1) - │ │ │ │ └── @ ConstantReadNode (location: (3,24)-(3,30)) - │ │ │ │ └── name: :Object - │ │ │ └── keyword_loc: (3,18)-(3,23) = "break" - │ │ ├── child: - │ │ │ @ ConstantReadNode (location: (3,36)-(3,42)) - │ │ │ └── name: :Kernel - │ │ └── delimiter_loc: (3,34)-(3,36) = "::" - │ ├── inheritance_operator_loc: ∅ - │ ├── superclass: ∅ - │ ├── body: ∅ - │ ├── end_keyword_loc: (3,44)-(3,47) = "end" - │ └── name: :Kernel - ├── @ ModuleNode (location: (5,0)-(5,39)) - │ ├── locals: [] - │ ├── module_keyword_loc: (5,0)-(5,6) = "module" - │ ├── constant_path: - │ │ @ ConstantPathNode (location: (5,7)-(5,34)) - │ │ ├── parent: - │ │ │ @ IfNode (location: (5,7)-(5,26)) - │ │ │ ├── if_keyword_loc: (5,7)-(5,9) = "if" - │ │ │ ├── predicate: - │ │ │ │ @ TrueNode (location: (5,10)-(5,14)) - │ │ │ ├── then_keyword_loc: ∅ - │ │ │ ├── statements: - │ │ │ │ @ StatementsNode (location: (5,16)-(5,22)) - │ │ │ │ └── body: (length: 1) - │ │ │ │ └── @ ConstantReadNode (location: (5,16)-(5,22)) - │ │ │ │ └── name: :Object - │ │ │ ├── consequent: ∅ - │ │ │ └── end_keyword_loc: (5,23)-(5,26) = "end" - │ │ ├── child: - │ │ │ @ ConstantReadNode (location: (5,28)-(5,34)) - │ │ │ └── name: :Kernel - │ │ └── delimiter_loc: (5,26)-(5,28) = "::" - │ ├── body: ∅ - │ ├── end_keyword_loc: (5,36)-(5,39) = "end" - │ └── name: :Kernel - └── @ ModuleNode (location: (7,0)-(7,48)) - ├── locals: [] - ├── module_keyword_loc: (7,0)-(7,6) = "module" - ├── constant_path: - │ @ ConstantPathNode (location: (7,7)-(7,43)) - │ ├── parent: - │ │ @ WhileNode (location: (7,7)-(7,35)) - │ │ ├── flags: ∅ - │ │ ├── keyword_loc: (7,7)-(7,12) = "while" - │ │ ├── closing_loc: (7,32)-(7,35) = "end" - │ │ ├── predicate: - │ │ │ @ TrueNode (location: (7,13)-(7,17)) - │ │ └── statements: - │ │ @ StatementsNode (location: (7,19)-(7,31)) - │ │ └── body: (length: 1) - │ │ └── @ BreakNode (location: (7,19)-(7,31)) - │ │ ├── arguments: - │ │ │ @ ArgumentsNode (location: (7,25)-(7,31)) - │ │ │ ├── flags: ∅ - │ │ │ └── arguments: (length: 1) - │ │ │ └── @ ConstantReadNode (location: (7,25)-(7,31)) - │ │ │ └── name: :Object - │ │ └── keyword_loc: (7,19)-(7,24) = "break" - │ ├── child: - │ │ @ ConstantReadNode (location: (7,37)-(7,43)) - │ │ └── name: :Kernel - │ └── delimiter_loc: (7,35)-(7,37) = "::" - ├── body: ∅ - ├── end_keyword_loc: (7,45)-(7,48) = "end" - └── name: :Kernel diff --git a/test/prism/snapshots/whitequark/method_definition_in_while_cond.txt b/test/prism/snapshots/whitequark/method_definition_in_while_cond.txt deleted file mode 100644 index 963686b73e..0000000000 --- a/test/prism/snapshots/whitequark/method_definition_in_while_cond.txt +++ /dev/null @@ -1,199 +0,0 @@ -@ ProgramNode (location: (1,0)-(7,47)) -├── locals: [] -└── statements: - @ StatementsNode (location: (1,0)-(7,47)) - └── body: (length: 4) - ├── @ WhileNode (location: (1,0)-(1,45)) - │ ├── flags: ∅ - │ ├── keyword_loc: (1,0)-(1,5) = "while" - │ ├── closing_loc: (1,42)-(1,45) = "end" - │ ├── predicate: - │ │ @ DefNode (location: (1,6)-(1,33)) - │ │ ├── name: :foo - │ │ ├── name_loc: (1,10)-(1,13) = "foo" - │ │ ├── receiver: ∅ - │ │ ├── parameters: - │ │ │ @ ParametersNode (location: (1,14)-(1,28)) - │ │ │ ├── requireds: (length: 0) - │ │ │ ├── optionals: (length: 1) - │ │ │ │ └── @ OptionalParameterNode (location: (1,14)-(1,28)) - │ │ │ │ ├── flags: ∅ - │ │ │ │ ├── name: :a - │ │ │ │ ├── name_loc: (1,14)-(1,15) = "a" - │ │ │ │ ├── operator_loc: (1,16)-(1,17) = "=" - │ │ │ │ └── value: - │ │ │ │ @ CallNode (location: (1,18)-(1,28)) - │ │ │ │ ├── flags: ignore_visibility - │ │ │ │ ├── receiver: ∅ - │ │ │ │ ├── call_operator_loc: ∅ - │ │ │ │ ├── name: :tap - │ │ │ │ ├── message_loc: (1,18)-(1,21) = "tap" - │ │ │ │ ├── opening_loc: ∅ - │ │ │ │ ├── arguments: ∅ - │ │ │ │ ├── closing_loc: ∅ - │ │ │ │ └── block: - │ │ │ │ @ BlockNode (location: (1,22)-(1,28)) - │ │ │ │ ├── locals: [] - │ │ │ │ ├── parameters: ∅ - │ │ │ │ ├── body: ∅ - │ │ │ │ ├── opening_loc: (1,22)-(1,24) = "do" - │ │ │ │ └── closing_loc: (1,25)-(1,28) = "end" - │ │ │ ├── rest: ∅ - │ │ │ ├── posts: (length: 0) - │ │ │ ├── keywords: (length: 0) - │ │ │ ├── keyword_rest: ∅ - │ │ │ └── block: ∅ - │ │ ├── body: ∅ - │ │ ├── locals: [:a] - │ │ ├── def_keyword_loc: (1,6)-(1,9) = "def" - │ │ ├── operator_loc: ∅ - │ │ ├── lparen_loc: ∅ - │ │ ├── rparen_loc: ∅ - │ │ ├── equal_loc: ∅ - │ │ └── end_keyword_loc: (1,30)-(1,33) = "end" - │ └── statements: - │ @ StatementsNode (location: (1,35)-(1,40)) - │ └── body: (length: 1) - │ └── @ BreakNode (location: (1,35)-(1,40)) - │ ├── arguments: ∅ - │ └── keyword_loc: (1,35)-(1,40) = "break" - ├── @ WhileNode (location: (3,0)-(3,42)) - │ ├── flags: ∅ - │ ├── keyword_loc: (3,0)-(3,5) = "while" - │ ├── closing_loc: (3,39)-(3,42) = "end" - │ ├── predicate: - │ │ @ DefNode (location: (3,6)-(3,30)) - │ │ ├── name: :foo - │ │ ├── name_loc: (3,10)-(3,13) = "foo" - │ │ ├── receiver: ∅ - │ │ ├── parameters: ∅ - │ │ ├── body: - │ │ │ @ StatementsNode (location: (3,15)-(3,25)) - │ │ │ └── body: (length: 1) - │ │ │ └── @ CallNode (location: (3,15)-(3,25)) - │ │ │ ├── flags: ignore_visibility - │ │ │ ├── receiver: ∅ - │ │ │ ├── call_operator_loc: ∅ - │ │ │ ├── name: :tap - │ │ │ ├── message_loc: (3,15)-(3,18) = "tap" - │ │ │ ├── opening_loc: ∅ - │ │ │ ├── arguments: ∅ - │ │ │ ├── closing_loc: ∅ - │ │ │ └── block: - │ │ │ @ BlockNode (location: (3,19)-(3,25)) - │ │ │ ├── locals: [] - │ │ │ ├── parameters: ∅ - │ │ │ ├── body: ∅ - │ │ │ ├── opening_loc: (3,19)-(3,21) = "do" - │ │ │ └── closing_loc: (3,22)-(3,25) = "end" - │ │ ├── locals: [] - │ │ ├── def_keyword_loc: (3,6)-(3,9) = "def" - │ │ ├── operator_loc: ∅ - │ │ ├── lparen_loc: ∅ - │ │ ├── rparen_loc: ∅ - │ │ ├── equal_loc: ∅ - │ │ └── end_keyword_loc: (3,27)-(3,30) = "end" - │ └── statements: - │ @ StatementsNode (location: (3,32)-(3,37)) - │ └── body: (length: 1) - │ └── @ BreakNode (location: (3,32)-(3,37)) - │ ├── arguments: ∅ - │ └── keyword_loc: (3,32)-(3,37) = "break" - ├── @ WhileNode (location: (5,0)-(5,50)) - │ ├── flags: ∅ - │ ├── keyword_loc: (5,0)-(5,5) = "while" - │ ├── closing_loc: (5,47)-(5,50) = "end" - │ ├── predicate: - │ │ @ DefNode (location: (5,6)-(5,38)) - │ │ ├── name: :foo - │ │ ├── name_loc: (5,15)-(5,18) = "foo" - │ │ ├── receiver: - │ │ │ @ SelfNode (location: (5,10)-(5,14)) - │ │ ├── parameters: - │ │ │ @ ParametersNode (location: (5,19)-(5,33)) - │ │ │ ├── requireds: (length: 0) - │ │ │ ├── optionals: (length: 1) - │ │ │ │ └── @ OptionalParameterNode (location: (5,19)-(5,33)) - │ │ │ │ ├── flags: ∅ - │ │ │ │ ├── name: :a - │ │ │ │ ├── name_loc: (5,19)-(5,20) = "a" - │ │ │ │ ├── operator_loc: (5,21)-(5,22) = "=" - │ │ │ │ └── value: - │ │ │ │ @ CallNode (location: (5,23)-(5,33)) - │ │ │ │ ├── flags: ignore_visibility - │ │ │ │ ├── receiver: ∅ - │ │ │ │ ├── call_operator_loc: ∅ - │ │ │ │ ├── name: :tap - │ │ │ │ ├── message_loc: (5,23)-(5,26) = "tap" - │ │ │ │ ├── opening_loc: ∅ - │ │ │ │ ├── arguments: ∅ - │ │ │ │ ├── closing_loc: ∅ - │ │ │ │ └── block: - │ │ │ │ @ BlockNode (location: (5,27)-(5,33)) - │ │ │ │ ├── locals: [] - │ │ │ │ ├── parameters: ∅ - │ │ │ │ ├── body: ∅ - │ │ │ │ ├── opening_loc: (5,27)-(5,29) = "do" - │ │ │ │ └── closing_loc: (5,30)-(5,33) = "end" - │ │ │ ├── rest: ∅ - │ │ │ ├── posts: (length: 0) - │ │ │ ├── keywords: (length: 0) - │ │ │ ├── keyword_rest: ∅ - │ │ │ └── block: ∅ - │ │ ├── body: ∅ - │ │ ├── locals: [:a] - │ │ ├── def_keyword_loc: (5,6)-(5,9) = "def" - │ │ ├── operator_loc: (5,14)-(5,15) = "." - │ │ ├── lparen_loc: ∅ - │ │ ├── rparen_loc: ∅ - │ │ ├── equal_loc: ∅ - │ │ └── end_keyword_loc: (5,35)-(5,38) = "end" - │ └── statements: - │ @ StatementsNode (location: (5,40)-(5,45)) - │ └── body: (length: 1) - │ └── @ BreakNode (location: (5,40)-(5,45)) - │ ├── arguments: ∅ - │ └── keyword_loc: (5,40)-(5,45) = "break" - └── @ WhileNode (location: (7,0)-(7,47)) - ├── flags: ∅ - ├── keyword_loc: (7,0)-(7,5) = "while" - ├── closing_loc: (7,44)-(7,47) = "end" - ├── predicate: - │ @ DefNode (location: (7,6)-(7,35)) - │ ├── name: :foo - │ ├── name_loc: (7,15)-(7,18) = "foo" - │ ├── receiver: - │ │ @ SelfNode (location: (7,10)-(7,14)) - │ ├── parameters: ∅ - │ ├── body: - │ │ @ StatementsNode (location: (7,20)-(7,30)) - │ │ └── body: (length: 1) - │ │ └── @ CallNode (location: (7,20)-(7,30)) - │ │ ├── flags: ignore_visibility - │ │ ├── receiver: ∅ - │ │ ├── call_operator_loc: ∅ - │ │ ├── name: :tap - │ │ ├── message_loc: (7,20)-(7,23) = "tap" - │ │ ├── opening_loc: ∅ - │ │ ├── arguments: ∅ - │ │ ├── closing_loc: ∅ - │ │ └── block: - │ │ @ BlockNode (location: (7,24)-(7,30)) - │ │ ├── locals: [] - │ │ ├── parameters: ∅ - │ │ ├── body: ∅ - │ │ ├── opening_loc: (7,24)-(7,26) = "do" - │ │ └── closing_loc: (7,27)-(7,30) = "end" - │ ├── locals: [] - │ ├── def_keyword_loc: (7,6)-(7,9) = "def" - │ ├── operator_loc: (7,14)-(7,15) = "." - │ ├── lparen_loc: ∅ - │ ├── rparen_loc: ∅ - │ ├── equal_loc: ∅ - │ └── end_keyword_loc: (7,32)-(7,35) = "end" - └── statements: - @ StatementsNode (location: (7,37)-(7,42)) - └── body: (length: 1) - └── @ BreakNode (location: (7,37)-(7,42)) - ├── arguments: ∅ - └── keyword_loc: (7,37)-(7,42) = "break" diff --git a/test/prism/snapshots/whitequark/next.txt b/test/prism/snapshots/whitequark/next.txt deleted file mode 100644 index b58c2de4fb..0000000000 --- a/test/prism/snapshots/whitequark/next.txt +++ /dev/null @@ -1,56 +0,0 @@ -@ ProgramNode (location: (1,0)-(7,9)) -├── locals: [] -└── statements: - @ StatementsNode (location: (1,0)-(7,9)) - └── body: (length: 4) - ├── @ NextNode (location: (1,0)-(1,4)) - │ ├── arguments: ∅ - │ └── keyword_loc: (1,0)-(1,4) = "next" - ├── @ NextNode (location: (3,0)-(3,8)) - │ ├── arguments: - │ │ @ ArgumentsNode (location: (3,5)-(3,8)) - │ │ ├── flags: ∅ - │ │ └── arguments: (length: 1) - │ │ └── @ CallNode (location: (3,5)-(3,8)) - │ │ ├── flags: variable_call, ignore_visibility - │ │ ├── receiver: ∅ - │ │ ├── call_operator_loc: ∅ - │ │ ├── name: :foo - │ │ ├── message_loc: (3,5)-(3,8) = "foo" - │ │ ├── opening_loc: ∅ - │ │ ├── arguments: ∅ - │ │ ├── closing_loc: ∅ - │ │ └── block: ∅ - │ └── keyword_loc: (3,0)-(3,4) = "next" - ├── @ NextNode (location: (5,0)-(5,6)) - │ ├── arguments: - │ │ @ ArgumentsNode (location: (5,4)-(5,6)) - │ │ ├── flags: ∅ - │ │ └── arguments: (length: 1) - │ │ └── @ ParenthesesNode (location: (5,4)-(5,6)) - │ │ ├── body: ∅ - │ │ ├── opening_loc: (5,4)-(5,5) = "(" - │ │ └── closing_loc: (5,5)-(5,6) = ")" - │ └── keyword_loc: (5,0)-(5,4) = "next" - └── @ NextNode (location: (7,0)-(7,9)) - ├── arguments: - │ @ ArgumentsNode (location: (7,4)-(7,9)) - │ ├── flags: ∅ - │ └── arguments: (length: 1) - │ └── @ ParenthesesNode (location: (7,4)-(7,9)) - │ ├── body: - │ │ @ StatementsNode (location: (7,5)-(7,8)) - │ │ └── body: (length: 1) - │ │ └── @ CallNode (location: (7,5)-(7,8)) - │ │ ├── flags: variable_call, ignore_visibility - │ │ ├── receiver: ∅ - │ │ ├── call_operator_loc: ∅ - │ │ ├── name: :foo - │ │ ├── message_loc: (7,5)-(7,8) = "foo" - │ │ ├── opening_loc: ∅ - │ │ ├── arguments: ∅ - │ │ ├── closing_loc: ∅ - │ │ └── block: ∅ - │ ├── opening_loc: (7,4)-(7,5) = "(" - │ └── closing_loc: (7,8)-(7,9) = ")" - └── keyword_loc: (7,0)-(7,4) = "next" diff --git a/test/prism/snapshots/whitequark/next_block.txt b/test/prism/snapshots/whitequark/next_block.txt deleted file mode 100644 index f1d65a44ed..0000000000 --- a/test/prism/snapshots/whitequark/next_block.txt +++ /dev/null @@ -1,40 +0,0 @@ -@ ProgramNode (location: (1,0)-(1,19)) -├── locals: [] -└── statements: - @ StatementsNode (location: (1,0)-(1,19)) - └── body: (length: 1) - └── @ NextNode (location: (1,0)-(1,19)) - ├── arguments: - │ @ ArgumentsNode (location: (1,5)-(1,19)) - │ ├── flags: ∅ - │ └── arguments: (length: 1) - │ └── @ CallNode (location: (1,5)-(1,19)) - │ ├── flags: ignore_visibility - │ ├── receiver: ∅ - │ ├── call_operator_loc: ∅ - │ ├── name: :fun - │ ├── message_loc: (1,5)-(1,8) = "fun" - │ ├── opening_loc: ∅ - │ ├── arguments: - │ │ @ ArgumentsNode (location: (1,9)-(1,12)) - │ │ ├── flags: ∅ - │ │ └── arguments: (length: 1) - │ │ └── @ CallNode (location: (1,9)-(1,12)) - │ │ ├── flags: variable_call, ignore_visibility - │ │ ├── receiver: ∅ - │ │ ├── call_operator_loc: ∅ - │ │ ├── name: :foo - │ │ ├── message_loc: (1,9)-(1,12) = "foo" - │ │ ├── opening_loc: ∅ - │ │ ├── arguments: ∅ - │ │ ├── closing_loc: ∅ - │ │ └── block: ∅ - │ ├── closing_loc: ∅ - │ └── block: - │ @ BlockNode (location: (1,13)-(1,19)) - │ ├── locals: [] - │ ├── parameters: ∅ - │ ├── body: ∅ - │ ├── opening_loc: (1,13)-(1,15) = "do" - │ └── closing_loc: (1,16)-(1,19) = "end" - └── keyword_loc: (1,0)-(1,4) = "next" diff --git a/test/prism/snapshots/whitequark/redo.txt b/test/prism/snapshots/whitequark/redo.txt deleted file mode 100644 index 48d3da9d52..0000000000 --- a/test/prism/snapshots/whitequark/redo.txt +++ /dev/null @@ -1,6 +0,0 @@ -@ ProgramNode (location: (1,0)-(1,4)) -├── locals: [] -└── statements: - @ StatementsNode (location: (1,0)-(1,4)) - └── body: (length: 1) - └── @ RedoNode (location: (1,0)-(1,4)) diff --git a/test/prism/snapshots/whitequark/retry.txt b/test/prism/snapshots/whitequark/retry.txt deleted file mode 100644 index 671c369514..0000000000 --- a/test/prism/snapshots/whitequark/retry.txt +++ /dev/null @@ -1,6 +0,0 @@ -@ ProgramNode (location: (1,0)-(1,5)) -├── locals: [] -└── statements: - @ StatementsNode (location: (1,0)-(1,5)) - └── body: (length: 1) - └── @ RetryNode (location: (1,0)-(1,5)) diff --git a/test/prism/snapshots/yield.txt b/test/prism/snapshots/yield.txt index 896dbac13f..e9680c3b2d 100644 --- a/test/prism/snapshots/yield.txt +++ b/test/prism/snapshots/yield.txt @@ -1,43 +1,103 @@ -@ ProgramNode (location: (1,0)-(7,14)) +@ ProgramNode (location: (1,0)-(7,28)) ├── locals: [] └── statements: - @ StatementsNode (location: (1,0)-(7,14)) + @ StatementsNode (location: (1,0)-(7,28)) └── body: (length: 4) - ├── @ YieldNode (location: (1,0)-(1,5)) - │ ├── keyword_loc: (1,0)-(1,5) = "yield" + ├── @ DefNode (location: (1,0)-(1,19)) + │ ├── name: :foo + │ ├── name_loc: (1,4)-(1,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (1,9)-(1,14)) + │ │ └── body: (length: 1) + │ │ └── @ YieldNode (location: (1,9)-(1,14)) + │ │ ├── keyword_loc: (1,9)-(1,14) = "yield" + │ │ ├── lparen_loc: ∅ + │ │ ├── arguments: ∅ + │ │ └── rparen_loc: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (1,0)-(1,3) = "def" + │ ├── operator_loc: ∅ │ ├── lparen_loc: ∅ - │ ├── arguments: ∅ - │ └── rparen_loc: ∅ - ├── @ YieldNode (location: (3,0)-(3,7)) - │ ├── keyword_loc: (3,0)-(3,5) = "yield" - │ ├── lparen_loc: (3,5)-(3,6) = "(" - │ ├── arguments: ∅ - │ └── rparen_loc: (3,6)-(3,7) = ")" - ├── @ YieldNode (location: (5,0)-(5,8)) - │ ├── keyword_loc: (5,0)-(5,5) = "yield" - │ ├── lparen_loc: (5,5)-(5,6) = "(" - │ ├── arguments: - │ │ @ ArgumentsNode (location: (5,6)-(5,7)) - │ │ ├── flags: ∅ - │ │ └── arguments: (length: 1) - │ │ └── @ IntegerNode (location: (5,6)-(5,7)) - │ │ ├── flags: decimal - │ │ └── value: 1 - │ └── rparen_loc: (5,7)-(5,8) = ")" - └── @ YieldNode (location: (7,0)-(7,14)) - ├── keyword_loc: (7,0)-(7,5) = "yield" - ├── lparen_loc: (7,5)-(7,6) = "(" - ├── arguments: - │ @ ArgumentsNode (location: (7,6)-(7,13)) - │ ├── flags: ∅ - │ └── arguments: (length: 3) - │ ├── @ IntegerNode (location: (7,6)-(7,7)) - │ │ ├── flags: decimal - │ │ └── value: 1 - │ ├── @ IntegerNode (location: (7,9)-(7,10)) - │ │ ├── flags: decimal - │ │ └── value: 2 - │ └── @ IntegerNode (location: (7,12)-(7,13)) - │ ├── flags: decimal - │ └── value: 3 - └── rparen_loc: (7,13)-(7,14) = ")" + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (1,16)-(1,19) = "end" + ├── @ DefNode (location: (3,0)-(3,21)) + │ ├── name: :foo + │ ├── name_loc: (3,4)-(3,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (3,9)-(3,16)) + │ │ └── body: (length: 1) + │ │ └── @ YieldNode (location: (3,9)-(3,16)) + │ │ ├── keyword_loc: (3,9)-(3,14) = "yield" + │ │ ├── lparen_loc: (3,14)-(3,15) = "(" + │ │ ├── arguments: ∅ + │ │ └── rparen_loc: (3,15)-(3,16) = ")" + │ ├── locals: [] + │ ├── def_keyword_loc: (3,0)-(3,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (3,18)-(3,21) = "end" + ├── @ DefNode (location: (5,0)-(5,22)) + │ ├── name: :foo + │ ├── name_loc: (5,4)-(5,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (5,9)-(5,17)) + │ │ └── body: (length: 1) + │ │ └── @ YieldNode (location: (5,9)-(5,17)) + │ │ ├── keyword_loc: (5,9)-(5,14) = "yield" + │ │ ├── lparen_loc: (5,14)-(5,15) = "(" + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (5,15)-(5,16)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (5,15)-(5,16)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ └── rparen_loc: (5,16)-(5,17) = ")" + │ ├── locals: [] + │ ├── def_keyword_loc: (5,0)-(5,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (5,19)-(5,22) = "end" + └── @ DefNode (location: (7,0)-(7,28)) + ├── name: :foo + ├── name_loc: (7,4)-(7,7) = "foo" + ├── receiver: ∅ + ├── parameters: ∅ + ├── body: + │ @ StatementsNode (location: (7,9)-(7,23)) + │ └── body: (length: 1) + │ └── @ YieldNode (location: (7,9)-(7,23)) + │ ├── keyword_loc: (7,9)-(7,14) = "yield" + │ ├── lparen_loc: (7,14)-(7,15) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (7,15)-(7,22)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 3) + │ │ ├── @ IntegerNode (location: (7,15)-(7,16)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 1 + │ │ ├── @ IntegerNode (location: (7,18)-(7,19)) + │ │ │ ├── flags: decimal + │ │ │ └── value: 2 + │ │ └── @ IntegerNode (location: (7,21)-(7,22)) + │ │ ├── flags: decimal + │ │ └── value: 3 + │ └── rparen_loc: (7,22)-(7,23) = ")" + ├── locals: [] + ├── def_keyword_loc: (7,0)-(7,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── equal_loc: ∅ + └── end_keyword_loc: (7,25)-(7,28) = "end" |
