Actions
Bug #19399
closedRipper::Lexer.parse throws NoMethodError error for some input
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.2.0 (2022-12-25 revision a528908271) [x86_64-darwin20]
Description
Ripper::Lexer.parse
throws undefined method `flatten!' for nil:NilClass (NoMethodError)
for this input
require 'ripper'
code = <<~CODE
a do |b # closing "|" is missing
<<~C
C
end
CODE
Ripper::Lexer.parse code
/Users/tomoya/.rbenv/versions/3.2.0/lib/ruby/3.2.0/ripper/lexer.rb:183:in `parse': undefined method `flatten!' for nil:NilClass (NoMethodError)
result.concat(@buf) until (@buf = []; super(); @buf.flatten!; @buf.empty?)
^^^^^^^^^
from /Users/tomoya/.rbenv/versions/3.2.0/lib/ruby/3.2.0/ripper/core.rb:19:in `parse'
from -:8:in `<main>'
Actions
Like0
Like0Like0Like0