diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-10-04 09:54:33 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-10-04 09:54:33 -0700 |
commit | 64f27edacf6adda4b58406ef9f073c147465e077 (patch) | |
tree | b5acbccaec68403deb53c96f7805250b683d99df /ext/psych | |
parent | 7e42272564ea26c9e1cd57e7d872256de848a15d (diff) | |
download | psych-64f27edacf6adda4b58406ef9f073c147465e077.tar.gz |
Using context_mark from the parser struct for accuruate line / column
offsets during an exception.
Diffstat (limited to 'ext/psych')
-rw-r--r-- | ext/psych/parser.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/psych/parser.c b/ext/psych/parser.c index e68768f..f3928a9 100644 --- a/ext/psych/parser.c +++ b/ext/psych/parser.c @@ -99,8 +99,8 @@ static VALUE parse(VALUE self, VALUE yaml) while(!done) { if(!yaml_parser_parse(parser, &event)) { VALUE path; - size_t line = parser->mark.line; - size_t column = parser->mark.column; + size_t line = parser->context_mark.line + 1; + size_t column = parser->context_mark.column + 1; if(rb_respond_to(yaml, id_path)) path = rb_funcall(yaml, id_path, 0); |