mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* parse.y (reg_compile_gen): reg_fragment_setenc might not raise an
exception before rb_reg_compile. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15479 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
ab3e8e6143
commit
04e7cc6411
2 changed files with 12 additions and 3 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Fri Feb 15 09:44:11 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* parse.y (reg_compile_gen): reg_fragment_setenc might not raise an
|
||||||
|
exception before rb_reg_compile.
|
||||||
|
|
||||||
Fri Feb 15 07:37:40 2008 Eric Hodel <drbrain@segment7.net>
|
Fri Feb 15 07:37:40 2008 Eric Hodel <drbrain@segment7.net>
|
||||||
|
|
||||||
* lib/rdoc/ri/paths.rb: Preserve compatibility with 1.8.
|
* lib/rdoc/ri/paths.rb: Preserve compatibility with 1.8.
|
||||||
|
|
10
parse.y
10
parse.y
|
@ -8655,10 +8655,14 @@ reg_compile_gen(struct parser_params* parser, VALUE str, int options)
|
||||||
re = rb_reg_compile(str, options & RE_OPTION_MASK);
|
re = rb_reg_compile(str, options & RE_OPTION_MASK);
|
||||||
if (NIL_P(re)) {
|
if (NIL_P(re)) {
|
||||||
ID mesg = rb_intern("mesg");
|
ID mesg = rb_intern("mesg");
|
||||||
VALUE m = rb_attr_get(err, mesg);
|
VALUE m = rb_attr_get(rb_errinfo(), mesg);
|
||||||
rb_str_cat(m, "\n", 1);
|
|
||||||
rb_str_append(m, rb_attr_get(rb_errinfo(), mesg));
|
|
||||||
rb_set_errinfo(err);
|
rb_set_errinfo(err);
|
||||||
|
if (!NIL_P(err)) {
|
||||||
|
rb_str_append(rb_str_cat(rb_attr_get(err, mesg), "\n", 1), m);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
compile_error(PARSER_ARG "%s", RSTRING_PTR(m));
|
||||||
|
}
|
||||||
return Qnil;
|
return Qnil;
|
||||||
}
|
}
|
||||||
return re;
|
return re;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue