From 48749afe61fedcfd59cbd2fcc134c55f5ccef7f8 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: [ruby/prism] 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. https://github.com/ruby/prism/commit/66b65634c0 --- lib/prism/translation/parser/lexer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/prism/translation/parser/lexer.rb b/lib/prism/translation/parser/lexer.rb index 550219fc48..fd1d0243ca 100644 --- a/lib/prism/translation/parser/lexer.rb +++ b/lib/prism/translation/parser/lexer.rb @@ -409,7 +409,7 @@ module Prism # 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| -- cgit v1.2.3