New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ripper.sexp unexpectedly returns nil when given source includes keyword-ish symbol #4562

Closed
yujinakayama opened this Issue Apr 18, 2017 · 0 comments

Comments

Projects
None yet
2 participants
@yujinakayama

yujinakayama commented Apr 18, 2017

On JRuby 9.x.x.x Ripper.sexp unexpectedly returns nil when given source includes keyword-ish symbol such as :if and :unless (not sure if there're any more).

Environment

$ jruby --version
jruby 9.1.8.0 (2.3.1) 2017-03-06 90fc7ab Java HotSpot(TM) 64-Bit Server VM 25.25-b02 on 1.8.0_25-b17 +jit [darwin-x86_64]
$ uname -a
Darwin macbookpro.local 16.5.0 Darwin Kernel Version 16.5.0: Fri Mar  3 16:52:33 PST 2017; root:xnu-3789.51.2~3/RELEASE_X86_64 x86_64

Expected Behavior

Ripper.sexp should return an array for source including :if, as MRI does:

$ ruby --version
ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin16]
$ irb
irb(main):001:0> require 'ripper'
=> true
irb(main):002:0> Ripper.sexp(':if')
=> [:program, [[:symbol_literal, [:symbol, [:@kw, "if", [1, 1]]]]]]

Actual Behavior

Ripper.sexp returns nil for source including :if:

$ irb
irb(main):001:0> JRUBY_VERSION
=> "9.1.8.0"
irb(main):002:0> RUBY_VERSION
=> "2.3.1"
irb(main):003:0> require 'ripper'
=> true
irb(main):004:0> Ripper.sexp(':if')
=> nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment