From 6ab36c6e191001316bf94c884e5f0fefc43499ef Mon Sep 17 00:00:00 2001 From: naruse Date: Sun, 30 Aug 2009 08:00:31 +0000 Subject: *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 --- regcomp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'regcomp.c') diff --git a/regcomp.c b/regcomp.c index a7346d3d8e..caf7d69a1e 100644 --- a/regcomp.c +++ b/regcomp.c @@ -5351,7 +5351,7 @@ static void print_tree P_((FILE* f, Node* node)); extern int onig_compile(regex_t* reg, const UChar* pattern, const UChar* pattern_end, - OnigErrorInfo* einfo) + OnigErrorInfo* einfo, const char *sourcefile, int sourceline) { #define COMPILE_INIT_SIZE 20 @@ -5362,6 +5362,8 @@ onig_compile(regex_t* reg, const UChar* pattern, const UChar* pattern_end, UnsetAddrList uslist; #endif + scan_env.sourcefile = sourcefile; + scan_env.sourceline = sourceline; reg->state = ONIG_STATE_COMPILING; #ifdef ONIG_DEBUG @@ -5616,7 +5618,7 @@ onig_new(regex_t** reg, const UChar* pattern, const UChar* pattern_end, enc, syntax); if (r) return r; - r = onig_compile(*reg, pattern, pattern_end, einfo); + r = onig_compile(*reg, pattern, pattern_end, einfo, NULL, 0); if (r) { onig_free(*reg); *reg = NULL; -- cgit v1.2.1