diff options
author | Nicholas Clark <nick@ccl4.org> | 2007-12-29 17:01:51 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2007-12-29 17:01:51 +0000 |
commit | 52d81aa88ad6014ec0ca7c381776c58dd68e428a (patch) | |
tree | b736c2dbcdd28453c37cad08c4075e004705ffc6 /regexp.h | |
parent | 14f3b9f2b06052c35a95062569fb2799771d1e2b (diff) | |
download | perl-52d81aa88ad6014ec0ca7c381776c58dd68e428a.tar.gz |
Reorder the external regexp flags to get RXf_PMf_STD_PMMOD into the
lowest 4 bits (which saves a shift), and the "flags indicating special
patterns" into contiguous bits. This makes everything a little tidier,
and saves 88 bytes (woohoo!) of object file with -Os on x86 FreeBSD.
p4raw-id: //depot/perl@32775
Diffstat (limited to 'regexp.h')
-rw-r--r-- | regexp.h | 80 |
1 files changed, 40 insertions, 40 deletions
@@ -227,35 +227,17 @@ and check for NULL. * */ -/* Anchor and GPOS related stuff */ -#define RXf_ANCH_BOL 0x00000001 -#define RXf_ANCH_MBOL 0x00000002 -#define RXf_ANCH_SBOL 0x00000004 -#define RXf_ANCH_GPOS 0x00000008 -#define RXf_GPOS_SEEN 0x00000010 -#define RXf_GPOS_FLOAT 0x00000020 -/* two bits here */ -#define RXf_ANCH (RXf_ANCH_BOL|RXf_ANCH_MBOL|RXf_ANCH_GPOS|RXf_ANCH_SBOL) -#define RXf_GPOS_CHECK (RXf_GPOS_SEEN|RXf_ANCH_GPOS) -#define RXf_ANCH_SINGLE (RXf_ANCH_SBOL|RXf_ANCH_GPOS) - -/* Flags indicating special patterns */ -#define RXf_SKIPWHITE 0x00000100 /* Pattern is for a split / / */ -#define RXf_START_ONLY 0x00000200 /* Pattern is /^/ */ -#define RXf_WHITE 0x00000400 /* Pattern is /\s+/ */ -#define RXf_NULL 0x40000000 /* Pattern is // */ - -/* 0x1F800 of extflags is used by (RXf_)PMf_COMPILETIME +/* 0x3F of extflags is used by (RXf_)PMf_COMPILETIME * If you change these you need to change the equivalent flags in op.h, and * vice versa. */ -#define RXf_PMf_LOCALE 0x00000800 /* use locale */ -#define RXf_PMf_MULTILINE 0x00001000 /* /m */ -#define RXf_PMf_SINGLELINE 0x00002000 /* /s */ -#define RXf_PMf_FOLD 0x00004000 /* /i */ -#define RXf_PMf_EXTENDED 0x00008000 /* /x */ -#define RXf_PMf_KEEPCOPY 0x00010000 /* /p */ +#define RXf_PMf_MULTILINE 0x00000001 /* /m */ +#define RXf_PMf_SINGLELINE 0x00000002 /* /s */ +#define RXf_PMf_FOLD 0x00000004 /* /i */ +#define RXf_PMf_EXTENDED 0x00000008 /* /x */ +#define RXf_PMf_KEEPCOPY 0x00000010 /* /p */ +#define RXf_PMf_LOCALE 0x00000020 /* use locale */ /* these flags are transfered from the PMOP->op_pmflags member during compilation */ -#define RXf_PMf_STD_PMMOD_SHIFT 12 +#define RXf_PMf_STD_PMMOD_SHIFT 0 #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) @@ -302,37 +284,55 @@ and check for NULL. * */ +/* Anchor and GPOS related stuff */ +#define RXf_ANCH_BOL 0x00000100 +#define RXf_ANCH_MBOL 0x00000200 +#define RXf_ANCH_SBOL 0x00000400 +#define RXf_ANCH_GPOS 0x00000800 +#define RXf_GPOS_SEEN 0x00001000 +#define RXf_GPOS_FLOAT 0x00002000 +/* two bits here */ +#define RXf_ANCH (RXf_ANCH_BOL|RXf_ANCH_MBOL|RXf_ANCH_GPOS|RXf_ANCH_SBOL) +#define RXf_GPOS_CHECK (RXf_GPOS_SEEN|RXf_ANCH_GPOS) +#define RXf_ANCH_SINGLE (RXf_ANCH_SBOL|RXf_ANCH_GPOS) + /* What we have seen */ -#define RXf_LOOKBEHIND_SEEN 0x00020000 -#define RXf_EVAL_SEEN 0x00040000 -#define RXf_CANY_SEEN 0x00080000 +#define RXf_LOOKBEHIND_SEEN 0x00004000 +#define RXf_EVAL_SEEN 0x00008000 +#define RXf_CANY_SEEN 0x00010000 /* Special */ -#define RXf_NOSCAN 0x00100000 -#define RXf_CHECK_ALL 0x00200000 +#define RXf_NOSCAN 0x00020000 +#define RXf_CHECK_ALL 0x00040000 /* UTF8 related */ -#define RXf_UTF8 0x00400000 -#define RXf_MATCH_UTF8 0x00800000 +#define RXf_UTF8 0x00080000 +#define RXf_MATCH_UTF8 0x00100000 /* Intuit related */ -#define RXf_USE_INTUIT_NOML 0x01000000 -#define RXf_USE_INTUIT_ML 0x02000000 -#define RXf_INTUIT_TAIL 0x04000000 +#define RXf_USE_INTUIT_NOML 0x00200000 +#define RXf_USE_INTUIT_ML 0x00400000 +#define RXf_INTUIT_TAIL 0x00800000 /* Set in Perl_pmruntime if op_flags & OPf_SPECIAL, i.e. split. Will be used by regex engines to check whether they should set RXf_SKIPWHITE */ -#define RXf_SPLIT 0x08000000 +#define RXf_SPLIT 0x01000000 #define RXf_USE_INTUIT (RXf_USE_INTUIT_NOML|RXf_USE_INTUIT_ML) /* Copy and tainted info */ -#define RXf_COPY_DONE 0x10000000 -#define RXf_TAINTED_SEEN 0x20000000 -#define RXf_TAINTED 0x80000000 /* this pattern is tainted */ +#define RXf_COPY_DONE 0x02000000 +#define RXf_TAINTED_SEEN 0x04000000 +#define RXf_TAINTED 0x08000000 /* this pattern is tainted */ + +/* Flags indicating special patterns */ +#define RXf_START_ONLY 0x10000000 /* Pattern is /^/ */ +#define RXf_SKIPWHITE 0x20000000 /* Pattern is for a split / / */ +#define RXf_WHITE 0x40000000 /* Pattern is /\s+/ */ +#define RXf_NULL 0x80000000 /* Pattern is // */ /* * NOTE: if you modify any RXf flags you should run regen.pl or regcomp.pl |