summaryrefslogtreecommitdiff
path: root/regparse.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-08-30 08:00:31 (GMT)
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-08-30 08:00:31 (GMT)
commit6ab36c6e191001316bf94c884e5f0fefc43499ef (patch)
tree0fc15ba43d2566b5b1c40d49f5fe3e3d78bdbd6d /regparse.c
parent2a12798d5896788a6032a9eb9efbe236e3713881 (diff)
*regparse.c (CC_DUP_WARN): use rb_compile_warn if ScanEnv has source
information. [ruby-dev:39105] *re.c (rb_reg_compile): add sourcefile and sourceline to the arguments. *re.c (make_regexp): ditto. *re.c (rb_reg_initialize): ditto. *re.c (rb_reg_initialize_str): ditto. *re.c (rb_reg_compile): ditto. *regcomp.c (onig_compile): ditto. *regint.h (onig_compile): ditto. *re.c (reg_compile_gen): follow above. *re.c (rb_reg_to_s): ditto. *re.c (make_regexp): ditto. *re.c (rb_reg_initialize): ditto. *re.c (rb_reg_initialize_str): ditto. *re.c (rb_reg_new_str): ditto. *re.c (rb_enc_reg_new): ditto. *re.c (rb_reg_initialize_m): ditto. *re.c (rb_reg_init_copy): ditto. *regcomp.c (onig_new): ditto. *regcomp.c (onig_compile): set sourcefile and sourceline to scan_env. *regparse.h (ScanEnv): add sourcefile and sourceline. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'regparse.c')
-rw-r--r--regparse.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/regparse.c b/regparse.c
index 0311052..bb4e47a 100644
--- a/regparse.c
+++ b/regparse.c
@@ -2877,7 +2877,11 @@ CC_DUP_WARN(ScanEnv *env)
onig_snprintf_with_pattern(buf, WARN_BUFSIZE, env->enc,
env->pattern, env->pattern_end,
(UChar* )"character class has duplicated range");
- (*onig_warn)((char* )buf);
+
+ if (env->sourcefile == NULL)
+ (*onig_warn)((char* )buf);
+ else
+ rb_compile_warn(env->sourcefile, env->sourceline, (char* )buf);
}
}