From 66b65634c047a935f1e776314069acdebfcce9e8 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Sun, 12 Jan 2025 15:27:46 +0100 Subject: [PATCH] Fix parser translator ranges for mulltiline strings with multiline bytes A rather silly issue with a rather simple fix. The ranges already use the offset cache, this effectivly double-encoded them. --- lib/prism/translation/parser/lexer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/prism/translation/parser/lexer.rb b/lib/prism/translation/parser/lexer.rb index 49fdd2aea8..d092029ddc 100644 --- a/lib/prism/translation/parser/lexer.rb +++ b/lib/prism/translation/parser/lexer.rb @@ -409,7 +409,7 @@ def to_a # it emits a single string node. The backslash (and remaining newline) is removed. current_line = +"" adjustment = 0 - start_offset = offset_cache[token.location.start_offset] + start_offset = token.location.start_offset emit = false lines.each.with_index do |line, index|