instance method
Prism::Translation::Parser::Lexer#percent_array_unescape
percent_array_unescape(string)
lib/prism/translation/parser/lexer.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/prism/translation/parser/lexer.rb, line 784
def percent_array_unescape(string)
string.gsub(/(\\)+[ \f\n\r\t\v]/) do |full_match|
full_match.delete_prefix!("\\") if Regexp.last_match[1].length.odd?
full_match
end
end
In a percent array, certain whitespace can be preceeded with a backslash, causing the following characters to be part of the previous element.