diff options
author | Karl Williamson <khw@cpan.org> | 2014-09-17 17:55:16 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2014-09-29 11:07:40 -0600 |
commit | 334afb3ef43aa91a8701c4ca7e753a5ec8e71f88 (patch) | |
tree | 7355b93b5edae4cb09c3f2eda3935208a1b9c0c2 | |
parent | 9a7d4f5f5c4be53dfbc55ca52953e3794a5ef68a (diff) | |
download | perl-334afb3ef43aa91a8701c4ca7e753a5ec8e71f88.tar.gz |
Make space for /xx flag
This doesn't actually use the flag yet.
We no longer have to make version-dependent changes to
ext/Devel-Peek/t/Peek.t, (it being in /ext) so this doesn't
-rw-r--r-- | dump.c | 1 | ||||
-rw-r--r-- | ext/B/t/concise-xs.t | 3 | ||||
-rw-r--r-- | ext/Devel-Peek/t/Peek.t | 4 | ||||
-rw-r--r-- | ext/re/re.pm | 2 | ||||
-rw-r--r-- | lib/B/Deparse.pm | 7 | ||||
-rw-r--r-- | op.h | 2 | ||||
-rw-r--r-- | op_reg_common.h | 22 | ||||
-rw-r--r-- | regexp.h | 4 | ||||
-rw-r--r-- | regnodes.h | 14 |
9 files changed, 32 insertions, 27 deletions
@@ -1363,6 +1363,7 @@ const struct flag_to_name regexp_extflags_names[] = { {RXf_PMf_SINGLELINE, "PMf_SINGLELINE,"}, {RXf_PMf_FOLD, "PMf_FOLD,"}, {RXf_PMf_EXTENDED, "PMf_EXTENDED,"}, + {RXf_PMf_EXTENDED_MORE, "PMf_EXTENDED_MORE,"}, {RXf_PMf_KEEPCOPY, "PMf_KEEPCOPY,"}, {RXf_IS_ANCHORED, "IS_ANCHORED,"}, {RXf_NO_INPLACE_SUBST, "NO_INPLACE_SUBST,"}, diff --git a/ext/B/t/concise-xs.t b/ext/B/t/concise-xs.t index c2258f7c6a..c1d7f186ab 100644 --- a/ext/B/t/concise-xs.t +++ b/ext/B/t/concise-xs.t @@ -166,7 +166,8 @@ my $testpkgs = { OPpSORT_INPLACE OPpSORT_INTEGER OPpSORT_NUMERIC OPpSORT_REVERSE OPpREVERSE_INPLACE OPpTARGET_MY OPpTRANS_COMPLEMENT OPpTRANS_DELETE OPpTRANS_SQUASH - PMf_CONTINUE PMf_EVAL PMf_EXTENDED PMf_FOLD PMf_GLOBAL + PMf_CONTINUE PMf_EVAL PMf_EXTENDED PMf_EXTENDED_MORE + PMf_FOLD PMf_GLOBAL PMf_KEEP PMf_NONDESTRUCT PMf_MULTILINE PMf_ONCE PMf_SINGLELINE POSTFIX SVf_FAKE SVf_IOK SVf_NOK SVf_POK SVf_ROK diff --git a/ext/Devel-Peek/t/Peek.t b/ext/Devel-Peek/t/Peek.t index dd148626a1..f321e188bb 100644 --- a/ext/Devel-Peek/t/Peek.t +++ b/ext/Devel-Peek/t/Peek.t @@ -1189,7 +1189,7 @@ do_test('UTF-8 in a regular expression', CUR = 13 STASH = $ADDR "Regexp" COMPFLAGS = 0x0 \(\) - EXTFLAGS = 0x680040 \(CHECK_ALL,USE_INTUIT_NOML,USE_INTUIT_ML\) + EXTFLAGS = 0x680080 \(CHECK_ALL,USE_INTUIT_NOML,USE_INTUIT_ML\) (?: ENGINE = $ADDR \(STANDARD\) )? INTFLAGS = 0x0(?: \(\))? NPARENS = 0 @@ -1212,7 +1212,7 @@ do_test('UTF-8 in a regular expression', PV = $ADDR "\(\?\^u:\\\\\\\\x\{100\}\)" \[UTF8 "\(\?\^u:\\\\\\\\x\{100\}\)"\] CUR = 13 COMPFLAGS = 0x0 \(\) - EXTFLAGS = 0x680040 \(CHECK_ALL,USE_INTUIT_NOML,USE_INTUIT_ML\) + EXTFLAGS = 0x680080 \(CHECK_ALL,USE_INTUIT_NOML,USE_INTUIT_ML\) (?: ENGINE = $ADDR \(STANDARD\) )? INTFLAGS = 0x0(?: \(\))? NPARENS = 0 diff --git a/ext/re/re.pm b/ext/re/re.pm index c2d6eed2d1..5904d4e00e 100644 --- a/ext/re/re.pm +++ b/ext/re/re.pm @@ -23,7 +23,7 @@ my %reflags = ( s => 1 << ($PMMOD_SHIFT + 1), i => 1 << ($PMMOD_SHIFT + 2), x => 1 << ($PMMOD_SHIFT + 3), - p => 1 << ($PMMOD_SHIFT + 4), + p => 1 << ($PMMOD_SHIFT + 5), # special cases: d => 0, l => 1, diff --git a/lib/B/Deparse.pm b/lib/B/Deparse.pm index ab85acf1ac..a4cb5a37a6 100644 --- a/lib/B/Deparse.pm +++ b/lib/B/Deparse.pm @@ -20,8 +20,8 @@ use B qw(class main_root main_start main_cv svref_2object opnumber perlstring SVpad_TYPED CVf_METHOD CVf_LVALUE PMf_KEEP PMf_GLOBAL PMf_CONTINUE PMf_EVAL PMf_ONCE - PMf_MULTILINE PMf_SINGLELINE PMf_FOLD PMf_EXTENDED); -$VERSION = '1.28'; + PMf_MULTILINE PMf_SINGLELINE PMf_FOLD PMf_EXTENDED PMf_EXTENDED_MORE); +$VERSION = '1.29'; use strict; use vars qw/$AUTOLOAD/; use warnings (); @@ -4756,11 +4756,12 @@ sub re_flags { $flags .= "o" if $pmflags & PMf_KEEP; $flags .= "s" if $pmflags & PMf_SINGLELINE; $flags .= "x" if $pmflags & PMf_EXTENDED; + $flags .= "x" if $pmflags & PMf_EXTENDED_MORE; $flags .= "p" if $pmflags & RXf_PMf_KEEPCOPY; if (my $charset = $pmflags & RXf_PMf_CHARSET) { # Hardcoding this is fragile, but B does not yet export the # constants we need. - $flags .= qw(d l u a aa)[$charset >> 5] + $flags .= qw(d l u a aa)[$charset >> 6] } # The /d flag is indicated by 0; only show it if necessary. elsif ($self->{hinthash} and @@ -275,7 +275,7 @@ struct pmop { * allocate off the low end until you get to PMf_BASE_SHIFT+0. If that isn't * enough, move PMf_BASE_SHIFT down (if possible) and add the new bit at the * other end instead; this preserves binary compatibility. */ -#define PMf_BASE_SHIFT (_RXf_PMf_SHIFT_NEXT+5) +#define PMf_BASE_SHIFT (_RXf_PMf_SHIFT_NEXT+4) /* 'use re "taint"' in scope: taint $1 etc. if target tainted */ #define PMf_RETAINT (1<<(PMf_BASE_SHIFT+5)) diff --git a/op_reg_common.h b/op_reg_common.h index 67e2439e38..7ff27de578 100644 --- a/op_reg_common.h +++ b/op_reg_common.h @@ -32,7 +32,8 @@ #define RXf_PMf_SINGLELINE (1 << (RXf_PMf_STD_PMMOD_SHIFT+1)) /* /s */ #define RXf_PMf_FOLD (1 << (RXf_PMf_STD_PMMOD_SHIFT+2)) /* /i */ #define RXf_PMf_EXTENDED (1 << (RXf_PMf_STD_PMMOD_SHIFT+3)) /* /x */ -#define RXf_PMf_KEEPCOPY (1 << (RXf_PMf_STD_PMMOD_SHIFT+4)) /* /p */ +#define RXf_PMf_EXTENDED_MORE (1 << (RXf_PMf_STD_PMMOD_SHIFT+4)) /* /xx */ +#define RXf_PMf_KEEPCOPY (1 << (RXf_PMf_STD_PMMOD_SHIFT+5)) /* /p */ /* The character set for the regex is stored in a field of more than one bit * using an enum, for reasons of compactness and to ensure that the options are @@ -48,7 +49,7 @@ typedef enum { REGEX_ASCII_MORE_RESTRICTED_CHARSET } regex_charset; -#define _RXf_PMf_CHARSET_SHIFT ((RXf_PMf_STD_PMMOD_SHIFT)+5) +#define _RXf_PMf_CHARSET_SHIFT ((RXf_PMf_STD_PMMOD_SHIFT)+6) #define RXf_PMf_CHARSET (7 << (_RXf_PMf_CHARSET_SHIFT)) /* 3 bits */ /* Manually decorate these functions here with gcc-style attributes just to @@ -80,22 +81,22 @@ get_regex_charset(const U32 flags) return (regex_charset) ((flags & RXf_PMf_CHARSET) >> _RXf_PMf_CHARSET_SHIFT); } -#define _RXf_PMf_SHIFT_COMPILETIME (RXf_PMf_STD_PMMOD_SHIFT+8) +#define _RXf_PMf_SHIFT_COMPILETIME (RXf_PMf_STD_PMMOD_SHIFT+9) /* 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_PMf_SPLIT (1<<(RXf_PMf_STD_PMMOD_SHIFT+8)) +#define RXf_PMf_SPLIT (1<<(RXf_PMf_STD_PMMOD_SHIFT+9)) /* Next available bit after the above. Name begins with '_' so won't be * exported by B */ -#define _RXf_PMf_SHIFT_NEXT (RXf_PMf_STD_PMMOD_SHIFT+9) +#define _RXf_PMf_SHIFT_NEXT (RXf_PMf_STD_PMMOD_SHIFT+10) /* Mask of the above bits. These need to be transferred from op_pmflags to * re->extflags during compilation */ -#define RXf_PMf_COMPILETIME (RXf_PMf_MULTILINE|RXf_PMf_SINGLELINE|RXf_PMf_FOLD|RXf_PMf_EXTENDED|RXf_PMf_KEEPCOPY|RXf_PMf_CHARSET) +#define RXf_PMf_COMPILETIME (RXf_PMf_MULTILINE|RXf_PMf_SINGLELINE|RXf_PMf_FOLD|RXf_PMf_EXTENDED|RXf_PMf_EXTENDED_MORE|RXf_PMf_KEEPCOPY|RXf_PMf_CHARSET) #define RXf_PMf_FLAGCOPYMASK (RXf_PMf_COMPILETIME|RXf_PMf_SPLIT) /* Exclude win32 because it can't cope with I32_MAX definition */ @@ -110,11 +111,12 @@ get_regex_charset(const U32 flags) #define PMf_SINGLELINE 1<<1 #define PMf_FOLD 1<<2 #define PMf_EXTENDED 1<<3 -#define PMf_KEEPCOPY 1<<4 -#define PMf_CHARSET 7<<5 -#define PMf_SPLIT 1<<8 +#define PMf_EXTENDED_MORE 1<<4 +#define PMf_KEEPCOPY 1<<5 +#define PMf_CHARSET 7<<6 +#define PMf_SPLIT 1<<9 -#if PMf_MULTILINE != RXf_PMf_MULTILINE || PMf_SINGLELINE != RXf_PMf_SINGLELINE || PMf_FOLD != RXf_PMf_FOLD || PMf_EXTENDED != RXf_PMf_EXTENDED || PMf_KEEPCOPY != RXf_PMf_KEEPCOPY || PMf_SPLIT != RXf_PMf_SPLIT || PMf_CHARSET != RXf_PMf_CHARSET +#if PMf_MULTILINE != RXf_PMf_MULTILINE || PMf_SINGLELINE != RXf_PMf_SINGLELINE || PMf_FOLD != RXf_PMf_FOLD || PMf_EXTENDED != RXf_PMf_EXTENDED || PMf_EXTENDED_MORE != RXf_PMf_EXTENDED_MORE || PMf_KEEPCOPY != RXf_PMf_KEEPCOPY || PMf_SPLIT != RXf_PMf_SPLIT || PMf_CHARSET != RXf_PMf_CHARSET # error RXf_PMf defines are wrong #endif @@ -321,7 +321,7 @@ and check for NULL. /* This string is expected by regcomp.c to be ordered so that the first * character is the flag in bit RXf_PMf_STD_PMMOD_SHIFT of extflags; the next * character is bit +1, etc. */ -#define STD_PAT_MODS "msix" +#define STD_PAT_MODS "msixx" #define CHARSET_PAT_MODS ASCII_RESTRICT_PAT_MODS DEPENDS_PAT_MODS LOCALE_PAT_MODS UNICODE_PAT_MODS @@ -381,7 +381,7 @@ and check for NULL. * For the regexp bits, PL_reg_extflags_name[] in regnodes.h has a comment * giving which bits are used/unused */ -#define RXf_BASE_SHIFT (_RXf_PMf_SHIFT_NEXT + 5) +#define RXf_BASE_SHIFT (_RXf_PMf_SHIFT_NEXT + 4) /* What we have seen */ #define RXf_NO_INPLACE_SUBST (1<<(RXf_BASE_SHIFT+2)) diff --git a/regnodes.h b/regnodes.h index 73b81a1c2f..7bc75c92d0 100644 --- a/regnodes.h +++ b/regnodes.h @@ -632,17 +632,17 @@ EXTCONST char * const PL_reg_name[] = { EXTCONST char * PL_reg_extflags_name[]; #else EXTCONST char * const PL_reg_extflags_name[] = { - /* Bits in extflags defined: 11111111111111110000000111111111 */ + /* Bits in extflags defined: 11111111111111110000001111111111 */ "MULTILINE", /* 0x00000001 */ "SINGLELINE", /* 0x00000002 */ "FOLD", /* 0x00000004 */ "EXTENDED", /* 0x00000008 */ - "KEEPCOPY", /* 0x00000010 */ - "CHARSET0", /* 0x00000020 : "CHARSET" - 0x000000e0 */ - "CHARSET1", /* 0x00000040 : "CHARSET" - 0x000000e0 */ - "CHARSET2", /* 0x00000080 : "CHARSET" - 0x000000e0 */ - "SPLIT", /* 0x00000100 */ - "UNUSED_BIT_9", /* 0x00000200 */ + "EXTENDED_MORE", /* 0x00000010 */ + "KEEPCOPY", /* 0x00000020 */ + "CHARSET0", /* 0x00000040 : "CHARSET" - 0x000001c0 */ + "CHARSET1", /* 0x00000080 : "CHARSET" - 0x000001c0 */ + "CHARSET2", /* 0x00000100 : "CHARSET" - 0x000001c0 */ + "SPLIT", /* 0x00000200 */ "UNUSED_BIT_10", /* 0x00000400 */ "UNUSED_BIT_11", /* 0x00000800 */ "UNUSED_BIT_12", /* 0x00001000 */ |