summaryrefslogtreecommitdiff
path: root/testdata/testinput11
diff options
context:
space:
mode:
authorph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2010-03-27 17:45:29 +0000
committerph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2010-03-27 17:45:29 +0000
commit830417cb79946e957b855d50218d64d74562f47c (patch)
tree161e947d9b2552dfbb79ccc5b87674c8c785a983 /testdata/testinput11
parent156c5951245218524c2f59f97eb66a1e48a71eae (diff)
downloadpcre-830417cb79946e957b855d50218d64d74562f47c.tar.gz
Add support for *MARK and names for *PRUNE, *SKIP, *THEN.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@510 2f5784b3-3f2a-0410-8824-cb99058d5e15
Diffstat (limited to 'testdata/testinput11')
-rw-r--r--testdata/testinput1184
1 files changed, 84 insertions, 0 deletions
diff --git a/testdata/testinput11 b/testdata/testinput11
index 3543bf7..43d08f3 100644
--- a/testdata/testinput11
+++ b/testdata/testinput11
@@ -389,4 +389,88 @@
00
0000
+/--- This one does fail, as expected, in Perl. It needs the complex item at the
+ end of the pattern. A single letter instead of (B|D) makes it not fail,
+ which I think is a Perl bug. --- /
+
+/A(*COMMIT)(B|D)/
+ ACABX
+
+/--- Check the use of names for failure ---/
+
+/^(A(*PRUNE:A)B|C(*PRUNE:B)D)/K
+ ** Failers
+ AC
+ CB
+
+/(*MARK:A)(*SKIP:B)(C|X)/K
+ C
+ D
+
+/^(A(*THEN:A)B|C(*THEN:B)D)/K
+ ** Failers
+ CB
+
+/^(?:A(*THEN:A)B|C(*THEN:B)D)/K
+ CB
+
+/^(?>A(*THEN:A)B|C(*THEN:B)D)/K
+ CB
+
+/--- This should succeed, as the skip causes bump to offset 1 (the mark). Note
+that we have to have something complicated such as (B|Z) at the end because,
+for Perl, a simple character somehow causes an unwanted optimization to mess
+with the handling of backtracking verbs. ---/
+
+/A(*MARK:A)A+(*SKIP:A)(B|Z) | AC/xK
+ AAAC
+
+/--- Test skipping over a non-matching mark. ---/
+
+/A(*MARK:A)A+(*MARK:B)(*SKIP:A)(B|Z) | AC/xK
+ AAAC
+
+/--- Check shorthand for MARK ---/
+
+/A(*:A)A+(*SKIP:A)(B|Z) | AC/xK
+ AAAC
+
+/--- This should succeed, as a non-existent skip name disables the skip ---/
+
+/A(*MARK:A)A+(*SKIP:B)(B|Z) | AC/xK
+ AAAC
+
+/A(*MARK:A)A+(*SKIP:B)(B|Z) | AC(*:B)/xK
+ AAAC
+
+/--- 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
+
+/--- COMMIT at the start of a pattern should act like an anchor. Again,
+however, we need the complication for Perl. ---/
+
+/(*COMMIT)(A|P)(B|P)(C|P)/
+ ABCDEFG
+ ** Failers
+ DEFGABC
+
+/--- COMMIT inside an atomic group can't stop backtracking over the group. ---/
+
+/(\w+)(?>b(*COMMIT))\w{2}/
+ abbb
+
+/(\w+)b(*COMMIT)\w{2}/
+ abbb
+
/-- End of testinput11 --/