diff options
author | Earlopain <[email protected]> | 2025-01-15 23:24:05 +0100 |
---|---|---|
committer | Kevin Newton <[email protected]> | 2025-03-18 13:36:53 -0400 |
commit | a8adf5e006da03b8ccaa2bf900f4f077ca9888cf (patch) | |
tree | e7e6994efa7806d708033ef13fbe81dcd5c36c37 | |
parent | fc14d3ac7d4fa14f568d2428b846f391ebdf0d62 (diff) |
[ruby/prism] Further refine string handling in the parser translator
Mostly around newlines and line continuation.
* percent arrays need special backslash handling in the ast
* Fix offset issue for heredocs with many line continuations (used wrong variable as index access)
* More refined rules on when to simplify string tokens
* Handle line continuations in squiggly heredocs
* Correctly dedent squiggly heredocs with interpolation
* Consider `':foo:` and `%s[foo]` to not be interpolation
https://github.com/ruby/prism/commit/4edfe9d981
-rw-r--r-- | lib/prism/translation/parser/compiler.rb | 13 | ||||
-rw-r--r-- | lib/prism/translation/parser/lexer.rb | 29 | ||||
-rw-r--r-- | test/prism/fixtures/strings.txt | 6 | ||||
-rw-r--r-- | test/prism/ruby/parser_test.rb | 5 | ||||
-rw-r--r-- | test/prism/snapshots/heredocs_with_fake_newlines.txt | 223 | ||||
-rw-r--r-- | test/prism/snapshots/strings.txt | 800 |
6 files changed, 1076 insertions, 0 deletions
diff --git a/lib/prism/translation/parser/compiler.rb b/lib/prism/translation/parser/compiler.rb index 8f6a602c42..6a169600b5 100644 --- a/lib/prism/translation/parser/compiler.rb +++ b/lib/prism/translation/parser/compiler.rb @@ -1120,6 +1120,7 @@ module Prism <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= parts = if node.parts.one? { |part| part.type == :string_node } node.parts.flat_map do |node| @@ -1153,6 +1154,8 @@ module Prism >>>>>>> a651126458 (Fix an incompatibility with the parser translator) ======= >>>>>>> 4edfe9d981 (Further refine string handling in the parser translator) +======= +>>>>>>> 4edfe9d981 (Further refine string handling in the parser translator) builder.string_compose( token(node.opening_loc), string_nodes_from_interpolation(node, node.opening), @@ -2218,12 +2221,16 @@ module Prism escaped = escaped.lines <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD percent_array = opening&.start_with?("%w", "%W", "%i", "%I") ======= >>>>>>> 2637007929 (Better handle all kinds of multiline strings in the parser translator) ======= percent_array = opening&.start_with?("%w", "%W", "%i", "%I") >>>>>>> 4edfe9d981 (Further refine string handling in the parser translator) +======= + percent_array = opening&.start_with?("%w", "%W", "%i", "%I") +>>>>>>> 4edfe9d981 (Further refine string handling in the parser translator) # Non-interpolating strings if opening&.end_with?("'") || opening&.start_with?("%q", "%s", "%w", "%i") @@ -2232,6 +2239,9 @@ module Prism <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD +======= +>>>>>>> 4edfe9d981 (Further refine string handling in the parser translator) ======= >>>>>>> 4edfe9d981 (Further refine string handling in the parser translator) escaped.filter_map.with_index do |escaped_line, index| @@ -2249,6 +2259,7 @@ module Prism current_length = 0 s <<<<<<< HEAD +<<<<<<< HEAD ======= if opening&.end_with?("'") escaped.each do |line| @@ -2258,6 +2269,8 @@ module Prism >>>>>>> 2637007929 (Better handle all kinds of multiline strings in the parser translator) ======= >>>>>>> 4edfe9d981 (Further refine string handling in the parser translator) +======= +>>>>>>> 4edfe9d981 (Further refine string handling in the parser translator) end else escaped_lengths = [] diff --git a/lib/prism/translation/parser/lexer.rb b/lib/prism/translation/parser/lexer.rb index 98fd7aaa02..39eb9943d7 100644 --- a/lib/prism/translation/parser/lexer.rb +++ b/lib/prism/translation/parser/lexer.rb @@ -440,6 +440,7 @@ module Prism if (lines = token.value.lines).one? <<<<<<< HEAD +<<<<<<< HEAD # Heredoc interpolation can have multiple STRING_CONTENT nodes on the same line. is_first_token_on_line = lexed[index - 1] && token.location.start_line != lexed[index - 2][0].location&.start_line # The parser gem only removes indentation when the heredoc is not nested @@ -489,6 +490,25 @@ module Prism end >>>>>>> 4edfe9d981 (Further refine string handling in the parser translator) +======= + # Prism usually emits a single token for strings with line continuations. + # For squiggly heredocs they are not joined so we do that manually here. + current_string = +"" + current_length = 0 + start_offset = token.location.start_offset + while token.type == :STRING_CONTENT + current_length += token.value.bytesize + # Heredoc interpolation can have multiple STRING_CONTENT nodes on the same line. + is_first_token_on_line = lexed[index - 1] && token.location.start_line != lexed[index - 2][0].location&.start_line + # The parser gem only removes indentation when the heredoc is not nested + not_nested = heredoc_stack.size == 1 + if is_percent_array + value = percent_array_unescape(token.value) + elsif is_first_token_on_line && not_nested && (current_heredoc = heredoc_stack.last).common_whitespace > 0 + value = trim_heredoc_whitespace(token.value, current_heredoc) + end + +>>>>>>> 4edfe9d981 (Further refine string handling in the parser translator) current_string << unescape_string(value, quote_stack.last) if (backslash_count = token.value[/(\\{1,})\n/, 1]&.length).nil? || backslash_count.even? || !interpolation?(quote_stack.last) tokens << [:tSTRING_CONTENT, [current_string, range(start_offset, start_offset + current_length)]] @@ -817,6 +837,9 @@ module Prism <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD +======= +>>>>>>> 4edfe9d981 (Further refine string handling in the parser translator) ======= >>>>>>> 4edfe9d981 (Further refine string handling in the parser translator) # Certain strings are merged into a single string token. @@ -838,6 +861,7 @@ module Prism <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> 09c59a3aa5 (Handle control and meta escapes in parser translation) # Escape a byte value, given the control and meta flags. @@ -903,6 +927,8 @@ module Prism >>>>>>> 4edfe9d981 (Further refine string handling in the parser translator) ======= >>>>>>> 09c59a3aa5 (Handle control and meta escapes in parser translation) +======= +>>>>>>> 4edfe9d981 (Further refine string handling in the parser translator) # In a percent array, certain whitespace can be preceeded with a backslash, # causing the following characters to be part of the previous element. def percent_array_unescape(string) @@ -928,6 +954,7 @@ module Prism def interpolation?(quote) !quote.end_with?("'") && !quote.start_with?("%q", "%w", "%i", "%s") <<<<<<< HEAD +<<<<<<< HEAD end # Regexp allow interpolation but are handled differently during unescaping @@ -935,6 +962,8 @@ module Prism quote == "/" || quote.start_with?("%r") ======= >>>>>>> 4edfe9d981 (Further refine string handling in the parser translator) +======= +>>>>>>> 4edfe9d981 (Further refine string handling in the parser translator) end # Regexp allow interpolation but are handled differently during unescaping diff --git a/test/prism/fixtures/strings.txt b/test/prism/fixtures/strings.txt index a7986808ba..1e8d10231d 100644 --- a/test/prism/fixtures/strings.txt +++ b/test/prism/fixtures/strings.txt @@ -87,6 +87,9 @@ a\nb\n\nc\n" <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD +======= +>>>>>>> 4edfe9d981 (Further refine string handling in the parser translator) ======= >>>>>>> 4edfe9d981 (Further refine string handling in the parser translator) %W[#{foo}\ @@ -105,10 +108,13 @@ baz #{bat} bar) <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> bd3dd2b62a (Fix parser translator tokens for %-arrays with whitespace escapes) ======= >>>>>>> 4edfe9d981 (Further refine string handling in the parser translator) +======= +>>>>>>> 4edfe9d981 (Further refine string handling in the parser translator) %w[foo bar] %w[ diff --git a/test/prism/ruby/parser_test.rb b/test/prism/ruby/parser_test.rb index e7cd06bf32..6b72beddc4 100644 --- a/test/prism/ruby/parser_test.rb +++ b/test/prism/ruby/parser_test.rb @@ -92,6 +92,11 @@ module Prism # These files are either failing to parse or failing to translate, so we'll # skip them for now. skip_all = skip_incorrect | [ +<<<<<<< HEAD +======= + "unescaping.txt", + "seattlerb/regexp_esc_C_slash.txt", +>>>>>>> 4edfe9d981 (Further refine string handling in the parser translator) ] # Not sure why these files are failing on JRuby, but skipping them for now. diff --git a/test/prism/snapshots/heredocs_with_fake_newlines.txt b/test/prism/snapshots/heredocs_with_fake_newlines.txt new file mode 100644 index 0000000000..df59b29b94 --- /dev/null +++ b/test/prism/snapshots/heredocs_with_fake_newlines.txt @@ -0,0 +1,223 @@ +@ ProgramNode (location: (1,0)-(43,8)) +├── flags: ∅ +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(43,8)) + ├── flags: ∅ + └── body: (length: 4) + ├── @ StringNode (location: (1,0)-(1,7)) + │ ├── flags: newline + │ ├── opening_loc: (1,0)-(1,7) = "<<-RUBY" + │ ├── content_loc: (2,0)-(13,0) = " \\n\n \\n\n exit\n \\\\n\n \\n\\n\\n\\n\n argh\n \\\\\n \\\\\\\n foo\\nbar\n \\f\n ok\n" + │ ├── closing_loc: (13,0)-(14,0) = "RUBY\n" + │ └── unescaped: " \n\n \n\n exit\n \\n\n \n\n\n\n\n argh\n \\\n \\ foo\nbar\n \f\n ok\n" + ├── @ InterpolatedStringNode (location: (15,0)-(15,7)) + │ ├── flags: newline, static_literal + │ ├── opening_loc: (15,0)-(15,7) = "<<~RUBY" + │ ├── parts: (length: 11) + │ │ ├── @ StringNode (location: (16,0)-(17,0)) + │ │ │ ├── flags: static_literal, frozen + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (16,0)-(17,0) = " \\n\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "\n\n" + │ │ ├── @ StringNode (location: (17,0)-(18,0)) + │ │ │ ├── flags: static_literal, frozen + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (17,0)-(18,0) = " \\n\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "\n\n" + │ │ ├── @ StringNode (location: (18,0)-(19,0)) + │ │ │ ├── flags: static_literal, frozen + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (18,0)-(19,0) = " exit\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "exit\n" + │ │ ├── @ StringNode (location: (19,0)-(20,0)) + │ │ │ ├── flags: static_literal, frozen + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (19,0)-(20,0) = " \\\\n\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "\\n\n" + │ │ ├── @ StringNode (location: (20,0)-(21,0)) + │ │ │ ├── flags: static_literal, frozen + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (20,0)-(21,0) = " \\n\\n\\n\\n\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "\n\n\n\n\n" + │ │ ├── @ StringNode (location: (21,0)-(22,0)) + │ │ │ ├── flags: static_literal, frozen + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (21,0)-(22,0) = " argh\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "argh\n" + │ │ ├── @ StringNode (location: (22,0)-(23,0)) + │ │ │ ├── flags: static_literal, frozen + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (22,0)-(23,0) = " \\\\\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "\\\n" + │ │ ├── @ StringNode (location: (23,0)-(24,0)) + │ │ │ ├── flags: static_literal, frozen + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (23,0)-(24,0) = " \\\\\\\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "\\" + │ │ ├── @ StringNode (location: (24,0)-(25,0)) + │ │ │ ├── flags: static_literal, frozen + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (24,0)-(25,0) = " foo\\nbar\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "foo\nbar\n" + │ │ ├── @ StringNode (location: (25,0)-(26,0)) + │ │ │ ├── flags: static_literal, frozen + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (25,0)-(26,0) = " \\f\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "\f\n" + │ │ └── @ StringNode (location: (26,0)-(27,0)) + │ │ ├── flags: static_literal, frozen + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (26,0)-(27,0) = " ok\n" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "ok\n" + │ └── closing_loc: (27,0)-(28,0) = "RUBY\n" + ├── @ InterpolatedStringNode (location: (29,0)-(29,7)) + │ ├── flags: newline + │ ├── opening_loc: (29,0)-(29,7) = "<<~RUBY" + │ ├── parts: (length: 18) + │ │ ├── @ EmbeddedStatementsNode (location: (30,2)-(30,8)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (30,2)-(30,4) = "\#{" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (30,4)-(30,7)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (30,4)-(30,7)) + │ │ │ │ ├── flags: static_literal, decimal + │ │ │ │ └── value: 123 + │ │ │ └── closing_loc: (30,7)-(30,8) = "}" + │ │ ├── @ StringNode (location: (30,8)-(31,0)) + │ │ │ ├── flags: static_literal, frozen + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (30,8)-(31,0) = "\\n\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "\n\n" + │ │ ├── @ StringNode (location: (31,0)-(32,0)) + │ │ │ ├── flags: static_literal, frozen + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (31,0)-(32,0) = " \\n\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "\n\n" + │ │ ├── @ StringNode (location: (32,0)-(33,0)) + │ │ │ ├── flags: static_literal, frozen + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (32,0)-(33,0) = " exit\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "exit\n" + │ │ ├── @ StringNode (location: (33,0)-(33,4)) + │ │ │ ├── flags: static_literal, frozen + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (33,0)-(33,4) = " \\\\" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "\\" + │ │ ├── @ EmbeddedStatementsNode (location: (33,4)-(33,10)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (33,4)-(33,6) = "\#{" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (33,6)-(33,9)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (33,6)-(33,9)) + │ │ │ │ ├── flags: static_literal, decimal + │ │ │ │ └── value: 123 + │ │ │ └── closing_loc: (33,9)-(33,10) = "}" + │ │ ├── @ StringNode (location: (33,10)-(34,0)) + │ │ │ ├── flags: static_literal, frozen + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (33,10)-(34,0) = "n\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "n\n" + │ │ ├── @ StringNode (location: (34,0)-(34,4)) + │ │ │ ├── flags: static_literal, frozen + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (34,0)-(34,4) = " \\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "\n" + │ │ ├── @ EmbeddedStatementsNode (location: (34,4)-(34,10)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (34,4)-(34,6) = "\#{" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (34,6)-(34,9)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (34,6)-(34,9)) + │ │ │ │ ├── flags: static_literal, decimal + │ │ │ │ └── value: 123 + │ │ │ └── closing_loc: (34,9)-(34,10) = "}" + │ │ ├── @ StringNode (location: (34,10)-(35,0)) + │ │ │ ├── flags: static_literal, frozen + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (34,10)-(35,0) = "\\n\\n\\n\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "\n\n\n\n" + │ │ ├── @ StringNode (location: (35,0)-(36,0)) + │ │ │ ├── flags: static_literal, frozen + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (35,0)-(36,0) = " argh\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "argh\n" + │ │ ├── @ StringNode (location: (36,0)-(36,4)) + │ │ │ ├── flags: static_literal, frozen + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (36,0)-(36,4) = " \\\\" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "\\" + │ │ ├── @ EmbeddedStatementsNode (location: (36,4)-(36,10)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (36,4)-(36,6) = "\#{" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (36,6)-(36,9)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (36,6)-(36,9)) + │ │ │ │ ├── flags: static_literal, decimal + │ │ │ │ └── value: 123 + │ │ │ └── closing_loc: (36,9)-(36,10) = "}" + │ │ ├── @ StringNode (location: (36,10)-(37,0)) + │ │ │ ├── flags: static_literal, frozen + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (36,10)-(37,0) = "baz\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "baz\n" + │ │ ├── @ StringNode (location: (37,0)-(38,0)) + │ │ │ ├── flags: static_literal, frozen + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (37,0)-(38,0) = " \\\\\\\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "\\" + │ │ ├── @ StringNode (location: (38,0)-(39,0)) + │ │ │ ├── flags: static_literal, frozen + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (38,0)-(39,0) = " foo\\nbar\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "foo\nbar\n" + │ │ ├── @ StringNode (location: (39,0)-(40,0)) + │ │ │ ├── flags: static_literal, frozen + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (39,0)-(40,0) = " \\f\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "\f\n" + │ │ └── @ StringNode (location: (40,0)-(41,0)) + │ │ ├── flags: static_literal, frozen + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (40,0)-(41,0) = " ok\n" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "ok\n" + │ └── closing_loc: (41,0)-(42,0) = "RUBY\n" + └── @ StringNode (location: (43,0)-(43,8)) + ├── flags: newline + ├── opening_loc: (43,0)-(43,8) = "<<'RUBY'" + ├── content_loc: (44,0)-(55,0) = " \\n\n \\n\n exit\n \\n\n \\n\\n\\n\\n\n argh\n \\\n \\\n foo\\nbar\n \\f\n ok\n" + ├── closing_loc: (55,0)-(56,0) = "RUBY\n" + └── unescaped: " \\n\n \\n\n exit\n \\n\n \\n\\n\\n\\n\n argh\n \\\n \\\n foo\\nbar\n \\f\n ok\n" diff --git a/test/prism/snapshots/strings.txt b/test/prism/snapshots/strings.txt new file mode 100644 index 0000000000..c5e7883b4a --- /dev/null +++ b/test/prism/snapshots/strings.txt @@ -0,0 +1,800 @@ +@ ProgramNode (location: (1,0)-(147,15)) +├── flags: ∅ +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(147,15)) + ├── flags: ∅ + └── body: (length: 63) + ├── @ StringNode (location: (1,0)-(1,6)) + │ ├── flags: newline + │ ├── opening_loc: (1,0)-(1,2) = "%%" + │ ├── content_loc: (1,2)-(1,5) = "abc" + │ ├── closing_loc: (1,5)-(1,6) = "%" + │ └── unescaped: "abc" + ├── @ StringNode (location: (3,0)-(3,6)) + │ ├── flags: newline + │ ├── opening_loc: (3,0)-(3,2) = "%^" + │ ├── content_loc: (3,2)-(3,5) = "abc" + │ ├── closing_loc: (3,5)-(3,6) = "^" + │ └── unescaped: "abc" + ├── @ StringNode (location: (5,0)-(5,6)) + │ ├── flags: newline + │ ├── opening_loc: (5,0)-(5,2) = "%&" + │ ├── content_loc: (5,2)-(5,5) = "abc" + │ ├── closing_loc: (5,5)-(5,6) = "&" + │ └── unescaped: "abc" + ├── @ StringNode (location: (7,0)-(7,6)) + │ ├── flags: newline + │ ├── opening_loc: (7,0)-(7,2) = "%*" + │ ├── content_loc: (7,2)-(7,5) = "abc" + │ ├── closing_loc: (7,5)-(7,6) = "*" + │ └── unescaped: "abc" + ├── @ StringNode (location: (9,0)-(9,6)) + │ ├── flags: newline + │ ├── opening_loc: (9,0)-(9,2) = "%_" + │ ├── content_loc: (9,2)-(9,5) = "abc" + │ ├── closing_loc: (9,5)-(9,6) = "_" + │ └── unescaped: "abc" + ├── @ StringNode (location: (11,0)-(11,6)) + │ ├── flags: newline + │ ├── opening_loc: (11,0)-(11,2) = "%+" + │ ├── content_loc: (11,2)-(11,5) = "abc" + │ ├── closing_loc: (11,5)-(11,6) = "+" + │ └── unescaped: "abc" + ├── @ StringNode (location: (13,0)-(13,6)) + │ ├── flags: newline + │ ├── opening_loc: (13,0)-(13,2) = "%-" + │ ├── content_loc: (13,2)-(13,5) = "abc" + │ ├── closing_loc: (13,5)-(13,6) = "-" + │ └── unescaped: "abc" + ├── @ StringNode (location: (15,0)-(15,6)) + │ ├── flags: newline + │ ├── opening_loc: (15,0)-(15,2) = "%:" + │ ├── content_loc: (15,2)-(15,5) = "abc" + │ ├── closing_loc: (15,5)-(15,6) = ":" + │ └── unescaped: "abc" + ├── @ StringNode (location: (17,0)-(17,6)) + │ ├── flags: newline + │ ├── opening_loc: (17,0)-(17,2) = "%;" + │ ├── content_loc: (17,2)-(17,5) = "abc" + │ ├── closing_loc: (17,5)-(17,6) = ";" + │ └── unescaped: "abc" + ├── @ StringNode (location: (19,0)-(19,6)) + │ ├── flags: newline + │ ├── opening_loc: (19,0)-(19,2) = "%'" + │ ├── content_loc: (19,2)-(19,5) = "abc" + │ ├── closing_loc: (19,5)-(19,6) = "'" + │ └── unescaped: "abc" + ├── @ StringNode (location: (21,0)-(21,6)) + │ ├── flags: newline + │ ├── opening_loc: (21,0)-(21,2) = "%~" + │ ├── content_loc: (21,2)-(21,5) = "abc" + │ ├── closing_loc: (21,5)-(21,6) = "~" + │ └── unescaped: "abc" + ├── @ StringNode (location: (23,0)-(23,6)) + │ ├── flags: newline + │ ├── opening_loc: (23,0)-(23,2) = "%?" + │ ├── content_loc: (23,2)-(23,5) = "abc" + │ ├── closing_loc: (23,5)-(23,6) = "?" + │ └── unescaped: "abc" + ├── @ ArrayNode (location: (25,0)-(25,8)) + │ ├── flags: newline, static_literal + │ ├── elements: (length: 0) + │ ├── opening_loc: (25,0)-(25,3) = "%w{" + │ └── closing_loc: (25,7)-(25,8) = "}" + ├── @ StringNode (location: (27,0)-(27,6)) + │ ├── flags: newline + │ ├── opening_loc: (27,0)-(27,2) = "%/" + │ ├── content_loc: (27,2)-(27,5) = "abc" + │ ├── closing_loc: (27,5)-(27,6) = "/" + │ └── unescaped: "abc" + ├── @ StringNode (location: (29,0)-(29,6)) + │ ├── flags: newline + │ ├── opening_loc: (29,0)-(29,2) = "%`" + │ ├── content_loc: (29,2)-(29,5) = "abc" + │ ├── closing_loc: (29,5)-(29,6) = "`" + │ └── unescaped: "abc" + ├── @ InterpolatedStringNode (location: (31,0)-(31,8)) + │ ├── flags: newline + │ ├── opening_loc: (31,0)-(31,1) = "\"" + │ ├── parts: (length: 1) + │ │ └── @ EmbeddedVariableNode (location: (31,1)-(31,7)) + │ │ ├── flags: ∅ + │ │ ├── operator_loc: (31,1)-(31,2) = "#" + │ │ └── variable: + │ │ @ ClassVariableReadNode (location: (31,2)-(31,7)) + │ │ ├── flags: ∅ + │ │ └── name: :@@foo + │ └── closing_loc: (31,7)-(31,8) = "\"" + ├── @ StringNode (location: (33,0)-(33,6)) + │ ├── flags: newline + │ ├── opening_loc: (33,0)-(33,2) = "%\\" + │ ├── content_loc: (33,2)-(33,5) = "abc" + │ ├── closing_loc: (33,5)-(33,6) = "\\" + │ └── unescaped: "abc" + ├── @ InterpolatedStringNode (location: (35,0)-(35,17)) + │ ├── flags: newline + │ ├── opening_loc: (35,0)-(35,2) = "%{" + │ ├── parts: (length: 3) + │ │ ├── @ StringNode (location: (35,2)-(35,6)) + │ │ │ ├── flags: static_literal, frozen + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (35,2)-(35,6) = "aaa " + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "aaa " + │ │ ├── @ EmbeddedStatementsNode (location: (35,6)-(35,12)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (35,6)-(35,8) = "\#{" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (35,8)-(35,11)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (35,8)-(35,11)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :bbb + │ │ │ │ ├── message_loc: (35,8)-(35,11) = "bbb" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── closing_loc: (35,11)-(35,12) = "}" + │ │ └── @ StringNode (location: (35,12)-(35,16)) + │ │ ├── flags: static_literal, frozen + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (35,12)-(35,16) = " ccc" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: " ccc" + │ └── closing_loc: (35,16)-(35,17) = "}" + ├── @ StringNode (location: (37,0)-(37,8)) + │ ├── flags: newline + │ ├── opening_loc: (37,0)-(37,2) = "%[" + │ ├── content_loc: (37,2)-(37,7) = "foo[]" + │ ├── closing_loc: (37,7)-(37,8) = "]" + │ └── unescaped: "foo[]" + ├── @ CallNode (location: (39,0)-(41,5)) + │ ├── flags: newline + │ ├── receiver: + │ │ @ StringNode (location: (39,0)-(39,5)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (39,0)-(39,1) = "\"" + │ │ ├── content_loc: (39,1)-(39,4) = "foo" + │ │ ├── closing_loc: (39,4)-(39,5) = "\"" + │ │ └── unescaped: "foo" + │ ├── call_operator_loc: ∅ + │ ├── name: :+ + │ ├── message_loc: (39,6)-(39,7) = "+" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (41,0)-(41,5)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ StringNode (location: (41,0)-(41,5)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (41,0)-(41,1) = "\"" + │ │ ├── content_loc: (41,1)-(41,4) = "bar" + │ │ ├── closing_loc: (41,4)-(41,5) = "\"" + │ │ └── unescaped: "bar" + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ StringNode (location: (43,0)-(46,1)) + │ ├── flags: newline + │ ├── opening_loc: (43,0)-(43,1) = "\"" + │ ├── content_loc: (43,1)-(46,0) = "\nfoo\\\nb\\nar\n" + │ ├── closing_loc: (46,0)-(46,1) = "\"" + │ └── unescaped: "\nfoob\nar\n" + ├── @ StringNode (location: (48,0)-(48,7)) + │ ├── flags: newline + │ ├── opening_loc: (48,0)-(48,3) = "%q{" + │ ├── content_loc: (48,3)-(48,6) = "abc" + │ ├── closing_loc: (48,6)-(48,7) = "}" + │ └── unescaped: "abc" + ├── @ SymbolNode (location: (50,0)-(50,7)) + │ ├── flags: newline, static_literal, forced_us_ascii_encoding + │ ├── opening_loc: (50,0)-(50,3) = "%s[" + │ ├── value_loc: (50,3)-(50,6) = "abc" + │ ├── closing_loc: (50,6)-(50,7) = "]" + │ └── unescaped: "abc" + ├── @ StringNode (location: (52,0)-(52,6)) + │ ├── flags: newline + │ ├── opening_loc: (52,0)-(52,2) = "%{" + │ ├── content_loc: (52,2)-(52,5) = "abc" + │ ├── closing_loc: (52,5)-(52,6) = "}" + │ └── unescaped: "abc" + ├── @ StringNode (location: (54,0)-(54,2)) + │ ├── flags: newline + │ ├── opening_loc: (54,0)-(54,1) = "'" + │ ├── content_loc: (54,1)-(54,1) = "" + │ ├── closing_loc: (54,1)-(54,2) = "'" + │ └── unescaped: "" + ├── @ StringNode (location: (56,0)-(56,5)) + │ ├── flags: newline + │ ├── opening_loc: (56,0)-(56,1) = "\"" + │ ├── content_loc: (56,1)-(56,4) = "abc" + │ ├── closing_loc: (56,4)-(56,5) = "\"" + │ └── unescaped: "abc" + ├── @ StringNode (location: (58,0)-(58,7)) + │ ├── flags: newline + │ ├── opening_loc: (58,0)-(58,1) = "\"" + │ ├── content_loc: (58,1)-(58,6) = "\#@---" + │ ├── closing_loc: (58,6)-(58,7) = "\"" + │ └── unescaped: "\#@---" + ├── @ InterpolatedStringNode (location: (60,0)-(60,16)) + │ ├── flags: newline + │ ├── opening_loc: (60,0)-(60,1) = "\"" + │ ├── parts: (length: 3) + │ │ ├── @ StringNode (location: (60,1)-(60,5)) + │ │ │ ├── flags: static_literal, frozen + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (60,1)-(60,5) = "aaa " + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "aaa " + │ │ ├── @ EmbeddedStatementsNode (location: (60,5)-(60,11)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (60,5)-(60,7) = "\#{" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (60,7)-(60,10)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (60,7)-(60,10)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :bbb + │ │ │ │ ├── message_loc: (60,7)-(60,10) = "bbb" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── closing_loc: (60,10)-(60,11) = "}" + │ │ └── @ StringNode (location: (60,11)-(60,15)) + │ │ ├── flags: static_literal, frozen + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (60,11)-(60,15) = " ccc" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: " ccc" + │ └── closing_loc: (60,15)-(60,16) = "\"" + ├── @ StringNode (location: (62,0)-(62,5)) + │ ├── flags: newline + │ ├── opening_loc: (62,0)-(62,1) = "'" + │ ├── content_loc: (62,1)-(62,4) = "abc" + │ ├── closing_loc: (62,4)-(62,5) = "'" + │ └── unescaped: "abc" + ├── @ ArrayNode (location: (64,0)-(64,9)) + │ ├── flags: newline + │ ├── elements: (length: 3) + │ │ ├── @ StringNode (location: (64,3)-(64,4)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (64,3)-(64,4) = "a" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a" + │ │ ├── @ StringNode (location: (64,5)-(64,6)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (64,5)-(64,6) = "b" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "b" + │ │ └── @ StringNode (location: (64,7)-(64,8)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (64,7)-(64,8) = "c" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "c" + │ ├── opening_loc: (64,0)-(64,3) = "%w[" + │ └── closing_loc: (64,8)-(64,9) = "]" + ├── @ ArrayNode (location: (66,0)-(66,17)) + │ ├── flags: newline + │ ├── elements: (length: 3) + │ │ ├── @ StringNode (location: (66,3)-(66,6)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (66,3)-(66,6) = "a[]" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a[]" + │ │ ├── @ StringNode (location: (66,7)-(66,12)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (66,7)-(66,12) = "b[[]]" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "b[[]]" + │ │ └── @ StringNode (location: (66,13)-(66,16)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (66,13)-(66,16) = "c[]" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "c[]" + │ ├── opening_loc: (66,0)-(66,3) = "%w[" + │ └── closing_loc: (66,16)-(66,17) = "]" + ├── @ ArrayNode (location: (68,0)-(68,18)) + │ ├── flags: newline + │ ├── elements: (length: 2) + │ │ ├── @ StringNode (location: (68,3)-(68,11)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (68,3)-(68,11) = "foo\\ bar" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "foo bar" + │ │ └── @ StringNode (location: (68,12)-(68,17)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (68,12)-(68,17) = "\\\#{1}" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "\\\#{1}" + │ ├── opening_loc: (68,0)-(68,3) = "%w[" + │ └── closing_loc: (68,17)-(68,18) = "]" + ├── @ ArrayNode (location: (70,0)-(70,16)) + │ ├── flags: newline + │ ├── elements: (length: 2) + │ │ ├── @ StringNode (location: (70,3)-(70,11)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (70,3)-(70,11) = "foo\\ bar" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "foo bar" + │ │ └── @ StringNode (location: (70,12)-(70,15)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (70,12)-(70,15) = "baz" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "baz" + │ ├── opening_loc: (70,0)-(70,3) = "%w[" + │ └── closing_loc: (70,15)-(70,16) = "]" + ├── @ ArrayNode (location: (72,0)-(73,5)) + │ ├── flags: newline + │ ├── elements: (length: 3) + │ │ ├── @ StringNode (location: (72,3)-(72,13)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (72,3)-(72,13) = "foo\\ bar\\\\" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "foo bar\\" + │ │ ├── @ StringNode (location: (72,14)-(73,0)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (72,14)-(73,0) = "baz\\\\\\\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "baz\\\n" + │ │ └── @ StringNode (location: (73,1)-(73,4)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (73,1)-(73,4) = "bat" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "bat" + │ ├── opening_loc: (72,0)-(72,3) = "%w[" + │ └── closing_loc: (73,4)-(73,5) = "]" + ├── @ ArrayNode (location: (75,0)-(78,1)) + │ ├── flags: newline + │ ├── elements: (length: 3) + │ │ ├── @ InterpolatedStringNode (location: (75,3)-(76,3)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── parts: (length: 2) + │ │ │ │ ├── @ EmbeddedStatementsNode (location: (75,3)-(75,9)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ ├── opening_loc: (75,3)-(75,5) = "\#{" + │ │ │ │ │ ├── statements: + │ │ │ │ │ │ @ StatementsNode (location: (75,5)-(75,8)) + │ │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ │ └── body: (length: 1) + │ │ │ │ │ │ └── @ CallNode (location: (75,5)-(75,8)) + │ │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ │ ├── name: :foo + │ │ │ │ │ │ ├── message_loc: (75,5)-(75,8) = "foo" + │ │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ │ └── block: ∅ + │ │ │ │ │ └── closing_loc: (75,8)-(75,9) = "}" + │ │ │ │ └── @ StringNode (location: (75,9)-(76,3)) + │ │ │ │ ├── flags: static_literal, frozen + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── content_loc: (75,9)-(76,3) = "\\\nbar" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "\nbar" + │ │ │ └── closing_loc: ∅ + │ │ ├── @ StringNode (location: (77,0)-(77,3)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (77,0)-(77,3) = "baz" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "baz" + │ │ └── @ InterpolatedStringNode (location: (77,4)-(77,10)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── parts: (length: 1) + │ │ │ └── @ EmbeddedStatementsNode (location: (77,4)-(77,10)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (77,4)-(77,6) = "\#{" + │ │ │ ├── statements: + │ │ │ │ @ StatementsNode (location: (77,6)-(77,9)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (77,6)-(77,9)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :bat + │ │ │ │ ├── message_loc: (77,6)-(77,9) = "bat" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── closing_loc: (77,9)-(77,10) = "}" + │ │ └── closing_loc: ∅ + │ ├── opening_loc: (75,0)-(75,3) = "%W[" + │ └── closing_loc: (78,0)-(78,1) = "]" + ├── @ ArrayNode (location: (80,0)-(80,9)) + │ ├── flags: newline + │ ├── elements: (length: 1) + │ │ └── @ StringNode (location: (80,3)-(80,8)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (80,3)-(80,8) = "foo\\n" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "foo\\n" + │ ├── opening_loc: (80,0)-(80,3) = "%w(" + │ └── closing_loc: (80,8)-(80,9) = ")" + ├── @ ArrayNode (location: (82,0)-(83,1)) + │ ├── flags: newline + │ ├── elements: (length: 1) + │ │ └── @ StringNode (location: (82,3)-(83,0)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (82,3)-(83,0) = "foo\\\n" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "foo\n" + │ ├── opening_loc: (82,0)-(82,3) = "%w(" + │ └── closing_loc: (83,0)-(83,1) = ")" + ├── @ ArrayNode (location: (85,0)-(85,10)) + │ ├── flags: newline + │ ├── elements: (length: 2) + │ │ ├── @ StringNode (location: (85,3)-(85,6)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (85,3)-(85,6) = "foo" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "foo" + │ │ └── @ StringNode (location: (85,7)-(85,9)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (85,7)-(85,9) = "\\n" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "\\n" + │ ├── opening_loc: (85,0)-(85,3) = "%w(" + │ └── closing_loc: (85,9)-(85,10) = ")" + ├── @ ArrayNode (location: (87,0)-(88,4)) + │ ├── flags: newline + │ ├── elements: (length: 1) + │ │ └── @ StringNode (location: (87,3)-(88,3)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (87,3)-(88,3) = "foo\\\nbar" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "foo\nbar" + │ ├── opening_loc: (87,0)-(87,3) = "%W(" + │ └── closing_loc: (88,3)-(88,4) = ")" + ├── @ ArrayNode (location: (90,0)-(90,15)) + │ ├── flags: newline + │ ├── elements: (length: 2) + │ │ ├── @ StringNode (location: (90,3)-(90,6)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (90,3)-(90,6) = "foo" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "foo" + │ │ └── @ StringNode (location: (90,11)-(90,14)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (90,11)-(90,14) = "bar" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "bar" + │ ├── opening_loc: (90,0)-(90,3) = "%w[" + │ └── closing_loc: (90,14)-(90,15) = "]" + ├── @ ArrayNode (location: (92,0)-(96,1)) + │ ├── flags: newline + │ ├── elements: (length: 4) + │ │ ├── @ StringNode (location: (93,2)-(93,3)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (93,2)-(93,3) = "a" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a" + │ │ ├── @ StringNode (location: (94,2)-(94,3)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (94,2)-(94,3) = "b" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "b" + │ │ ├── @ StringNode (location: (94,6)-(94,7)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (94,6)-(94,7) = "c" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "c" + │ │ └── @ StringNode (location: (95,1)-(95,2)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (95,1)-(95,2) = "d" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "d" + │ ├── opening_loc: (92,0)-(92,3) = "%w[" + │ └── closing_loc: (96,0)-(96,1) = "]" + ├── @ ArrayNode (location: (98,0)-(98,18)) + │ ├── flags: newline + │ ├── elements: (length: 1) + │ │ └── @ StringNode (location: (98,3)-(98,17)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (98,3)-(98,17) = "f\\u{006f 006f}" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "foo" + │ ├── opening_loc: (98,0)-(98,3) = "%W[" + │ └── closing_loc: (98,17)-(98,18) = "]" + ├── @ ArrayNode (location: (100,0)-(100,14)) + │ ├── flags: newline + │ ├── elements: (length: 3) + │ │ ├── @ StringNode (location: (100,3)-(100,4)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (100,3)-(100,4) = "a" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a" + │ │ ├── @ InterpolatedStringNode (location: (100,5)-(100,11)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── parts: (length: 3) + │ │ │ │ ├── @ StringNode (location: (100,5)-(100,6)) + │ │ │ │ │ ├── flags: static_literal, frozen + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── content_loc: (100,5)-(100,6) = "b" + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── unescaped: "b" + │ │ │ │ ├── @ EmbeddedStatementsNode (location: (100,6)-(100,10)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ ├── opening_loc: (100,6)-(100,8) = "\#{" + │ │ │ │ │ ├── statements: + │ │ │ │ │ │ @ StatementsNode (location: (100,8)-(100,9)) + │ │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ │ └── body: (length: 1) + │ │ │ │ │ │ └── @ CallNode (location: (100,8)-(100,9)) + │ │ │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ │ ├── name: :c + │ │ │ │ │ │ ├── message_loc: (100,8)-(100,9) = "c" + │ │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ │ └── block: ∅ + │ │ │ │ │ └── closing_loc: (100,9)-(100,10) = "}" + │ │ │ │ └── @ StringNode (location: (100,10)-(100,11)) + │ │ │ │ ├── flags: static_literal, frozen + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── content_loc: (100,10)-(100,11) = "d" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "d" + │ │ │ └── closing_loc: ∅ + │ │ └── @ StringNode (location: (100,12)-(100,13)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (100,12)-(100,13) = "e" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "e" + │ ├── opening_loc: (100,0)-(100,3) = "%W[" + │ └── closing_loc: (100,13)-(100,14) = "]" + ├── @ ArrayNode (location: (102,0)-(102,9)) + │ ├── flags: newline + │ ├── elements: (length: 3) + │ │ ├── @ StringNode (location: (102,3)-(102,4)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (102,3)-(102,4) = "a" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a" + │ │ ├── @ StringNode (location: (102,5)-(102,6)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (102,5)-(102,6) = "b" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "b" + │ │ └── @ StringNode (location: (102,7)-(102,8)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (102,7)-(102,8) = "c" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "c" + │ ├── opening_loc: (102,0)-(102,3) = "%W[" + │ └── closing_loc: (102,8)-(102,9) = "]" + ├── @ ArrayNode (location: (104,0)-(108,1)) + │ ├── flags: newline + │ ├── elements: (length: 3) + │ │ ├── @ StringNode (location: (105,2)-(105,3)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (105,2)-(105,3) = "a" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a" + │ │ ├── @ StringNode (location: (106,2)-(106,3)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (106,2)-(106,3) = "b" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "b" + │ │ └── @ StringNode (location: (107,2)-(107,3)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (107,2)-(107,3) = "c" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "c" + │ ├── opening_loc: (104,0)-(104,3) = "%w[" + │ └── closing_loc: (108,0)-(108,1) = "]" + ├── @ StringNode (location: (110,0)-(110,15)) + │ ├── flags: newline + │ ├── opening_loc: (110,0)-(110,1) = "'" + │ ├── content_loc: (110,1)-(110,14) = "\\' foo \\' bar" + │ ├── closing_loc: (110,14)-(110,15) = "'" + │ └── unescaped: "' foo ' bar" + ├── @ StringNode (location: (112,0)-(112,15)) + │ ├── flags: newline + │ ├── opening_loc: (112,0)-(112,1) = "'" + │ ├── content_loc: (112,1)-(112,14) = "\\\\ foo \\\\ bar" + │ ├── closing_loc: (112,14)-(112,15) = "'" + │ └── unescaped: "\\ foo \\ bar" + ├── @ StringNode (location: (114,0)-(117,1)) + │ ├── flags: newline + │ ├── opening_loc: (114,0)-(114,1) = "'" + │ ├── content_loc: (114,1)-(117,0) = "foo\\\nbar\\\\\nbaz\n" + │ ├── closing_loc: (117,0)-(117,1) = "'" + │ └── unescaped: "foo\\\nbar\\\nbaz\n" + ├── @ InterpolatedStringNode (location: (119,0)-(119,7)) + │ ├── flags: newline + │ ├── opening_loc: (119,0)-(119,1) = "\"" + │ ├── parts: (length: 1) + │ │ └── @ EmbeddedVariableNode (location: (119,1)-(119,6)) + │ │ ├── flags: ∅ + │ │ ├── operator_loc: (119,1)-(119,2) = "#" + │ │ └── variable: + │ │ @ GlobalVariableReadNode (location: (119,2)-(119,6)) + │ │ ├── flags: ∅ + │ │ └── name: :$foo + │ └── closing_loc: (119,6)-(119,7) = "\"" + ├── @ InterpolatedStringNode (location: (121,0)-(121,7)) + │ ├── flags: newline + │ ├── opening_loc: (121,0)-(121,1) = "\"" + │ ├── parts: (length: 1) + │ │ └── @ EmbeddedVariableNode (location: (121,1)-(121,6)) + │ │ ├── flags: ∅ + │ │ ├── operator_loc: (121,1)-(121,2) = "#" + │ │ └── variable: + │ │ @ InstanceVariableReadNode (location: (121,2)-(121,6)) + │ │ ├── flags: ∅ + │ │ └── name: :@foo + │ └── closing_loc: (121,6)-(121,7) = "\"" + ├── @ StringNode (location: (123,0)-(123,15)) + │ ├── flags: newline + │ ├── opening_loc: (123,0)-(123,1) = "\"" + │ ├── content_loc: (123,1)-(123,14) = "\\x7 \\x23 \\x61" + │ ├── closing_loc: (123,14)-(123,15) = "\"" + │ └── unescaped: "\a # a" + ├── @ StringNode (location: (125,0)-(125,13)) + │ ├── flags: newline + │ ├── opening_loc: (125,0)-(125,1) = "\"" + │ ├── content_loc: (125,1)-(125,12) = "\\7 \\43 \\141" + │ ├── closing_loc: (125,12)-(125,13) = "\"" + │ └── unescaped: "\a # a" + ├── @ StringNode (location: (127,0)-(127,17)) + │ ├── flags: newline, forced_utf8_encoding + │ ├── opening_loc: (127,0)-(127,1) = "\"" + │ ├── content_loc: (127,1)-(127,16) = "ち\\xE3\\x81\\xFF" + │ ├── closing_loc: (127,16)-(127,17) = "\"" + │ └── unescaped: "ち\xE3\x81\xFF" + ├── @ StringNode (location: (129,0)-(129,6)) + │ ├── flags: newline + │ ├── opening_loc: (129,0)-(129,2) = "%[" + │ ├── content_loc: (129,2)-(129,5) = "abc" + │ ├── closing_loc: (129,5)-(129,6) = "]" + │ └── unescaped: "abc" + ├── @ StringNode (location: (131,0)-(131,6)) + │ ├── flags: newline + │ ├── opening_loc: (131,0)-(131,2) = "%(" + │ ├── content_loc: (131,2)-(131,5) = "abc" + │ ├── closing_loc: (131,5)-(131,6) = ")" + │ └── unescaped: "abc" + ├── @ StringNode (location: (133,0)-(133,6)) + │ ├── flags: newline + │ ├── opening_loc: (133,0)-(133,2) = "%@" + │ ├── content_loc: (133,2)-(133,5) = "abc" + │ ├── closing_loc: (133,5)-(133,6) = "@" + │ └── unescaped: "abc" + ├── @ StringNode (location: (135,0)-(135,6)) + │ ├── flags: newline + │ ├── opening_loc: (135,0)-(135,2) = "%$" + │ ├── content_loc: (135,2)-(135,5) = "abc" + │ ├── closing_loc: (135,5)-(135,6) = "$" + │ └── unescaped: "abc" + ├── @ StringNode (location: (137,0)-(137,2)) + │ ├── flags: newline + │ ├── opening_loc: (137,0)-(137,1) = "?" + │ ├── content_loc: (137,1)-(137,2) = "a" + │ ├── closing_loc: ∅ + │ └── unescaped: "a" + ├── @ InterpolatedStringNode (location: (139,0)-(139,6)) + │ ├── flags: newline, static_literal + │ ├── opening_loc: ∅ + │ ├── parts: (length: 2) + │ │ ├── @ StringNode (location: (139,0)-(139,2)) + │ │ │ ├── flags: static_literal, frozen + │ │ │ ├── opening_loc: (139,0)-(139,1) = "?" + │ │ │ ├── content_loc: (139,1)-(139,2) = "a" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "a" + │ │ └── @ StringNode (location: (139,3)-(139,6)) + │ │ ├── flags: static_literal, frozen + │ │ ├── opening_loc: (139,3)-(139,4) = "\"" + │ │ ├── content_loc: (139,4)-(139,5) = "a" + │ │ ├── closing_loc: (139,5)-(139,6) = "\"" + │ │ └── unescaped: "a" + │ └── closing_loc: ∅ + ├── @ StringNode (location: (141,0)-(141,7)) + │ ├── flags: newline + │ ├── opening_loc: (141,0)-(141,3) = "%Q{" + │ ├── content_loc: (141,3)-(141,6) = "abc" + │ ├── closing_loc: (141,6)-(141,7) = "}" + │ └── unescaped: "abc" + ├── @ StringNode (location: (143,0)-(143,5)) + │ ├── flags: newline + │ ├── opening_loc: (143,0)-(143,2) = "%^" + │ ├── content_loc: (143,2)-(143,4) = "\#$" + │ ├── closing_loc: (143,4)-(143,5) = "^" + │ └── unescaped: "\#$" + ├── @ StringNode (location: (145,0)-(145,4)) + │ ├── flags: newline + │ ├── opening_loc: (145,0)-(145,2) = "%@" + │ ├── content_loc: (145,2)-(145,3) = "#" + │ ├── closing_loc: (145,3)-(145,4) = "@" + │ └── unescaped: "#" + └── @ InterpolatedStringNode (location: (147,0)-(147,15)) + ├── flags: newline + ├── opening_loc: (147,0)-(147,1) = "\"" + ├── parts: (length: 2) + │ ├── @ EmbeddedStatementsNode (location: (147,1)-(147,12)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (147,1)-(147,3) = "\#{" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (147,3)-(147,11)) + │ │ │ ├── flags: ∅ + │ │ │ └── body: (length: 1) + │ │ │ └── @ InterpolatedStringNode (location: (147,3)-(147,11)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (147,3)-(147,4) = "\"" + │ │ │ ├── parts: (length: 2) + │ │ │ │ ├── @ EmbeddedStatementsNode (location: (147,4)-(147,8)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ ├── opening_loc: (147,4)-(147,6) = "\#{" + │ │ │ │ │ ├── statements: + │ │ │ │ │ │ @ StatementsNode (location: (147,6)-(147,7)) + │ │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ │ └── body: (length: 1) + │ │ │ │ │ │ └── @ ConstantReadNode (location: (147,6)-(147,7)) + │ │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ │ └── name: :B + │ │ │ │ │ └── closing_loc: (147,7)-(147,8) = "}" + │ │ │ │ └── @ StringNode (location: (147,8)-(147,10)) + │ │ │ │ ├── flags: static_literal, frozen + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── content_loc: (147,8)-(147,10) = " C" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: " C" + │ │ │ └── closing_loc: (147,10)-(147,11) = "\"" + │ │ └── closing_loc: (147,11)-(147,12) = "}" + │ └── @ StringNode (location: (147,12)-(147,14)) + │ ├── flags: static_literal, frozen + │ ├── opening_loc: ∅ + │ ├── content_loc: (147,12)-(147,14) = " D" + │ ├── closing_loc: ∅ + │ └── unescaped: " D" + └── closing_loc: (147,14)-(147,15) = "\"" |