Open biinari opened 8 years ago
Ouch--I didn't realize Ripper::Lexer
was intended for internal use only. When I did the 1.0.0 release I really wanted to rely on stdlib ruby for tailor (as opposed to relying on a gem), and ripper was 100% new to me, without much documentation to go by at the time. In any case... @biinari would you be interested in making a PR? Admittedly I haven't been using tailor much since my team has adopted rubocop in recent years. I'd be happy to make a release if you'd be open to making the changes.
It is odd that the part that provides event based parsing has been changed and it seems poorly documented. I don't use tailor either but came across this when looking at an issue with busser-serverspec. We also use rubocop for our own projects.
I'm not going to spend the time on this now but if there is anybody who does use tailor and wants it to be made compatible with Ruby 2.3, this should be a useful starting point.
That sounds totally reasonable. Thanks a ton for taking the time to log this, @biinari !
https://github.com/ruby/ruby/commit/9a28a29b870b5f45d370bc8f16c431b435f0bbb3 commited for Ruby feature 9098 changes the elements passed in parser events from an
Array
toRipper::Lexer::Elem
(aStruct
).It seems that
Ripper::Lexer
is documented as being for internal use only, so backwards compatibility is evidently not being worried about there.I'm thinking that the simplest solution could be to use
[0]
and[2]
in place of.first
and.last
respectively.