1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

syntax error can move, so do not cache

This commit is contained in:
Aaron Patterson 2019-04-23 15:16:17 -07:00
parent 75061f46ae
commit 19d454a957
No known key found for this signature in database
GPG key ID: 953170BCB4FFAFC6

View file

@ -1,7 +1,6 @@
#include <psych.h>
VALUE cPsychParser;
VALUE ePsychSyntaxError;
static ID id_read;
static ID id_path;
@ -85,6 +84,8 @@ static VALUE make_exception(yaml_parser_t * parser, VALUE path)
line = parser->context_mark.line + 1;
column = parser->context_mark.column + 1;
VALUE ePsychSyntaxError = rb_const_get(mPsych, rb_intern("SyntaxError"));
return rb_funcall(ePsychSyntaxError, rb_intern("new"), 6,
path,
INT2NUM(line),
@ -569,7 +570,6 @@ void Init_psych_parser(void)
rb_define_const(cPsychParser, "UTF16BE", INT2NUM(YAML_UTF16BE_ENCODING));
rb_require("psych/syntax_error");
ePsychSyntaxError = rb_const_get(mPsych, rb_intern("SyntaxError"));
rb_define_method(cPsychParser, "parse", parse, -1);
rb_define_method(cPsychParser, "mark", mark, 0);