From: Karl Williamson Date: Tue, 21 Sep 2010 00:26:33 +0000 (-0600) Subject: Change to use mnemonic instead of char constant X-Git-Tag: v5.13.6~475 X-Git-Url: https://perl5.git.perl.org/perl5.git/commitdiff_plain/855088127b85a7b03f3833b2274d4f26946f203d?hp=d0dcc4028a160eba03640da1ff1d34087f930ec1 Change to use mnemonic instead of char constant The new '^' in (?^...) should really be a macro. --- diff --git a/regcomp.c b/regcomp.c index de95789..c080fcd 100644 --- a/regcomp.c +++ b/regcomp.c @@ -4442,7 +4442,7 @@ Perl_re_compile(pTHX_ SV * const pattern, U32 pm_flags) SvFLAGS(rx) |= SvUTF8(pattern); *p++='('; *p++='?'; if (has_minus) { /* If a default, cover it using the caret */ - *p++='^'; + *p++= DEFAULT_PAT_MOD; } if (has_p) *p++ = KEEPCOPY_PAT_MOD; /*'p'*/ @@ -6120,7 +6120,8 @@ S_reg(pTHX_ RExC_state_t *pRExC_state, I32 paren, I32 *flagp,U32 depth) RExC_parse--; /* for vFAIL to print correctly */ vFAIL("Sequence (? incomplete"); break; - case '^': /* Use default flags with the exceptions that follow */ + case DEFAULT_PAT_MOD: /* Use default flags with the exceptions + that follow */ has_use_defaults = TRUE; STD_PMMOD_FLAGS_CLEAR(&RExC_flags); goto parse_flags; diff --git a/regexp.h b/regexp.h index 198b510..17f9983 100644 --- a/regexp.h +++ b/regexp.h @@ -247,6 +247,7 @@ and check for NULL. * for compatibility reasons with Regexp::Common which highjacked (?k:...) * for its own uses. So 'k' is out as well. */ +#define DEFAULT_PAT_MOD '^' /* Short for all the default modifiers */ #define EXEC_PAT_MOD 'e' #define KEEPCOPY_PAT_MOD 'p' #define ONCE_PAT_MOD 'o'