Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Using context_mark from the parser struct for accuruate line / column

offsets during an exception.
  • Loading branch information...
commit 64f27edacf6adda4b58406ef9f073c147465e077 1 parent 7e42272
Aaron Patterson authored
Showing with 7 additions and 2 deletions.
  1. +5 −0 CHANGELOG.rdoc
  2. +2 −2 ext/psych/parser.c
5 CHANGELOG.rdoc
View
@@ -1,3 +1,8 @@
+Wed Oct 5 01:52:16 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/parser.c (parse): Use context_mark for indicating error
+ line and column.
+
Tue Oct 4 06:29:55 2011 Aaron Patterson <aaron@tenderlovemaking.com>
* ext/psych/lib/psych.rb: calling `yaml` rather than `to_yaml`.
4 ext/psych/parser.c
View
@@ -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);
Please sign in to comment.
Something went wrong with that request. Please try again.