diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2000-03-03 02:19:50 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2000-03-03 02:19:50 +0000 |
commit | 14455d6cc193f1e4316f87b9dbe258db24ceb714 (patch) | |
tree | 0722cfd9590d6e717d6a7f06bbb534593146dee6 | |
parent | 36f31b5005f0d5567cbdeeea5b6180abf2936b23 (diff) | |
download | perl-14455d6cc193f1e4316f87b9dbe258db24ceb714.tar.gz |
/(?p{})/ changed to /(??{})/, per Larry's suggestion (from
Simon Cozens <simon@othersideofthe.earth.li>)
p4raw-id: //depot/perl@5467
-rw-r--r-- | lib/AutoSplit.pm | 2 | ||||
-rwxr-xr-x | lib/ExtUtils/xsubpp | 16 | ||||
-rw-r--r-- | lib/SelfLoader.pm | 2 | ||||
-rw-r--r-- | pod/perlre.pod | 6 | ||||
-rw-r--r-- | pod/perltoc.pod | 4 | ||||
-rw-r--r-- | regcomp.c | 2 | ||||
-rwxr-xr-x | t/op/misc.t | 2 | ||||
-rwxr-xr-x | t/op/pat.t | 6 | ||||
-rw-r--r-- | toke.c | 2 |
9 files changed, 21 insertions, 21 deletions
diff --git a/lib/AutoSplit.pm b/lib/AutoSplit.pm index ecdb039987..0be3ae6765 100644 --- a/lib/AutoSplit.pm +++ b/lib/AutoSplit.pm @@ -148,7 +148,7 @@ my $Is_VMS = ($^O eq 'VMS'); # allow checking for valid ': attrlist' attachments my $nested; -$nested = qr{ \( (?: (?> [^()]+ ) | (?p{ $nested }) )* \) }x; +$nested = qr{ \( (?: (?> [^()]+ ) | (??{ $nested }) )* \) }x; my $one_attr = qr{ (?> (?! \d) \w+ (?:$nested)? ) (?:\s*\:\s*|\s+(?!\:)) }x; my $attr_list = qr{ \s* : \s* (?: $one_attr )* }x; diff --git a/lib/ExtUtils/xsubpp b/lib/ExtUtils/xsubpp index 49d167dc0b..ff66b22a7d 100755 --- a/lib/ExtUtils/xsubpp +++ b/lib/ExtUtils/xsubpp @@ -249,9 +249,9 @@ foreach $key (keys %input_expr) { $input_expr{$key} =~ s/\n+$//; } -$bal = qr[(?:(?>[^()]+)|\((?p{ $bal })\))*]; # ()-balanced +$bal = qr[(?:(?>[^()]+)|\((??{ $bal })\))*]; # ()-balanced $cast = qr[(?:\(\s*SV\s*\*\s*\)\s*)?]; # Optional (SV*) cast -$size = qr[,\s* (?p{ $bal }) ]x; # Third arg (to setpvn) +$size = qr[,\s* (??{ $bal }) ]x; # Third arg (to setpvn) foreach $key (keys %output_expr) { use re 'eval'; @@ -260,8 +260,8 @@ foreach $key (keys %output_expr) { ($output_expr{$key} =~ m[^ \s+ sv_set ( [iunp] ) v (n)? # Type, is_setpvn \s* \( \s* $cast \$arg \s* , - \s* ( (?p{ $bal }) ) # Set from - ( (?p{ $size }) )? # Possible sizeof set-from + \s* ( (??{ $bal }) ) # Set from + ( (??{ $size }) )? # Possible sizeof set-from \) \s* ; \s* $ ]x); $targetable{$key} = [$t, $with_size, $arg, $sarg] if $t; @@ -287,11 +287,11 @@ sub check_keyword { my ($C_group_rex, $C_arg); # Group in C (no support for comments or literals) $C_group_rex = qr/ [({\[] - (?: (?> [^()\[\]{}]+ ) | (?p{ $C_group_rex }) )* + (?: (?> [^()\[\]{}]+ ) | (??{ $C_group_rex }) )* [)}\]] /x ; # Chunk in C without comma at toplevel (no comments): $C_arg = qr/ (?: (?> [^()\[\]{},"']+ ) - | (?p{ $C_group_rex }) + | (??{ $C_group_rex }) | " (?: (?> [^\\"]+ ) | \\. )* " # String literal @@ -1029,8 +1029,8 @@ while (fetch_para()) { my %out_vars; if ($process_argtypes and $orig_args =~ /\S/) { my $args = "$orig_args ,"; - if ($args =~ /^( (?p{ $C_arg }) , )* $ /x) { - @args = ($args =~ /\G ( (?p{ $C_arg }) ) , /xg); + if ($args =~ /^( (??{ $C_arg }) , )* $ /x) { + @args = ($args =~ /\G ( (??{ $C_arg }) ) , /xg); for ( @args ) { s/^\s+//; s/\s+$//; diff --git a/lib/SelfLoader.pm b/lib/SelfLoader.pm index 2aa29303fd..ff441c72dd 100644 --- a/lib/SelfLoader.pm +++ b/lib/SelfLoader.pm @@ -11,7 +11,7 @@ my %Cache; # private cache for all SelfLoader's client packages # allow checking for valid ': attrlist' attachments my $nested; -$nested = qr{ \( (?: (?> [^()]+ ) | (?p{ $nested }) )* \) }x; +$nested = qr{ \( (?: (?> [^()]+ ) | (??{ $nested }) )* \) }x; my $one_attr = qr{ (?> (?! \d) \w+ (?:$nested)? ) (?:\s*\:\s*|\s+(?!\:)) }x; my $attr_list = qr{ \s* : \s* (?: $one_attr )* }x; diff --git a/pod/perlre.pod b/pod/perlre.pod index d2f64d2eb6..52eac04a34 100644 --- a/pod/perlre.pod +++ b/pod/perlre.pod @@ -570,7 +570,7 @@ so you should only do so if you are also using taint checking. Better yet, use the carefully constrained evaluation within a Safe module. See L<perlsec> for details about both these mechanisms. -=item C<(?p{ code })> +=item C<(??{ code })> B<WARNING>: This extended regular expression feature is considered highly experimental, and may be changed or deleted without notice. @@ -592,7 +592,7 @@ The following pattern matches a parenthesized group: (?: (?> [^()]+ ) # Non-parens without backtracking | - (?p{ $re }) # Group with matching parens + (??{ $re }) # Group with matching parens )* \) }x; @@ -1175,7 +1175,7 @@ else in the whole regular expression.) For this grouping operator there is no need to describe the ordering, since only whether or not C<S> can match is important. -=item C<(?p{ EXPR })> +=item C<(??{ EXPR })> The ordering is the same as for the regular expression which is the result of EXPR. diff --git a/pod/perltoc.pod b/pod/perltoc.pod index 83d40d4241..0a67fdc232 100644 --- a/pod/perltoc.pod +++ b/pod/perltoc.pod @@ -1648,7 +1648,7 @@ cntrl, graph, print, punct, xdigit C<(?#text)>, C<(?imsx-imsx)>, C<(?:pattern)>, C<(?imsx-imsx:pattern)>, C<(?=pattern)>, C<(?!pattern)>, C<(?E<lt>=pattern)>, C<(?<!pattern)>, C<(?{ -code })>, C<(?p{ code })>, C<(?E<gt>pattern)>, +code })>, C<(??{ code })>, C<(?E<gt>pattern)>, C<(?(condition)yes-pattern|no-pattern)>, C<(?(condition)yes-pattern)> =item Backtracking @@ -1663,7 +1663,7 @@ C<(?(condition)yes-pattern|no-pattern)>, C<(?(condition)yes-pattern)> C<ST>, C<S|T>, C<S{REPEAT_COUNT}>, C<S{min,max}>, C<S{min,max}?>, C<S?>, C<S*>, C<S+>, C<S??>, C<S*?>, C<S+?>, C<(?E<gt>S)>, C<(?=S)>, C<(?<=S)>, -C<(?!S)>, C<(?<!S)>, C<(?p{ EXPR })>, +C<(?!S)>, C<(?<!S)>, C<(??{ EXPR })>, C<(?(condition)yes-pattern|no-pattern)> =item Creating custom RE engines @@ -1734,7 +1734,7 @@ S_reg(pTHX_ I32 paren, I32 *flagp) nextchar(); *flagp = TRYAGAIN; return NULL; - case 'p': + case '?': logical = 1; paren = *PL_regcomp_parse++; /* FALL THROUGH */ diff --git a/t/op/misc.t b/t/op/misc.t index b46c0ccb54..a595694e9b 100755 --- a/t/op/misc.t +++ b/t/op/misc.t @@ -482,7 +482,7 @@ new1new22DESTROY2new33DESTROY31DESTROY1 ######## re(); sub re { - my $re = join '', eval 'qr/(?p{ $obj->method })/'; + my $re = join '', eval 'qr/(??{ $obj->method })/'; $re; } EXPECT diff --git a/t/op/pat.t b/t/op/pat.t index 142b82e2ad..103e6132b5 100755 --- a/t/op/pat.t +++ b/t/op/pat.t @@ -370,7 +370,7 @@ print "ok $test\n"; $test++; my $matched; -$matched = qr/\((?:(?>[^()]+)|(?p{$matched}))*\)/; +$matched = qr/\((?:(?>[^()]+)|(??{$matched}))*\)/; @ans = @ans1 = (); push(@ans, $res), push(@ans1, $&) while $res = m/$matched/g; @@ -866,7 +866,7 @@ print "ok $test\n"; $test++; $brackets = qr{ - { (?> [^{}]+ | (?p{ $brackets }) )* } + { (?> [^{}]+ | (??{ $brackets }) )* } }x; "{{}" =~ $brackets; @@ -877,7 +877,7 @@ $test++; print "ok $test\n"; # Did we survive? $test++; -"something { long { and } hairy" =~ m/((?p{ $brackets }))/; +"something { long { and } hairy" =~ m/((??{ $brackets }))/; print "not " unless $1 eq "{ and }"; print "ok $test\n"; $test++; @@ -1270,7 +1270,7 @@ S_scan_const(pTHX_ char *start) while (s < send && *s != ')') *d++ = *s++; } else if (s[2] == '{' - || s[2] == 'p' && s[3] == '{') { /* This should march regcomp.c */ + || s[2] == '?' && s[3] == '{') { /* This should march regcomp.c */ I32 count = 1; char *regparse = s + (s[2] == '{' ? 3 : 4); char c; |