/[pcre]/code/trunk/testdata/testinput11
ViewVC logotype

Diff of /code/trunk/testdata/testinput11

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 651 by ph10, Mon Aug 1 16:32:40 2011 UTC revision 771 by ph10, Tue Nov 29 15:34:12 2011 UTC
# Line 452  with the handling of backtracking verbs. Line 452  with the handling of backtracking verbs.
452  /A(*MARK:A)A+(*SKIP:B)(B|Z) | AC(*:B)/xK  /A(*MARK:A)A+(*SKIP:B)(B|Z) | AC(*:B)/xK
453      AAAC      AAAC
454    
 /--- We use something more complicated than individual letters here, because  
 that causes different behaviour in Perl. Perhaps it disables some optimization;  
 anyway, the result now matches PCRE in that no tag is passed back for the  
 failures. ---/  
   
 /(A|P)(*:A)(B|P) | (X|P)(X|P)(*:B)(Y|P)/xK  
     AABC  
     XXYZ  
     ** Failers  
     XAQQ  
     XAQQXZZ  
     AXQQQ  
     AXXQQQ  
   
455  /--- COMMIT at the start of a pattern should act like an anchor. Again,  /--- COMMIT at the start of a pattern should act like an anchor. Again,
456  however, we need the complication for Perl. ---/  however, we need the complication for Perl. ---/
457    
# Line 495  however, we need the complication for Pe Line 481  however, we need the complication for Pe
481  /(?>(*COMMIT)(yes|no)(*THEN)(*F))?/  /(?>(*COMMIT)(yes|no)(*THEN)(*F))?/
482    yes    yes
483    
 /^((yes|no)(*THEN)(*F))?/  
   yes  
   
