1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/ext/ripper
usa 209f345158 merge revision(s) 62743: [Backport #16687]
Fix FrozenError on `Ripper.slice`

	Currently `Ripper.slice` raises a FrozenError

	```ruby
	require 'ripper'
	p Ripper.slice('foo', 'ident')
	```

	```
	/path/to/g/lib/ruby/2.6.0/ripper/lexer.rb:193:in `concat': can't modify frozen String (FrozenError)
		from /path/to/g/lib/ruby/2.6.0/ripper/lexer.rb:193:in `block in compile'
		from /path/to/g/lib/ruby/2.6.0/ripper/lexer.rb:190:in `scan'
		from /path/to/g/lib/ruby/2.6.0/ripper/lexer.rb:190:in `compile'
		from /path/to/g/lib/ruby/2.6.0/ripper/lexer.rb:169:in `initialize'
		from /path/to/g/lib/ruby/2.6.0/ripper/lexer.rb:151:in `new'
		from /path/to/g/lib/ruby/2.6.0/ripper/lexer.rb:151:in `token_match'
		from /path/to/g/lib/ruby/2.6.0/ripper/lexer.rb:144:in `slice'
		from /tmp/tmp.kb4cnhvum2/test.rb:2:in `<main>'
	```

	This patch will fix the problem.

	[Fix GH-1837]

	From: Masataka Pocke Kuwabara <kuwabara@pocke.me>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2020-03-30 22:44:13 +00:00
..
lib merge revision(s) 62743: [Backport #16687] 2020-03-30 22:44:13 +00:00
tools ripper: add states of scanner 2017-09-14 10:53:47 +00:00
depend VPATH for ripper 2017-07-14 10:31:05 +00:00
eventids2.c Rename DOTQ to ANDDOT 2015-11-10 09:42:27 +00:00
extconf.rb {ext,test}/ripper: Specify frozen_string_literal: true. 2017-02-05 07:54:32 +00:00
README

Ripper README
=============

  Ripper is a Ruby script parser.  You can get information
  by event-based style from the parser.

  !! WARNING !!

  Ripper is still early-alpha version.
  I never assure any kind of backward compatibility.

Requirements
------------

  * ruby 1.9 (support CVS HEAD only)
  * bison 1.28 or later (Other yaccs do not work)

Usage
-----

  See test/ripper/* and sample/ripper/*.

License
-------

  Ruby License.

                                                Minero Aoki
                                        aamine@loveruby.net
                                      http://i.loveruby.net