Change 14240 by jhi@alpha on 2002/01/13 17:35:48

        Subject: Re: lookbehind broken with latest bleedperl
        From: Hugo van der Sanden <[EMAIL PROTECTED]>
        Date: Sun, 13 Jan 2002 18:06:22 +0000
        Message-Id: <[EMAIL PROTECTED]>

Affected files ...

.... //depot/perl/regexec.c#254 edit
.... //depot/perl/t/op/re_tests#74 edit

Differences ...

==== //depot/perl/regexec.c#254 (text) ====
Index: perl/regexec.c
--- perl/regexec.c.~1~  Sun Jan 13 10:45:05 2002
+++ perl/regexec.c      Sun Jan 13 10:45:05 2002
@@ -140,13 +140,18 @@
     PL_regkind[(U8)OP(rn)] == EXACT || PL_regkind[(U8)OP(rn)] == REF \
 )
 
+/*
+  Search for mandatory following text node; for lookahead, the text must
+  follow but for lookbehind (rn->flags != 0) we skip to the next step.
+*/
 #define FIND_NEXT_IMPT(rn) STMT_START { \
     while (JUMPABLE(rn)) \
-       if (OP(rn) == SUSPEND || OP(rn) == IFMATCH || \
-           PL_regkind[(U8)OP(rn)] == CURLY) \
+       if (OP(rn) == SUSPEND || PL_regkind[(U8)OP(rn)] == CURLY) \
            rn = NEXTOPER(NEXTOPER(rn)); \
        else if (OP(rn) == PLUS) \
            rn = NEXTOPER(rn); \
+       else if (OP(rn) == IFMATCH) \
+           rn = (rn->flags == 0) ? NEXTOPER(NEXTOPER(rn)) : rn + ARG(rn); \
        else rn += NEXT_OFF(rn); \
 } STMT_END 
 

==== //depot/perl/t/op/re_tests#74 (text) ====
Index: perl/t/op/re_tests
--- perl/t/op/re_tests.~1~      Sun Jan 13 10:45:05 2002
+++ perl/t/op/re_tests  Sun Jan 13 10:45:05 2002
@@ -799,3 +799,37 @@
 '^(o)(?!.*\1)'i        Oo      n       -       -
 (.*)\d+\1      abc12bc y       $1      bc
 (?m:(foo\s*$)) foo\n bar       y       $1      foo
+(.*)c  abcd    y       $1      ab
+(.*)(?=c)      abcd    y       $1      ab
+(.*)(?=c)c     abcd    yB      $1      ab
+(.*)(?=b|c)    abcd    y       $1      ab
+(.*)(?=b|c)c   abcd    y       $1      ab
+(.*)(?=c|b)    abcd    y       $1      ab
+(.*)(?=c|b)c   abcd    y       $1      ab
+(.*)(?=[bc])   abcd    y       $1      ab
+(.*)(?=[bc])c  abcd    yB      $1      ab
+(.*)(?<=b)     abcd    y       $1      ab
+(.*)(?<=b)c    abcd    y       $1      ab
+(.*)(?<=b|c)   abcd    y       $1      abc
+(.*)(?<=b|c)c  abcd    y       $1      ab
+(.*)(?<=c|b)   abcd    y       $1      abc
+(.*)(?<=c|b)c  abcd    y       $1      ab
+(.*)(?<=[bc])  abcd    y       $1      abc
+(.*)(?<=[bc])c abcd    y       $1      ab
+(.*?)c abcd    y       $1      ab
+(.*?)(?=c)     abcd    y       $1      ab
+(.*?)(?=c)c    abcd    yB      $1      ab
+(.*?)(?=b|c)   abcd    y       $1      a
+(.*?)(?=b|c)c  abcd    y       $1      ab
+(.*?)(?=c|b)   abcd    y       $1      a
+(.*?)(?=c|b)c  abcd    y       $1      ab
+(.*?)(?=[bc])  abcd    y       $1      a
+(.*?)(?=[bc])c abcd    yB      $1      ab
+(.*?)(?<=b)    abcd    y       $1      ab
+(.*?)(?<=b)c   abcd    y       $1      ab
+(.*?)(?<=b|c)  abcd    y       $1      ab
+(.*?)(?<=b|c)c abcd    y       $1      ab
+(.*?)(?<=c|b)  abcd    y       $1      ab
+(.*?)(?<=c|b)c abcd    y       $1      ab
+(.*?)(?<=[bc]) abcd    y       $1      ab
+(.*?)(?<=[bc])c        abcd    y       $1      ab
End of Patch.

Reply via email to