From: "naruse (Yui NARUSE) via ruby-core" Date: 2023-02-07T06:14:28+00:00 Subject: [ruby-core:112254] [Ruby master Bug#19399] Ripper::Lexer.parse throws NoMethodError error for some input Issue #19399 has been updated by naruse (Yui NARUSE). Backport changed from 2.7: DONTNEED, 3.0: DONTNEED, 3.1: DONTNEED, 3.2: REQUIRED to 2.7: DONTNEED, 3.0: DONTNEED, 3.1: DONTNEED, 3.2: DONE ruby_3_2 7246cd0081ec845e1407484fca10439e7868880b merged revision(s) fad48fefe19cc282a5b209944244a3713359b47f. ---------------------------------------- Bug #19399: Ripper::Lexer.parse throws NoMethodError error for some input https://bugs.ruby-lang.org/issues/19399#change-101682 * Author: tompng (tomoya ishida) * Status: Closed * Priority: Normal * ruby -v: ruby 3.2.0 (2022-12-25 revision a528908271) [x86_64-darwin20] * Backport: 2.7: DONTNEED, 3.0: DONTNEED, 3.1: DONTNEED, 3.2: DONE ---------------------------------------- `Ripper::Lexer.parse` throws ``undefined method `flatten!' for nil:NilClass (NoMethodError)`` for this input ~~~ruby 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 `
' ~~~ -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/