Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
Psych::Parser#mark
parser.mark # => #<Psych::Parser::Mark>
ext/psych/psych_parser.c
View on GitHub ↗
static VALUE mark(VALUE self)
{
VALUE mark_klass;
VALUE args[3];
psych_parser_t * parser;
TypedData_Get_Struct(self, psych_parser_t, &psych_parser_type, parser);
mark_klass = rb_const_get_at(cPsychParser, rb_intern("Mark"));
args[0] = SIZET2NUM(parser->yaml_parser.mark.index);
args[1] = SIZET2NUM(parser->yaml_parser.mark.line);
args[2] = SIZET2NUM(parser->yaml_parser.mark.column);
return rb_class_new_instance(3, args, mark_klass);
}
Returns a Psych::Parser::Mark object that contains line, column, and index information.