diff options
| author | Kevin Newton <kddnewton@gmail.com> | 2023-09-13 21:02:16 -0400 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2023-09-14 13:58:12 +0000 |
| commit | 57745450dd85567cbdce703f12c9825fd81e52a2 (patch) | |
| tree | ac7e572fdb2ab8513272f439918579b507106a78 /test | |
| parent | 72d008d88d32fe3eb3f7033d93c90a00cb7d7c61 (diff) | |
[ruby/yarp] Extract out heredoc parsing into parse_strings
https://github.com/ruby/yarp/commit/c5a1094988
Diffstat (limited to 'test')
9 files changed, 14 insertions, 14 deletions
diff --git a/test/yarp/snapshots/dash_heredocs.txt b/test/yarp/snapshots/dash_heredocs.txt index 0a3c43cac7..a4af04d892 100644 --- a/test/yarp/snapshots/dash_heredocs.txt +++ b/test/yarp/snapshots/dash_heredocs.txt @@ -142,7 +142,7 @@ │ └── unescaped: " a\n b\n" ├── @ StringNode (location: (201...206)) │ ├── opening_loc: (201...206) = "<<-''" - │ ├── content_loc: (206...207) = "\n" + │ ├── content_loc: (207...207) = "" │ ├── closing_loc: (207...208) = "\n" │ └── unescaped: "" ├── @ StringNode (location: (209...217)) diff --git a/test/yarp/snapshots/heredoc_with_escaped_newline_at_start.txt b/test/yarp/snapshots/heredoc_with_escaped_newline_at_start.txt index 0672ef2587..38bf2549e5 100644 --- a/test/yarp/snapshots/heredoc_with_escaped_newline_at_start.txt +++ b/test/yarp/snapshots/heredoc_with_escaped_newline_at_start.txt @@ -7,7 +7,7 @@ │ ├── receiver: │ │ @ StringNode (location: (0...9)) │ │ ├── opening_loc: (0...9) = "<<-TARGET" - │ │ ├── content_loc: (9...27) = ".gsub /^\\s{/, ''\\\n" + │ │ ├── content_loc: (27...27) = "" │ │ ├── closing_loc: (27...34) = "TARGET\n" │ │ └── unescaped: "" │ ├── call_operator_loc: (9...10) = "." @@ -35,7 +35,7 @@ ├── receiver: │ @ StringNode (location: (37...46)) │ ├── opening_loc: (37...46) = "<<-TARGET" - │ ├── content_loc: (46...65) = ".gsub /^\\s{/, ''\\\r\n" + │ ├── content_loc: (65...65) = "" │ ├── closing_loc: (65...73) = "TARGET\r\n" │ └── unescaped: "" ├── call_operator_loc: (46...47) = "." diff --git a/test/yarp/snapshots/heredoc_with_trailing_newline.txt b/test/yarp/snapshots/heredoc_with_trailing_newline.txt index 077e9703af..60ffcb2a03 100644 --- a/test/yarp/snapshots/heredoc_with_trailing_newline.txt +++ b/test/yarp/snapshots/heredoc_with_trailing_newline.txt @@ -5,6 +5,6 @@ └── body: (length: 1) └── @ StringNode (location: (0...6)) ├── opening_loc: (0...6) = "<<-END" - ├── content_loc: (6...7) = "\n" + ├── content_loc: (7...7) = "" ├── closing_loc: (7...10) = "END" └── unescaped: "" diff --git a/test/yarp/snapshots/heredocs_with_ignored_newlines.txt b/test/yarp/snapshots/heredocs_with_ignored_newlines.txt index c0e84a874b..7eac804242 100644 --- a/test/yarp/snapshots/heredocs_with_ignored_newlines.txt +++ b/test/yarp/snapshots/heredocs_with_ignored_newlines.txt @@ -5,7 +5,7 @@ └── body: (length: 2) ├── @ StringNode (location: (0...7)) │ ├── opening_loc: (0...7) = "<<-HERE" - │ ├── content_loc: (7...9) = "\\\n" + │ ├── content_loc: (9...9) = "" │ ├── closing_loc: (9...14) = "HERE\n" │ └── unescaped: "" └── @ StringNode (location: (15...23)) diff --git a/test/yarp/snapshots/seattlerb/heredoc_squiggly_empty.txt b/test/yarp/snapshots/seattlerb/heredoc_squiggly_empty.txt index 78e9731fdc..6fee4e8819 100644 --- a/test/yarp/snapshots/seattlerb/heredoc_squiggly_empty.txt +++ b/test/yarp/snapshots/seattlerb/heredoc_squiggly_empty.txt @@ -5,6 +5,6 @@ └── body: (length: 1) └── @ StringNode (location: (0...4)) ├── opening_loc: (0...4) = "<<~A" - ├── content_loc: (4...5) = "\n" + ├── content_loc: (5...5) = "" ├── closing_loc: (5...7) = "A\n" └── unescaped: "" diff --git a/test/yarp/snapshots/unparser/corpus/semantic/dstr.txt b/test/yarp/snapshots/unparser/corpus/semantic/dstr.txt index 5534951350..6efc2012af 100644 --- a/test/yarp/snapshots/unparser/corpus/semantic/dstr.txt +++ b/test/yarp/snapshots/unparser/corpus/semantic/dstr.txt @@ -5,22 +5,22 @@ └── body: (length: 33) ├── @ StringNode (location: (0...5)) │ ├── opening_loc: (0...5) = "<<DOC" - │ ├── content_loc: (5...6) = "\n" + │ ├── content_loc: (6...6) = "" │ ├── closing_loc: (6...10) = "DOC\n" │ └── unescaped: "" ├── @ StringNode (location: (11...18)) │ ├── opening_loc: (11...18) = "<<'DOC'" - │ ├── content_loc: (18...19) = "\n" + │ ├── content_loc: (19...19) = "" │ ├── closing_loc: (19...23) = "DOC\n" │ └── unescaped: "" ├── @ StringNode (location: (24...30)) │ ├── opening_loc: (24...30) = "<<~DOC" - │ ├── content_loc: (30...31) = "\n" + │ ├── content_loc: (31...31) = "" │ ├── closing_loc: (31...35) = "DOC\n" │ └── unescaped: "" ├── @ StringNode (location: (36...44)) │ ├── opening_loc: (36...44) = "<<~'DOC'" - │ ├── content_loc: (44...45) = "\n" + │ ├── content_loc: (45...45) = "" │ ├── closing_loc: (45...49) = "DOC\n" │ └── unescaped: "" ├── @ StringNode (location: (50...55)) diff --git a/test/yarp/snapshots/unparser/corpus/semantic/while.txt b/test/yarp/snapshots/unparser/corpus/semantic/while.txt index c23ec9d13f..532d9201e3 100644 --- a/test/yarp/snapshots/unparser/corpus/semantic/while.txt +++ b/test/yarp/snapshots/unparser/corpus/semantic/while.txt @@ -187,7 +187,7 @@ │ │ │ └── arguments: (length: 1) │ │ │ └── @ StringNode (location: (108...114)) │ │ │ ├── opening_loc: (108...114) = "<<-FOO" - │ │ │ ├── content_loc: (114...119) = ") do\n" + │ │ │ ├── content_loc: (119...119) = "" │ │ │ ├── closing_loc: (119...123) = "FOO\n" │ │ │ └── unescaped: "" │ │ ├── closing_loc: (114...115) = ")" diff --git a/test/yarp/snapshots/whitequark/bug_heredoc_do.txt b/test/yarp/snapshots/whitequark/bug_heredoc_do.txt index d5c2381c9d..0342bd4bac 100644 --- a/test/yarp/snapshots/whitequark/bug_heredoc_do.txt +++ b/test/yarp/snapshots/whitequark/bug_heredoc_do.txt @@ -13,7 +13,7 @@ │ └── arguments: (length: 1) │ └── @ StringNode (location: (2...10)) │ ├── opening_loc: (2...10) = "<<-TABLE" - │ ├── content_loc: (10...14) = " do\n" + │ ├── content_loc: (14...14) = "" │ ├── closing_loc: (14...20) = "TABLE\n" │ └── unescaped: "" ├── closing_loc: ∅ diff --git a/test/yarp/snapshots/whitequark/dedenting_heredoc.txt b/test/yarp/snapshots/whitequark/dedenting_heredoc.txt index b5cb19c475..5ef33b83cf 100644 --- a/test/yarp/snapshots/whitequark/dedenting_heredoc.txt +++ b/test/yarp/snapshots/whitequark/dedenting_heredoc.txt @@ -194,7 +194,7 @@ │ │ └── arguments: (length: 1) │ │ └── @ StringNode (location: (196...200)) │ │ ├── opening_loc: (196...200) = "<<~E" - │ │ ├── content_loc: (200...201) = "\n" + │ │ ├── content_loc: (201...201) = "" │ │ ├── closing_loc: (201...205) = " E\n" │ │ └── unescaped: "" │ ├── closing_loc: ∅ @@ -296,7 +296,7 @@ │ │ └── arguments: (length: 1) │ │ └── @ StringNode (location: (297...301)) │ │ ├── opening_loc: (297...301) = "<<~E" - │ │ ├── content_loc: (301...302) = "\n" + │ │ ├── content_loc: (302...302) = "" │ │ ├── closing_loc: (302...304) = "E\n" │ │ └── unescaped: "" │ ├── closing_loc: ∅ |
