This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Re: Fix \k<foo> preceded by literal
authorYves Orton <demerphq@gmail.com>
Wed, 29 Nov 2006 16:18:34 +0000 (17:18 +0100)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Wed, 29 Nov 2006 15:26:00 +0000 (15:26 +0000)
Message-ID: <9b18b3110611290718o685a07ddja39f595ed97c231a@mail.gmail.com>

p4raw-id: //depot/perl@29420

regcomp.c
regcomp.h
t/op/re_tests

index 3fe5561..30b0660 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -6472,6 +6472,7 @@ tryagain:
                    case 'P':
                     case 'N':
                     case 'R':
+                    case 'k':
                        --p;
                        goto loopdone;
                    case 'n':
index 5710857..167b2c0 100644 (file)
--- 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 */
 
+
index cde5ccc..925bb36 100644 (file)
@@ -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<n>/      ..foo foo..     y       $1      foo
+/(?'n'foo) \k<n>/      ..foo foo..     y       $+{n}   foo
+/(?<n>foo) \k'n'/      ..foo foo..     y       $1      foo
+/(?<n>foo) \k'n'/      ..foo foo..     y       $+{n}   foo
+/(?<as>as) (\w+) \k<as> (\w+)/ as easy as pie  y       $1-$2-$3        as-easy-pie