End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Ripper#lineno
ripper.lineno → Integer
parse.c
View on GitHub ↗
static VALUE
ripper_lineno(VALUE self)
{
struct parser_params *p;
TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p);
if (!ripper_initialized_p(p)) {
rb_raise(rb_eArgError, "method called for uninitialized object");
}
if (NIL_P(p->parsing_thread)) return Qnil;
return INT2NUM(p->ruby_sourceline);
}
Return line number of current parsing line. This number starts from 1.