Project

General

Profile

Bug #16687

Ripper.slice FrozenError in ruby 2.5

Added by Dan0042 (Daniel DeLorme) 4 months ago. Updated 3 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.5.6p201 (2019-08-28 revision 67793) [x86_64-linux]
[ruby-core:97447]

Description

Trying the example from the Ripper.slice documentation:

require 'ripper'
p Ripper.slice('def m(a) nil end', 'ident')  
#=> /opt/ruby/2.5/lib/ruby/2.5.0/ripper/lexer.rb:199:in `concat': can't modify frozen String (FrozenError)

Just needs to change lexer.rb:195 from buf = '' to buf = +''

Updated by jeremyevans0 (Jeremy Evans) 4 months ago

  • Backport changed from 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN to 2.5: REQUIRED, 2.6: DONTNEED, 2.7: DONTNEED
  • Status changed from Open to Closed

This is the related commit for backporting: 67bb95936d241bd452f3bcfb76276e0ab61234f0.

Note that Ruby 2.5 will be moving from the normal maintenance phase to the security maintenance phase in about 4 days.

Updated by usa (Usaku NAKAMURA) 3 months ago

  • Backport changed from 2.5: REQUIRED, 2.6: DONTNEED, 2.7: DONTNEED to 2.5: DONE, 2.6: DONTNEED, 2.7: DONTNEED

ruby_2_5 r67871 merged revision(s) 62743.

Also available in: Atom PDF