summaryrefslogtreecommitdiff
path: root/regexp.h
diff options
context:
space:
mode:
authorIlya Zakharevich <ilya@math.berkeley.edu>1999-05-24 22:42:23 -0400
committerGurusamy Sarathy <gsar@cpan.org>1999-05-25 09:14:51 +0000
commitcf93c79d660ae36ccc5f83d949c599473fc522ce (patch)
tree990c1003b82a9b439144bee4075daab1ba3d13d9 /regexp.h
parenta99f88279527854d73f6b517b869d613f02be3d1 (diff)
downloadperl-cf93c79d660ae36ccc5f83d949c599473fc522ce.tar.gz
REx engine improvements
Message-Id: <199905250642.CAA06208@monk.mps.ohio-state.edu> p4raw-id: //depot/perl@3475
Diffstat (limited to 'regexp.h')
-rw-r--r--regexp.h42
1 files changed, 29 insertions, 13 deletions
diff --git a/regexp.h b/regexp.h
index b1170f1e06..9da5bd47e0 100644
--- a/regexp.h
+++ b/regexp.h
@@ -34,20 +34,9 @@ struct reg_substr_data {
};
typedef struct regexp {
- I32 refcnt;
- char **startp;
- char **endp;
+ I32 *startp;
+ I32 *endp;
regnode *regstclass;
- I32 minlen; /* mininum possible length of $& */
- I32 prelen; /* length of precomp */
- U32 nparens; /* number of parentheses */
- U32 lastparen; /* last paren matched */
- char *precomp; /* pre-compilation regular expression */
- char *subbase; /* saved string so \digit works forever */
- char *subbeg; /* same, but not responsible for allocation */
- char *subend; /* end of subbase */
- U32 reganch; /* Internal use only +
- Tainted information used by regexec? */
#if 0
SV *anchored_substr; /* Substring at fixed position wrt start. */
I32 anchored_offset; /* Position of it. */
@@ -60,7 +49,18 @@ typedef struct regexp {
#else
struct reg_substr_data *substrs;
#endif
+ char *precomp; /* pre-compilation regular expression */
struct reg_data *data; /* Additional data. */
+ char *subbeg; /* saved or original string
+ so \digit works forever. */
+ I32 sublen; /* Length of string pointed by subbeg */
+ I32 refcnt;
+ I32 minlen; /* mininum possible length of $& */
+ I32 prelen; /* length of precomp */
+ U32 nparens; /* number of parentheses */
+ U32 lastparen; /* last paren matched */
+ U32 reganch; /* Internal use only +
+ Tainted information used by regexec? */
regnode program[1]; /* Unwarranted chumminess with compiler. */
} regexp;
@@ -92,6 +92,7 @@ typedef struct regexp {
#define ROPT_UTF8 0x10000
#define ROPT_NAUGHTY 0x20000 /* how exponential is this pattern? */
+#define ROPT_COPY_DONE 0x40000 /* subbeg is a copy of the string */
#define RX_MATCH_TAINTED(prog) ((prog)->reganch & ROPT_TAINTED_SEEN)
#define RX_MATCH_TAINTED_on(prog) ((prog)->reganch |= ROPT_TAINTED_SEEN)
@@ -100,10 +101,25 @@ typedef struct regexp {
? RX_MATCH_TAINTED_on(prog) \
: RX_MATCH_TAINTED_off(prog))
+#define RX_MATCH_COPIED(prog) ((prog)->reganch & ROPT_COPY_DONE)
+#define RX_MATCH_COPIED_on(prog) ((prog)->reganch |= ROPT_COPY_DONE)
+#define RX_MATCH_COPIED_off(prog) ((prog)->reganch &= ~ROPT_COPY_DONE)
+#define RX_MATCH_COPIED_set(prog,t) ((t) \
+ ? RX_MATCH_COPIED_on(prog) \
+ : RX_MATCH_COPIED_off(prog))
+
#define REXEC_COPY_STR 1 /* Need to copy the string. */
#define REXEC_CHECKED 2 /* check_substr already checked. */
#define REXEC_SCREAM 4 /* use scream table. */
#define REXEC_IGNOREPOS 8 /* \G matches at start. */
+#define REXEC_NOT_FIRST 0x10 /* This is another iteration of //g. */
#define ReREFCNT_inc(re) ((re && re->refcnt++), re)
#define ReREFCNT_dec(re) pregfree(re)
+
+#define FBMcf_TAIL_DOLLAR 1
+#define FBMcf_TAIL_Z 2
+#define FBMcf_TAIL_z 4
+#define FBMcf_TAIL (FBMcf_TAIL_DOLLAR|FBMcf_TAIL_Z|FBMcf_TAIL_z)
+
+#define FBMrf_MULTILINE 1