Skip to content
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 provides incorrect output #6413

Closed
kddnewton opened this issue Sep 25, 2020 · 2 comments
Closed

Ripper provides incorrect output #6413

kddnewton opened this issue Sep 25, 2020 · 2 comments

Comments

@kddnewton
Copy link

kddnewton commented Sep 25, 2020

Environment Information

jruby 9.2.8.0 (2.5.3) 2019-08-12 a1ac7ff OpenJDK 64-Bit Server VM 25.265-b01 on 1.8.0_265-b01 +jit [darwin-x86_64]
Darwin 19.4.0 Darwin Kernel Version 19.4.0: root:xnu-6153.101.6~15/RELEASE_X86_64 x86_64

Expected Behavior

$ ruby -rripper -e "pp Ripper.sexp('1 < 2')"
[:program, [[:binary, [:@int, "1", [1, 0]], :<, [:@int, "2", [1, 4]]]]]

Actual Behavior

$ jruby -rripper -e "pp Ripper.sexp('1 < 2')"
[:program, [[:binary, [:@int, "1", [1, 0]], :>, [:@int, "2", [1, 4]]]]]

Coming from prettier/plugin-ruby#639. I need the actual original comparison operator to print out correctly, but it's giving what I assume is an optimized version.

@headius
Copy link
Member

headius commented Sep 25, 2020

Still broken on master on in 9.2.13.0.

$ rvm jruby-9.2.13.0 do jruby -rripper -e "pp Ripper.sexp('1 < 2')"
[:program, [[:binary, [:@int, "1", [1, 0]], :>, [:@int, "2", [1, 4]]]]]

@enebo enebo added this to the JRuby 9.2.14.0 milestone Sep 25, 2020
@enebo
Copy link
Member

enebo commented Sep 25, 2020

This is a typo in our grammar. All relops get reported as > instead of <,>=, <=.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants