From cde0cee5716418bb58782f073048ee9685ed2368 Mon Sep 17 00:00:00 2001 From: Yves Orton Date: Fri, 12 Jan 2007 03:31:12 +0100 Subject: Add support for /k modfier for matching along with ${^PREMATCH}, ${^MATCH}, ${^POSTMATCH} Message-ID: <9b18b3110701111731x29b1c63i57b1698f769b3bbc@mail.gmail.com> (with tweaks) p4raw-id: //depot/perl@29831 --- regexp.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'regexp.h') diff --git a/regexp.h b/regexp.h index c28c78e07a..4045fbd84b 100644 --- a/regexp.h +++ b/regexp.h @@ -144,11 +144,18 @@ typedef struct regexp_engine { #define RXf_PMf_SINGLELINE 0x00002000 /* /s */ #define RXf_PMf_FOLD 0x00004000 /* /i */ #define RXf_PMf_EXTENDED 0x00008000 /* /x */ +#define RXf_PMf_KEEPCOPY 0x00010000 /* /k */ /* these flags are transfered from the PMOP->op_pmflags member during compilation */ -#define RXf_PMf_COMPILETIME (RXf_PMf_MULTILINE|RXf_PMf_SINGLELINE|RXf_PMf_LOCALE|RXf_PMf_FOLD|RXf_PMf_EXTENDED) +#define RXf_PMf_STD_PMMOD (RXf_PMf_MULTILINE|RXf_PMf_SINGLELINE|RXf_PMf_FOLD|RXf_PMf_EXTENDED) +#define RXf_PMf_COMPILETIME (RXf_PMf_MULTILINE|RXf_PMf_SINGLELINE|RXf_PMf_LOCALE|RXf_PMf_FOLD|RXf_PMf_EXTENDED|RXf_PMf_KEEPCOPY) + +#define CASE_STD_PMMOD_FLAGS_PARSE_SET(pmfl) \ + case 'i': *(pmfl) |= RXf_PMf_FOLD; break; \ + case 'm': *(pmfl) |= RXf_PMf_MULTILINE; break; \ + case 's': *(pmfl) |= RXf_PMf_SINGLELINE; break; \ + case 'x': *(pmfl) |= RXf_PMf_EXTENDED; break /* What we have seen */ -/* one bit here */ #define RXf_LOOKBEHIND_SEEN 0x00020000 #define RXf_EVAL_SEEN 0x00040000 #define RXf_CANY_SEEN 0x00080000 @@ -448,6 +455,7 @@ struct re_save_state { #define SAVESTACK_ALLOC_FOR_RE_SAVE_STATE \ (1 + ((sizeof(struct re_save_state) - 1) / sizeof(*PL_savestack))) + /* * Local variables: * c-indentation-style: bsd -- cgit v1.2.1