summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-12-04 17:50:51 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-12-04 17:50:51 +0000
commit6d5c990f28c2a18264defef032a496e2e3dfb7cd (patch)
tree23cbcbd365bbc2e293a764976cdc9f1d9ec506af /regcomp.c
parent3c6f95d1b67124c82147911f846eb1993443a39a (diff)
downloadperl-6d5c990f28c2a18264defef032a496e2e3dfb7cd.tar.gz
Better version of last patch, by Yves Orton.
Actually the regexp engine structure only needs one compilation function hook. p4raw-id: //depot/perl@29459
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/regcomp.c b/regcomp.c
index 7e77e77dbe..b7510a9196 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -3965,20 +3965,18 @@ Perl_reginitcolors(pTHX)
extern const struct regexp_engine my_reg_engine;
#define RE_ENGINE_PTR &my_reg_engine
#endif
-
+
+#ifndef PERL_IN_XSUB_RE
regexp *
Perl_pregcomp(pTHX_ char *exp, char *xend, PMOP *pm)
{
dVAR;
- GET_RE_DEBUG_FLAGS_DECL;
- DEBUG_r(if (!PL_colorset) reginitcolors());
-#ifndef PERL_IN_XSUB_RE
- {
+ HV * const table = GvHV(PL_hintgv);
/* Dispatch a request to compile a regexp to correct
regexp engine. */
- HV * const table = GvHV(PL_hintgv);
if (table) {
SV **ptr= hv_fetchs(table, "regcomp", FALSE);
+ GET_RE_DEBUG_FLAGS_DECL;
if (ptr && SvIOK(*ptr) && SvIV(*ptr)) {
const regexp_engine *eng=INT2PTR(regexp_engine*,SvIV(*ptr));
DEBUG_COMPILE_r({
@@ -3988,10 +3986,9 @@ Perl_pregcomp(pTHX_ char *exp, char *xend, PMOP *pm)
return CALLREGCOMP_ENG(eng, exp, xend, pm);
}
}
- }
-#endif
return Perl_re_compile(aTHX_ exp, xend, pm);
}
+#endif
regexp *
Perl_re_compile(pTHX_ char *exp, char *xend, PMOP *pm)
@@ -4013,6 +4010,8 @@ Perl_re_compile(pTHX_ char *exp, char *xend, PMOP *pm)
RExC_state_t copyRExC_state;
#endif
GET_RE_DEBUG_FLAGS_DECL;
+ DEBUG_r(if (!PL_colorset) reginitcolors());
+
if (exp == NULL)
FAIL("NULL regexp argument");