From 0e4bfd08e548e90faf5d91bddccf418dc9a62a42 Mon Sep 17 00:00:00 2001 From: Koichi ITO Date: Sun, 3 Mar 2024 21:25:10 +0900 Subject: [ruby/prism] Fix an AST and token incompatibility for `Prism::Translation::Parser` Fixes https://github.com/ruby/prism/pull/2506. This PR fixes an AST and token incompatibility between Parser gem and `Prism::Translation::Parser` for symbols quoted with line breaks. https://github.com/ruby/prism/commit/06ab4df8cd --- test/prism/fixtures/dsym_str.txt | 2 ++ test/prism/snapshots/dsym_str.txt | 11 +++++++++++ 2 files changed, 13 insertions(+) create mode 100644 test/prism/fixtures/dsym_str.txt create mode 100644 test/prism/snapshots/dsym_str.txt (limited to 'test') diff --git a/test/prism/fixtures/dsym_str.txt b/test/prism/fixtures/dsym_str.txt new file mode 100644 index 0000000000..ee68dde88d --- /dev/null +++ b/test/prism/fixtures/dsym_str.txt @@ -0,0 +1,2 @@ +:"foo + bar" diff --git a/test/prism/snapshots/dsym_str.txt b/test/prism/snapshots/dsym_str.txt new file mode 100644 index 0000000000..33a5e2da21 --- /dev/null +++ b/test/prism/snapshots/dsym_str.txt @@ -0,0 +1,11 @@ +@ ProgramNode (location: (1,0)-(2,6)) +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,6)) + └── body: (length: 1) + └── @ SymbolNode (location: (1,0)-(2,6)) + ├── flags: forced_us_ascii_encoding + ├── opening_loc: (1,0)-(1,2) = ":\"" + ├── value_loc: (1,2)-(2,5) = "foo\n bar" + ├── closing_loc: (2,5)-(2,6) = "\"" + └── unescaped: "foo\n bar" -- cgit v1.2.3