diff options
author | Yves Orton <demerphq@gmail.com> | 2022-02-23 07:06:22 +0100 |
---|---|---|
committer | Yves Orton <demerphq@gmail.com> | 2022-03-03 13:41:13 +0100 |
commit | c15a34bfb4f54341de8e463d45b5bcbaad235350 (patch) | |
tree | 5288024972be2d68d0219cd82e0631b244ca73a1 /t | |
parent | 8b837871cb596783ce0f75fa272db2061b465e27 (diff) | |
download | perl-c15a34bfb4f54341de8e463d45b5bcbaad235350.tar.gz |
regcomp.c: Reduce scope of experimental warnings with lookbehind
The only case where we need to warn about variable length lookbehind is
when capturing buffers are involved.
Diffstat (limited to 't')
-rw-r--r-- | t/re/reg_mesg.t | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/t/re/reg_mesg.t b/t/re/reg_mesg.t index 17b337a537..f5910a04cc 100644 --- a/t/re/reg_mesg.t +++ b/t/re/reg_mesg.t @@ -142,6 +142,7 @@ my @death = '/(?<= a{200}b{55})/' => 'Lookbehind longer than 255 not implemented in regex m/(?<= a{200}b{55})/', '/(?<= x{1000})/' => 'Lookbehind longer than 255 not implemented in regex m/(?<= x{1000})/', + '/(?<= (?&x))(?<x>x+)/' => 'Lookbehind longer than 255 not implemented in regex m/(?<= (?&x))(?<x>x+)/', '/(?@)/' => 'Sequence (?@...) not implemented {#} m/(?@{#})/', @@ -733,6 +734,25 @@ my @experimental_regex_sets = ( '/noutf8 ネ (?[ [\tネ] ])/' => 'The regex_sets feature is experimental {#} m/noutf8 ネ (?[{#} [\tネ] ])/', ); +my @experimental_vlb = ( + '/(?<=(p|qq|rrr))/' => 'Variable length positive lookbehind with capturing' . + ' is experimental {#} m/(?<=(p|qq|rrr)){#}/', + '/(?<!(p|qq|rrr))/' => 'Variable length negative lookbehind with capturing' . + ' is experimental {#} m/(?<!(p|qq|rrr)){#}/', + '/(?| (?=(foo)) | (?<=(foo)|p) )/' + => 'Variable length positive lookbehind with capturing' . + ' is experimental {#} m/(?| (?=(foo)) | (?<=(foo)|p) ){#}/', + '/(?| (?=(foo)) | (?<=(foo)|p) )/x' + => 'Variable length positive lookbehind with capturing' . + ' is experimental {#} m/(?| (?=(foo)) | (?<=(foo)|p) ){#}/', + '/(?| (?=(foo)) | (?<!(foo)|p) )/' + => 'Variable length negative lookbehind with capturing' . + ' is experimental {#} m/(?| (?=(foo)) | (?<!(foo)|p) ){#}/', + '/(?| (?=(foo)) | (?<!(foo)|p) )/x' + => 'Variable length negative lookbehind with capturing' . + ' is experimental {#} m/(?| (?=(foo)) | (?<!(foo)|p) ){#}/', +); + my @wildcard = ( 'm!(?[\p{name=/KATAKANA/}])$!' => [ @@ -829,11 +849,13 @@ for my $strict ("", "no warnings 'experimental::re_strict'; use re 'strict';") } } - foreach my $ref (\@warning_tests, - \@experimental_regex_sets, - \@wildcard, - \@deprecated) - { + foreach my $ref ( + \@warning_tests, + \@experimental_regex_sets, + \@wildcard, + \@deprecated, + \@experimental_vlb, + ){ my $warning_type; my $turn_off_warnings = ""; my $default_on; @@ -854,6 +876,10 @@ for my $strict ("", "no warnings 'experimental::re_strict'; use re 'strict';") $warning_type = 'experimental::regex_sets, experimental::uniprop_wildcards'; $default_on = 1; } + elsif ($ref == \@experimental_vlb) { + $warning_type = 'experimental::vlb'; + $default_on = 1; + } else { fail("$0: Internal error: Unexpected loop variable"); } |