mirror of
https://github.com/boostorg/regex.git
synced 2025-07-02 07:10:58 +02:00
Add recursive implementation of THEN.
This commit is contained in:
@ -1000,63 +1000,4 @@ void test_verbs()
|
||||
TEST_REGEX_SEARCH("(?:a+(*THEN)\\w{6}|x\\w{3})", perl, "aaaxxxxx", match_default, make_array(3, 7, -2, -2));
|
||||
TEST_REGEX_SEARCH("(?>(*COMMIT)(?>yes|no)(*THEN)(*F))?", perl, "yes", match_default, make_array(-2, -2));
|
||||
TEST_REGEX_SEARCH("(?>(*COMMIT)(yes|no)(*THEN)(*F))?", perl, "yes", match_default, make_array(-2, -2));
|
||||
|
||||
|
||||
#if 0
|
||||
|
||||
|
||||
# Check the use of names for failure
|
||||
|
||||
/^(A(*PRUNE:A)B|C(*PRUNE:B)D)/mark
|
||||
** Failers
|
||||
AC
|
||||
CB
|
||||
|
||||
/(*MARK:A)(*SKIP:B)(C|X)/mark
|
||||
C
|
||||
D
|
||||
|
||||
/^(A(*THEN:A)B|C(*THEN:B)D)/mark
|
||||
** Failers
|
||||
CB
|
||||
|
||||
/^(?:A(*THEN:A)B|C(*THEN:B)D)/mark
|
||||
CB
|
||||
|
||||
/^(?>A(*THEN:A)B|C(*THEN:B)D)/mark
|
||||
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/x,mark
|
||||
AAAC
|
||||
|
||||
# Test skipping over a non-matching mark.
|
||||
|
||||
/A(*MARK:A)A+(*MARK:B)(*SKIP:A)(B|Z) | AC/x,mark
|
||||
AAAC
|
||||
|
||||
# Check shorthand for MARK.
|
||||
|
||||
/A(*:A)A+(*SKIP:A)(B|Z) | AC/x,mark
|
||||
AAAC
|
||||
|
||||
/(*:A)A+(*SKIP:A)(B|Z)/mark
|
||||
AAAC
|
||||
|
||||
# This should succeed, as a non-existent skip name disables the skip.
|
||||
|
||||
/A(*MARK:A)A+(*SKIP:B)(B|Z) | AC/x,mark
|
||||
AAAC
|
||||
|
||||
/A(*MARK:A)A+(*SKIP:B)(B|Z) | AC(*:B)/x,mark
|
||||
AAAC
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user