Skip to content

Ripper on 9.0.x.x reports wrong line number #3386

@yujinakayama

Description

@yujinakayama

Ripper on 9.0.x.x wrongly reports line number 2 for sexp or token at line 1.

[1] pry(main)> JRUBY_VERSION
=> "9.0.1.0"
[2] pry(main)> require 'ripper'
=> true
[3] pry(main)> Ripper.sexp('foo')
=> [:program, [[:vcall, [:@ident, "foo", [2, 0]]]]]
[4] pry(main)> Ripper.lex('foo')
=> [[[2, 0], :on_ident, "foo"]]

FYI Ripper on 1.7.22 correctly reports it as line 1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions