Actions
Bug #16687
closedRipper.slice FrozenError in ruby 2.5
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.5.6p201 (2019-08-28 revision 67793) [x86_64-linux]
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 = +''
Actions
Like0
Like0Like0