summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2006-10-30 21:15:13 +0200
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-10-30 17:56:33 +0000
commit1a147d384ccafb1ee40180084a4533d35538bfd1 (patch)
tree71ee7f67a4a823191f0d707aa929687d6e5cc5b5 /regcomp.c
parent40d049e43280582bb162c511cc362c246f19862a (diff)
downloadperl-1a147d384ccafb1ee40180084a4533d35538bfd1.tar.gz
The second patch from:
Subject: [PATCH] regex engine optimiser should grok subroutine patterns, and, name subroutine regops more intuitively Message-ID: <9b18b3110610300915x3abf6cddu9c2071a70bea48e1@mail.gmail.com> p4raw-id: //depot/perl@29162
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/regcomp.c b/regcomp.c
index 8534b0c412..4e933a99a4 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -3521,12 +3521,12 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
if (data)
*(data->last_closep) = ARG(scan);
}
- else if (OP(scan) == RECURSE || OP(scan) == SRECURSE) {
+ else if (OP(scan) == GOSUB || OP(scan) == GOSTART) {
/* set the pointer */
I32 paren;
regnode *start;
regnode *end;
- if (OP(scan) == RECURSE) {
+ if (OP(scan) == GOSUB) {
paren = ARG(scan);
RExC_recurse[ARG2L(scan)] = scan;
start = RExC_open_parens[paren-1];
@@ -4745,7 +4745,7 @@ S_reg(pTHX_ RExC_state_t *pRExC_state, I32 paren, I32 *flagp,U32 depth)
case 'R' : /* (?R) */
if (*RExC_parse != ')')
FAIL("Sequence (?R) not terminated");
- ret = reg_node(pRExC_state, SRECURSE);
+ ret = reg_node(pRExC_state, GOSTART);
nextchar(pRExC_state);
return ret;
/*notreached*/
@@ -4772,7 +4772,7 @@ S_reg(pTHX_ RExC_state_t *pRExC_state, I32 paren, I32 *flagp,U32 depth)
vFAIL("Expecting close bracket");
gen_recurse_regop:
- ret = reganode(pRExC_state, RECURSE, num);
+ ret = reganode(pRExC_state, GOSUB, num);
if (!SIZE_ONLY) {
if (num > (I32)RExC_rx->nparens) {
RExC_parse++;
@@ -4936,7 +4936,7 @@ S_reg(pTHX_ RExC_state_t *pRExC_state, I32 paren, I32 *flagp,U32 depth)
SIZE_ONLY ? REG_RSN_RETURN_NULL : REG_RSN_RETURN_DATA);
parno = sv_dat ? *((I32 *)SvPVX(sv_dat)) : 0;
}
- ret = reganode(pRExC_state,RECURSEP,parno);
+ ret = reganode(pRExC_state,INSUBP,parno);
goto insert_if_check_paren;
}
else if (RExC_parse[0] >= '1' && RExC_parse[0] <= '9' ) {
@@ -7938,7 +7938,7 @@ Perl_regprop(pTHX_ const regexp *prog, SV *sv, const regnode *o)
Perl_sv_catpvf(aTHX_ sv, "[%d/%d]", o->flags & 0xf, o->flags>>4);
else if (k == REF || k == OPEN || k == CLOSE || k == GROUPP)
Perl_sv_catpvf(aTHX_ sv, "%d", (int)ARG(o)); /* Parenth number */
- else if (k == RECURSE)
+ else if (k == GOSUB)
Perl_sv_catpvf(aTHX_ sv, "%d[%+d]", (int)ARG(o),(int)ARG2L(o)); /* Paren and offset */
else if (k == LOGICAL)
Perl_sv_catpvf(aTHX_ sv, "[%d]", o->flags); /* 2: embedded, otherwise 1 */