summaryrefslogtreecommitdiff
path: root/regcomp.h
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2007-01-14 16:24:25 +0100
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-01-16 10:56:46 +0000
commit7122b2379657de1172884989d9029d9ca5b331a1 (patch)
tree17f78a265af81696916c5668b8188565c3f61e2e /regcomp.h
parent80c2be14678bad322b7e756a7342a3a0cb7ac8b0 (diff)
downloadperl-7122b2379657de1172884989d9029d9ca5b331a1.tar.gz
Make offsets support conditional
Message-ID: <9b18b3110701140624v452f7684x5e9d2890805489fd@mail.gmail.com> p4raw-id: //depot/perl@29842
Diffstat (limited to 'regcomp.h')
-rw-r--r--regcomp.h17
1 files changed, 14 insertions, 3 deletions
diff --git a/regcomp.h b/regcomp.h
index d4a5001c30..83a72d0fa6 100644
--- a/regcomp.h
+++ b/regcomp.h
@@ -23,6 +23,11 @@ typedef OP OP_4tree; /* Will be redefined later. */
/* Not for production use: */
#define PERL_ENABLE_EXPERIMENTAL_REGEX_OPTIMISATIONS 0
+/* Activate offsets code - set to if 1 to enable */
+#ifdef DEBUGGING
+#define RE_TRACK_PATTERN_OFFSETS
+#endif
+
/* Unless the next line is uncommented it is illegal to combine lazy
matching with possessive matching. Frankly it doesn't make much sense
to allow it as X*?+ matches nothing, X+?+ matches a single char only,
@@ -104,9 +109,15 @@ typedef struct regexp_paren_ofs {
typedef struct regexp_internal {
int name_list_idx; /* Optional data index of an array of paren names */
- U32 *offsets; /* offset annotations 20001228 MJD
- data about mapping the program to the
- string*/
+ union {
+ U32 *offsets; /* offset annotations 20001228 MJD
+ data about mapping the program to the
+ string -
+ offsets[0] is proglen when this is used
+ */
+ U32 proglen;
+ } u;
+
regexp_paren_ofs *swap; /* Swap copy of *startp / *endp */
regnode *regstclass; /* Optional startclass as identified or constructed
by the optimiser */