summaryrefslogtreecommitdiff
path: root/regexp.h
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2008-01-05 13:54:38 +0000
committerNicholas Clark <nick@ccl4.org>2008-01-05 13:54:38 +0000
commitefd26800e76b6f876fd6abe3a3f7e3e4128150a9 (patch)
tree3cee09b657aa4fbb21fef6d06429fb5c40ada62c /regexp.h
parent5a51db0500cb91f11a554807ca60350bc43f0e5b (diff)
downloadperl-efd26800e76b6f876fd6abe3a3f7e3e4128150a9.tar.gz
Add RX_UTF8(), which is effectively SvUTF8() but for regexps.
Remove RXp_PRECOMP() and RXp_WRAPPED(). Change the parameter of S_debug_start_match() from regexp to REGEXP. Change its callers [the only part wrong for 5.10.x] p4raw-id: //depot/perl@32840
Diffstat (limited to 'regexp.h')
-rw-r--r--regexp.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/regexp.h b/regexp.h
index 1a2b17c1a3..f76a8eafff 100644
--- a/regexp.h
+++ b/regexp.h
@@ -358,19 +358,17 @@ and check for NULL.
? RX_MATCH_COPIED_on(prog) \
: RX_MATCH_COPIED_off(prog))
-#define RXp_PRECOMP(rx) ((rx)->wrapped + (rx)->pre_prefix)
/* FIXME? Are we hardcoding too much here and constraining plugin extension
writers? Specifically, the value 1 assumes that the wrapped version always
has exactly one character at the end, a ')'. Will that always be true? */
#define RXp_PRELEN(rx) ((rx)->wraplen - (rx)->pre_prefix - 1)
-#define RXp_WRAPPED(rx) ((rx)->wrapped)
#define RXp_WRAPLEN(rx) ((rx)->wraplen)
#define RXp_EXTFLAGS(rx) ((rx)->extflags)
/* For source compatibility. We used to store these explicitly. */
-#define RX_PRECOMP(prog) RXp_PRECOMP((struct regexp *)SvANY(prog))
+#define RX_PRECOMP(prog) (((struct regexp *)SvANY(prog))->wrapped + ((struct regexp *)SvANY(prog))->pre_prefix)
#define RX_PRELEN(prog) RXp_PRELEN((struct regexp *)SvANY(prog))
-#define RX_WRAPPED(prog) RXp_WRAPPED((struct regexp *)SvANY(prog))
+#define RX_WRAPPED(prog) (((struct regexp *)SvANY(prog))->wrapped)
#define RX_WRAPLEN(prog) RXp_WRAPLEN((struct regexp *)SvANY(prog))
#define RX_CHECK_SUBSTR(prog) (((struct regexp *)SvANY(prog))->check_substr)
#define RX_EXTFLAGS(prog) RXp_EXTFLAGS((struct regexp *)SvANY(prog))
@@ -417,6 +415,9 @@ and check for NULL.
#define RX_MATCH_UTF8_set(prog, t) ((t) \
? (RX_MATCH_UTF8_on(prog), (PL_reg_match_utf8 = 1)) \
: (RX_MATCH_UTF8_off(prog), (PL_reg_match_utf8 = 0)))
+
+/* Whether the pattern stored at RX_WRAPPED is in UTF-8 */
+#define RX_UTF8(prog) (RX_EXTFLAGS(prog) & RXf_UTF8)
#define REXEC_COPY_STR 0x01 /* Need to copy the string. */
#define REXEC_CHECKED 0x02 /* check_substr already checked. */