diff options
author | Yves Orton <demerphq@gmail.com> | 2007-01-13 18:18:01 +0100 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2007-01-15 16:37:21 +0000 |
commit | a20207d7c00bd54d6d2718961a96cd5c7ed1e37b (patch) | |
tree | 0b43606006e1c20c7552202ed54244b4d5525013 /toke.c | |
parent | cde0cee5716418bb58782f073048ee9685ed2368 (diff) | |
download | perl-a20207d7c00bd54d6d2718961a96cd5c7ed1e37b.tar.gz |
Re: [PATCH] Add support for /k modfier for matching along with ${^PREMATCH}, ${^MATCH}, ${^POSTMATCH}
Message-ID: <9b18b3110701130818h6badbd3o1b38f2660d258173@mail.gmail.com>
macroize regexp modifiers
p4raw-id: //depot/perl@29834
Diffstat (limited to 'toke.c')
-rw-r--r-- | toke.c | 17 |
1 files changed, 9 insertions, 8 deletions
@@ -10767,10 +10767,10 @@ Perl_pmflag(pTHX_ U32* pmfl, int ch) char c = (char)ch; switch (c) { CASE_STD_PMMOD_FLAGS_PARSE_SET(pmfl); - case 'g': *pmfl |= PMf_GLOBAL; break; - case 'c': *pmfl |= PMf_CONTINUE; break; - case 'o': *pmfl |= PMf_KEEP; break; - case 'k': *pmfl |= PMf_KEEPCOPY; break; + case GLOBAL_PAT_MOD: *pmfl |= PMf_GLOBAL; break; + case CONTINUE_PAT_MOD: *pmfl |= PMf_CONTINUE; break; + case ONCE_PAT_MOD: *pmfl |= PMf_KEEP; break; + case KEEPCOPY_PAT_MOD: *pmfl |= PMf_KEEPCOPY; break; } } } @@ -10782,7 +10782,7 @@ S_scan_pat(pTHX_ char *start, I32 type) PMOP *pm; char *s = scan_str(start,!!PL_madskills,FALSE); const char * const valid_flags = - (const char *)((type == OP_QR) ? "iomsxk" : "iogcmsxk"); + (const char *)((type == OP_QR) ? QR_PAT_MODS : M_PAT_MODS); #ifdef PERL_MAD char *modstart; #endif @@ -10815,7 +10815,8 @@ S_scan_pat(pTHX_ char *start, I32 type) if ((pm->op_pmflags & PMf_CONTINUE) && !(pm->op_pmflags & PMf_GLOBAL) && ckWARN(WARN_REGEXP)) { - Perl_warner(aTHX_ packWARN(WARN_REGEXP), "Use of /c modifier is meaningless without /g" ); + Perl_warner(aTHX_ packWARN(WARN_REGEXP), + "Use of /c modifier is meaningless without /g" ); } pm->op_pmpermflags = pm->op_pmflags; @@ -10879,11 +10880,11 @@ S_scan_subst(pTHX_ char *start) #endif while (*s) { - if (*s == 'e') { + if (*s == EXEC_PAT_MOD) { s++; es++; } - else if (strchr("iogcmsxk", *s)) + else if (strchr(S_PAT_MODS, *s)) pmflag(&pm->op_pmflags,*s++); else break; |