summaryrefslogtreecommitdiff
path: root/regnodes.h
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2023-01-08 15:49:04 +0100
committerYves Orton <demerphq@gmail.com>2023-01-19 18:44:49 +0800
commitc224bbd5d135fe48f49b4cc25f10a4977d695145 (patch)
tree5909b6fd666bb025496824a3f8c67715643164a8 /regnodes.h
parent09b3a407e87f128d7aecd14f9c8d75dcff9aaaf8 (diff)
downloadperl-c224bbd5d135fe48f49b4cc25f10a4977d695145.tar.gz
regcomp.c - add optimistic eval (*{ ... }) and (**{ ... })
This adds (*{ ... }) and (**{ ... }) as equivalents to (?{ ... }) and (??{ ... }). The only difference being that the star variants are "optimisitic" and are defined to never disable optimisations. This is especially relevant now that use of (?{ ... }) prevents important optimisations anywhere in the pattern, instead of the older and inconsistent rules where it only affected the parts that contained the EVAL. It is also very useful for injecting debugging style expressions to the pattern to understand what the regex engine is actually doing. The older style (?{ ... }) variants would change the regex engines behavior, meaning this was not as effective a tool as it could have been. Similarly it is now possible to test that a given regex optimisation works correctly using (*{ ... }), which was not possible with (?{ ... }).
Diffstat (limited to 'regnodes.h')
-rw-r--r--regnodes.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/regnodes.h b/regnodes.h
index 5275da64b3..7000a0988e 100644
--- a/regnodes.h
+++ b/regnodes.h
@@ -2876,11 +2876,12 @@ EXTCONST char * const PL_reg_intflags_name[] = {
"ANCH_SBOL", /* (1<<11) - 0x00000800 - PREGf_ANCH_SBOL */
"ANCH_GPOS", /* (1<<12) - 0x00001000 - PREGf_ANCH_GPOS */
"RECURSE_SEEN", /* (1<<13) - 0x00002000 - PREGf_RECURSE_SEEN */
+ "PESSIMIZE_SEEN", /* (1<<14) - 0x00004000 - PREGf_PESSIMIZE_SEEN */
};
#endif /* DOINIT */
#ifdef DEBUGGING
-# define REG_INTFLAGS_NAME_SIZE 14
+# define REG_INTFLAGS_NAME_SIZE 15
#endif
/* The following have no fixed length. U8 so we can do strchr() on it. */