From: "eightbitraptor (Matt V-H) via ruby-core" Date: 2024-12-09T22:02:05+00:00 Subject: [ruby-core:120144] [Ruby master Bug#20938] Percent String literal delimiter impacts string contents with parse.y Issue #20938 has been reported by eightbitraptor (Matt V-H). ---------------------------------------- Bug #20938: Percent String literal delimiter impacts string contents with parse.y https://bugs.ruby-lang.org/issues/20938 * Author: eightbitraptor (Matt V-H) * Status: Open * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- The following code defines 2 programs that declare string literals using `%` and a single byte delimiter. I'd expect these programs to have the same output no matter which delimiter is used. With Prism, both programs output the same value (the string content: `1_\n`), but using parse.y the output values differ depending on the delimiter. Are the outputs supposed to be the same or different? ``` program1 = "%\n1_\r\n\n" # => parse.y: 1_, prism: "1_\n" program2 = "%'1_\r\n'" # => "1_\n" p eval(program1) p eval(program2) ``` -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/