From 2a5d9b1d41e4bafaa26126c5dea2f6ff0b72b6a7 Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Mon, 4 Dec 2006 16:24:09 +0000 Subject: [PATCH] Actually submit previous change. p4raw-id: //depot/perl@29457 --- embed.fnc | 1 + embed.h | 2 ++ global.sym | 1 + proto.h | 5 +++++ regcomp.c | 18 ++++++++++-------- 5 files changed, 19 insertions(+), 8 deletions(-) diff --git a/embed.fnc b/embed.fnc index 1b9b5a4..4e8e2a4 100644 --- a/embed.fnc +++ b/embed.fnc @@ -675,6 +675,7 @@ Ap |char * |reg_stringify |NN MAGIC *mg|NULLOK STRLEN *lp|NULLOK U32 *flags|NUL Ap |void* |regdupe_internal|NN const regexp* r|NN CLONE_PARAMS* param #endif Ap |regexp*|pregcomp |NN char* exp|NN char* xend|NN PMOP* pm +Ap |regexp*|re_compile |NN char* exp|NN char* xend|NN PMOP* pm Ap |char* |re_intuit_start|NN regexp* prog|NULLOK SV* sv|NN char* strpos \ |NN char* strend|U32 flags \ |NULLOK struct re_scream_pos_data_s *data diff --git a/embed.h b/embed.h index 5c6930f..5493bfa 100644 --- a/embed.h +++ b/embed.h @@ -686,6 +686,7 @@ #define regdupe_internal Perl_regdupe_internal #endif #define pregcomp Perl_pregcomp +#define re_compile Perl_re_compile #define re_intuit_start Perl_re_intuit_start #define re_intuit_string Perl_re_intuit_string #define regexec_flags Perl_regexec_flags @@ -2897,6 +2898,7 @@ #define regdupe_internal(a,b) Perl_regdupe_internal(aTHX_ a,b) #endif #define pregcomp(a,b,c) Perl_pregcomp(aTHX_ a,b,c) +#define re_compile(a,b,c) Perl_re_compile(aTHX_ a,b,c) #define re_intuit_start(a,b,c,d,e,f) Perl_re_intuit_start(aTHX_ a,b,c,d,e,f) #define re_intuit_string(a) Perl_re_intuit_string(aTHX_ a) #define regexec_flags(a,b,c,d,e,f,g,h) Perl_regexec_flags(aTHX_ a,b,c,d,e,f,g,h) diff --git a/global.sym b/global.sym index e69d181..c50db9e 100644 --- a/global.sym +++ b/global.sym @@ -390,6 +390,7 @@ Perl_regfree_internal Perl_reg_stringify Perl_regdupe_internal Perl_pregcomp +Perl_re_compile Perl_re_intuit_start Perl_re_intuit_string Perl_regexec_flags diff --git a/proto.h b/proto.h index 4f8edf4..a0d3b95 100644 --- a/proto.h +++ b/proto.h @@ -1851,6 +1851,11 @@ PERL_CALLCONV regexp* Perl_pregcomp(pTHX_ char* exp, char* xend, PMOP* pm) __attribute__nonnull__(pTHX_2) __attribute__nonnull__(pTHX_3); +PERL_CALLCONV regexp* Perl_re_compile(pTHX_ char* exp, char* xend, PMOP* pm) + __attribute__nonnull__(pTHX_1) + __attribute__nonnull__(pTHX_2) + __attribute__nonnull__(pTHX_3); + PERL_CALLCONV char* Perl_re_intuit_start(pTHX_ regexp* prog, SV* sv, char* strpos, char* strend, U32 flags, struct re_scream_pos_data_s *data) __attribute__nonnull__(pTHX_1) __attribute__nonnull__(pTHX_3) diff --git a/regcomp.c b/regcomp.c index 4ea9a5a..7e77e77 100644 --- a/regcomp.c +++ b/regcomp.c @@ -3965,9 +3965,6 @@ Perl_reginitcolors(pTHX) extern const struct regexp_engine my_reg_engine; #define RE_ENGINE_PTR &my_reg_engine #endif -/* these make a few things look better, to avoid indentation */ -#define BEGIN_BLOCK { -#define END_BLOCK } regexp * Perl_pregcomp(pTHX_ char *exp, char *xend, PMOP *pm) @@ -3976,7 +3973,7 @@ Perl_pregcomp(pTHX_ char *exp, char *xend, PMOP *pm) GET_RE_DEBUG_FLAGS_DECL; DEBUG_r(if (!PL_colorset) reginitcolors()); #ifndef PERL_IN_XSUB_RE - BEGIN_BLOCK + { /* Dispatch a request to compile a regexp to correct regexp engine. */ HV * const table = GvHV(PL_hintgv); @@ -3991,9 +3988,15 @@ Perl_pregcomp(pTHX_ char *exp, char *xend, PMOP *pm) return CALLREGCOMP_ENG(eng, exp, xend, pm); } } - END_BLOCK + } #endif - BEGIN_BLOCK + return Perl_re_compile(aTHX_ exp, xend, pm); +} + +regexp * +Perl_re_compile(pTHX_ char *exp, char *xend, PMOP *pm) +{ + dVAR; register regexp *r; register regexp_internal *ri; regnode *scan; @@ -4009,6 +4012,7 @@ Perl_pregcomp(pTHX_ char *exp, char *xend, PMOP *pm) int restudied= 0; RExC_state_t copyRExC_state; #endif + GET_RE_DEBUG_FLAGS_DECL; if (exp == NULL) FAIL("NULL regexp argument"); @@ -4594,11 +4598,9 @@ reStudy: PerlIO_printf(Perl_debug_log, "\n"); }); return(r); - END_BLOCK } #undef CORE_ONLY_BLOCK -#undef END_BLOCK #undef RE_ENGINE_PTR #ifndef PERL_IN_XSUB_RE -- 2.7.4