diff options
author | Yves Orton <demerphq@gmail.com> | 2010-08-26 13:53:07 +0200 |
---|---|---|
committer | Yves Orton <demerphq@gmail.com> | 2010-08-26 13:53:07 +0200 |
commit | c35dcbe240980301d3462300f3b790ccfbe52c24 (patch) | |
tree | 1580a2f6cfece9327c88f0dbfb86fe0b1c25bf05 /regexec.c | |
parent | d1c771f5a95fddf225347623798f65884aa6eee7 (diff) | |
download | perl-c35dcbe240980301d3462300f3b790ccfbe52c24.tar.gz |
eliminate unneeded code, and explain why the code was not needed
The commit message for v5.13.4-47-gd1c771f contained some misleading language
which I only noticed after I pushed. This change puts the comment in the
code and hopefully clarifies things properly.
In simple words: VERBS should *never* be included in the JUMPABLE condition.
Diffstat (limited to 'regexec.c')
-rw-r--r-- | regexec.c | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -245,7 +245,15 @@ /* TODO: Combine JUMPABLE and HAS_TEXT to cache OP(rn) */ /* for use after a quantifier and before an EXACT-like node -- japhy */ -/* it would be nice to rework regcomp.sym to generate this stuff. sigh */ +/* it would be nice to rework regcomp.sym to generate this stuff. sigh + * + * NOTE that *nothing* that affects backtracking should be in here, specifically + * VERBS must NOT be included. JUMPABLE is used to determine if we can ignore a + * node that is in between two EXACT like nodes when ascertaining what the required + * "follow" character is. This should probably be moved to regex compile time + * although it may be done at run time beause of the REF possibility - more + * investigation required. -- demerphq +*/ #define JUMPABLE(rn) ( \ OP(rn) == OPEN || \ (OP(rn) == CLOSE && (!cur_eval || cur_eval->u.eval.close_paren != ARG(rn))) || \ @@ -253,7 +261,6 @@ OP(rn) == SUSPEND || OP(rn) == IFMATCH || \ OP(rn) == PLUS || OP(rn) == MINMOD || \ OP(rn) == KEEPS || \ - /*(PL_regkind[OP(rn)] == VERB && OP(rn) != PRUNE && OP(rn) != COMMIT && OP(rn) != MARKPOINT && OP(rn) != SKIP && OP(rn) != CUTGROUP) || */\ (PL_regkind[OP(rn)] == CURLY && ARG1(rn) > 0) \ ) #define IS_EXACT(rn) (PL_regkind[OP(rn)] == EXACT) |