diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-18 05:05:36 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-18 05:05:36 +0000 |
commit | 3f025d2078157e895fdcf77e31bfe62351bf90b4 (patch) | |
tree | 886cb636611df665bbb7dbf1b62983b8ce1ec3a4 /parse.y | |
parent | 42cf6ee7530e312288ff78236f552e1b6d5ca341 (diff) |
* parse.y (reg_compile_gen): obtain error info from errinfo.
* re.c (rb_reg_error_desc): make RegexpError for initialization error.
* re.c (rb_reg_compile): return nil and set errinfo if error.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -8115,7 +8115,8 @@ reg_compile_gen(struct parser_params* parser, const char *ptr, long len, int opt VALUE rb_reg_compile(const char *, long, int); VALUE re = rb_reg_compile(ptr, len, (options) & ~RE_OPTION_ONCE); - if (TYPE(re) == T_STRING) { + if (NIL_P(re)) { + RB_GC_GUARD(re) = rb_obj_as_string(rb_errinfo()); compile_error(PARSER_ARG "%s", RSTRING_PTR(re)); return Qnil; } |