484  /b?(*SKIP)c/  /b?(*SKIP)c/
485      bc      bc
486      abc      abc
# Line 670  however, we need the complication for Pe Line 653  however, we need the complication for Pe
653  name)/K  name)/K
654      abc      abc
655    
656    /(?>(?&t)c|(?&t))(?(DEFINE)(?<t>a|b(*PRUNE)c))/
657        a
658        ba
659        bba
660    
661    /--- Checking revised (*THEN) handling ---/
662    
663    /--- Capture ---/
664    
665    /^.*? (a(*THEN)b) c/x
666        aabc
667    
668    /^.*? (a(*THEN)b|(*F)) c/x
669        aabc
670    
671    /^.*? ( (a(*THEN)b) | (*F) ) c/x
672        aabc
673    
674    /^.*? ( (a(*THEN)b) ) c/x
675        aabc
676    
677    /--- Non-capture ---/
678    
679    /^.*? (?:a(*THEN)b) c/x
680        aabc
681    
682    /^.*? (?:a(*THEN)b|(*F)) c/x
683        aabc
684    
685    /^.*? (?: (?:a(*THEN)b) | (*F) ) c/x
686        aabc
687    
688    /^.*? (?: (?:a(*THEN)b) ) c/x
689        aabc
690    
691    /--- Atomic ---/
692    
693    /^.*? (?>a(*THEN)b) c/x
694        aabc
695    
696    /^.*? (?>a(*THEN)b|(*F)) c/x
697        aabc
698    
699    /^.*? (?> (?>a(*THEN)b) | (*F) ) c/x
700        aabc
701    
702    /^.*? (?> (?>a(*THEN)b) ) c/x
703        aabc
704    
705    /--- Possessive capture ---/
706    
707    /^.*? (a(*THEN)b)++ c/x
708        aabc
709    
710    /^.*? (a(*THEN)b|(*F))++ c/x
711        aabc
712    
713    /^.*? ( (a(*THEN)b)++ | (*F) )++ c/x
714        aabc
715    
716    /^.*? ( (a(*THEN)b)++ )++ c/x
717        aabc
718    
719    /--- Possessive non-capture ---/
720    
721    /^.*? (?:a(*THEN)b)++ c/x
722        aabc
723    
724    /^.*? (?:a(*THEN)b|(*F))++ c/x
725        aabc
726    
727    /^.*? (?: (?:a(*THEN)b)++ | (*F) )++ c/x
728        aabc
729    
730    /^.*? (?: (?:a(*THEN)b)++ )++ c/x
731        aabc
732    
733    /--- Condition assertion ---/
734    
735    /^(?(?=a(*THEN)b)ab|ac)/
736        ac
737    
738    /--- Condition ---/
739    
740    /^.*?(?(?=a)a|b(*THEN)c)/
741        ba
742    
743    /^.*?(?:(?(?=a)a|b(*THEN)c)|d)/
744        ba
745    
746    /^.*?(?(?=a)a(*THEN)b|c)/
747        ac
748    
749    /--- Assertion ---/
750    
751    /^.*(?=a(*THEN)b)/
752        aabc
753    
754    /------------------------------/
755    
756    /(?>a(*:m))/imsxSK
757        a
758    
759    /(?>(a)(*:m))/imsxSK
760        a
761    
762    /(?<=a(*ACCEPT)b)c/
763        xacd
764    
765    /(?<=(a(*ACCEPT)b))c/
766        xacd
767    
768    /(?<=(a(*COMMIT)b))c/
769        xabcd
770        ** Failers
771        xacd
772    
773    /(?<!a(*FAIL)b)c/
774        xcd
775        acd
776    
777    /(?<=a(*:N)b)c/K
778        xabcd
779    
780    /(?<=a(*PRUNE)b)c/
781        xabcd
782    
783    /(?<=a(*SKIP)b)c/
784        xabcd
785    
786    /(?<=a(*THEN)b)c/
787        xabcd
788    
789    /(a)(?2){2}(.)/
790        abcd
791    
792    /(*MARK:A)(*PRUNE:B)(C|X)/KS
793        C
794        D
795    
796    /(*MARK:A)(*PRUNE:B)(C|X)/KSS
797        C
798        D
799    
800    /(*MARK:A)(*THEN:B)(C|X)/KS
801        C
802        D
803    
804    /(*MARK:A)(*THEN:B)(C|X)/KSY
805        C
806        D
807    
808    /(*MARK:A)(*THEN:B)(C|X)/KSS
809        C
810        D
811    
812    /--- This should fail, as the skip causes a bump to offset 3 (the skip) ---/
813    
814    /A(*MARK:A)A+(*SKIP)(B|Z) | AC/xK
815        AAAC
816    
817    /--- Same --/
818    
819    /A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/xK
820        AAAC
821    
822    /A(*:A)A+(*SKIP)(B|Z) | AC/xK
823        AAAC
824    
825    /--- This should fail, as a null name is the same as no name ---/
826    
827    /A(*MARK:A)A+(*SKIP:)(B|Z) | AC/xK
828        AAAC
829    
830    /--- A check on what happens after hitting a mark and them bumping along to
831    something that does not even start. Perl reports tags after the failures here,
832    though it does not when the individual letters are made into something
833    more complicated. ---/
834    
835    /A(*:A)B|XX(*:B)Y/K
836        AABC
837        XXYZ
838        ** Failers
839        XAQQ
840        XAQQXZZ
841        AXQQQ
842        AXXQQQ
843    
844    /^(A(*THEN:A)B|C(*THEN:B)D)/K
845        AB
846        CD
847        ** Failers
848        AC
849        CB
850    
851    /^(A(*PRUNE:A)B|C(*PRUNE:B)D)/K
852        AB
853        CD
854        ** Failers
855        AC
856        CB
857    
858    /--- An empty name does not pass back an empty string. It is the same as if no
859    name were given. ---/
860    
861    /^(A(*PRUNE:)B|C(*PRUNE:B)D)/K
862        AB
863        CD
864    
865    /--- PRUNE goes to next bumpalong; COMMIT does not. ---/
866    
867    /A(*PRUNE:A)B/K
868        ACAB
869    
870    /--- Mark names can be duplicated ---/
871    
872    /A(*:A)B|X(*:A)Y/K
873        AABC
874        XXYZ
875    
876    /b(*:m)f|a(*:n)w/K
877        aw
878        ** Failers
879        abc
880    
881    /b(*:m)f|aw/K
882        abaw
883        ** Failers
884        abc
885        abax
886    
887    /A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/xK
888        AAAC
889    
890    /a(*PRUNE:X)bc|qq/KY
891        ** Failers
892        axy
893    
894    /a(*THEN:X)bc|qq/KY
895        ** Failers
896        axy
897    
898    /(?=a(*MARK:A)b)..x/K
899        abxy
900        ** Failers
901        abpq
902    
903    /(?=a(*MARK:A)b)..(*:Y)x/K
904        abxy
905        ** Failers
906        abpq
907    
908    /(?=a(*PRUNE:A)b)..x/K
909        abxy
910        ** Failers
911        abpq
912    
913    /(?=a(*PRUNE:A)b)..(*:Y)x/K
914        abxy
915        ** Failers
916        abpq
917    
918    /(?=a(*THEN:A)b)..x/K
919        abxy
920        ** Failers
921        abpq
922    
923    /(?=a(*THEN:A)b)..(*:Y)x/K
924        abxy
925        ** Failers
926        abpq
927    
928  /-- End of testinput11 --/  /-- End of testinput11 --/

Legend:
Removed from v.651  
changed lines
  Added in v.771

  ViewVC Help
Powered by ViewVC 1.1.5