Skip to content

Ripper provides incorrect output #6413

@kddnewton

Description

@kddnewton

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions