From: Yves Orton Date: Wed, 29 Nov 2006 16:18:34 +0000 (+0100) Subject: Re: Fix \k preceded by literal X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=99ed40ffbc554c06cacea00522b9ea0d8190ec46;p=p5sagit%2Fp5-mst-13.2.git Re: Fix \k preceded by literal Message-ID: <9b18b3110611290718o685a07ddja39f595ed97c231a@mail.gmail.com> p4raw-id: //depot/perl@29420 --- diff --git a/regcomp.c b/regcomp.c index 3fe5561..30b0660 100644 --- a/regcomp.c +++ b/regcomp.c @@ -6472,6 +6472,7 @@ tryagain: case 'P': case 'N': case 'R': + case 'k': --p; goto loopdone; case 'n': diff --git a/regcomp.h b/regcomp.h index 5710857..167b2c0 100644 --- a/regcomp.h +++ b/regcomp.h @@ -376,7 +376,9 @@ EXTCONST U8 PL_varies[]; #else EXTCONST U8 PL_varies[] = { BRANCH, BACK, STAR, PLUS, CURLY, CURLYX, REF, REFF, REFFL, - WHILEM, CURLYM, CURLYN, BRANCHJ, IFTHEN, SUSPEND, CLUMP, 0 + WHILEM, CURLYM, CURLYN, BRANCHJ, IFTHEN, SUSPEND, CLUMP, + NREF, NREFF, NREFFL, + 0 }; #endif @@ -751,3 +753,4 @@ re.pm, especially to the documentation. #endif /* DEBUG RELATED DEFINES */ + diff --git a/t/op/re_tests b/t/op/re_tests index cde5ccc..925bb36 100644 --- a/t/op/re_tests +++ b/t/op/re_tests @@ -1193,3 +1193,9 @@ a*(*F) aaaab n - - (foo)(\R2) foofoo y $1-$2 foo-foo (foo)(\R2)(foo)(\R2) foofoofoofoo y $1-$2-$3-$4 foo-foo-foo-foo (([abc]+) \R1)(([abc]+) \R1) abc abccba cba y $2-$4 abc-cba + +/(?'n'foo) \k/ ..foo foo.. y $1 foo +/(?'n'foo) \k/ ..foo foo.. y $+{n} foo +/(?foo) \k'n'/ ..foo foo.. y $1 foo +/(?foo) \k'n'/ ..foo foo.. y $+{n} foo +/(?as) (\w+) \k (\w+)/ as easy as pie y $1-$2-$3 as-easy-pie