instance method
Prism::Translation::Parser::Lexer#percent_array_leading_whitespace
percent_array_leading_whitespace(string)
lib/prism/translation/parser/lexer.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/prism/translation/parser/lexer.rb, line 792
def percent_array_leading_whitespace(string)
return 1 if string.start_with?("\n")
leading_whitespace = 0
string.each_char do |c|
break if c == "\n"
leading_whitespace += 1
end
leading_whitespace
end
For %-arrays whitespace, the parser gem only considers whitespace before the newline.