summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2013-11-18 21:30:45 -0800
committerFather Chrysostomos <sprout@cpan.org>2013-11-19 13:00:53 -0800
commit9f57786ad809c9db4556a0b1b57e6fcde8b8ae0b (patch)
tree8e3738b41730702f626d7d716b9234c397f821e6
parent4c99f16d9c16b47be85bbce3942fabfc10f0abbd (diff)
downloadperl-9f57786ad809c9db4556a0b1b57e6fcde8b8ae0b.tar.gz
perldiag: Update descr for ‘Switch condition not recognized’
Originally, the message ‘Switch (?(number%c not recognized’ only applied to /(?(1junk))/. perl-5.6.0-657-gb45f050 changed it to read ‘Switch condition not recognized’. perl-5.8.0-8771-g0a4db38 added (?(<...>)), (?('...')), (?(DEFINE)) and (?(R...)). All of these can trigger that messages if there is junk before the first closing parenthesis (e.g., /(?(<name>junk))/, causing a mismatch between the cases where the error occurs and the descrip- tion in perldiag: (F) If the argument to the (?(...)if-clause|else-clause) con- struct is a number, it can be only a number. The <-- HERE shows whereabouts in the regular expression the problem was discovered. See perlre. (which itself was already confusingly worded). Whether these should be changed to use the more standard ‘Unknown switch condition’ message I don’t want to deal with right now. In any case, the description is only sometimes relevant, so this com- mit just copies the description from ‘Unknown switch condition’.
-rw-r--r--pod/perldiag.pod18
1 files changed, 15 insertions, 3 deletions
diff --git a/pod/perldiag.pod b/pod/perldiag.pod
index c785e95e6e..773c43bdcc 100644
--- a/pod/perldiag.pod
+++ b/pod/perldiag.pod
@@ -5111,9 +5111,21 @@ was discovered. See L<perlre>.
=item Switch condition not recognized in regex; marked by S<<-- HERE> in
m/%s/
-(F) If the argument to the (?(...)if-clause|else-clause) construct is
-a number, it can be only a number. The S<<-- HERE> shows whereabouts in
-the regular expression the problem was discovered. See L<perlre>.
+(F) The condition part of a (?(condition)if-clause|else-clause) construct
+is not known. The condition must be one of the following:
+
+ (1) (2) ... true if 1st, 2nd, etc., capture matched
+ (<NAME>) ('NAME') true if named capture matched
+ (?=...) (?<=...) true if subpattern matches
+ (?!...) (?<!...) true if subpattern fails to match
+ (?{ CODE }) true if code returns a true value
+ (R) true if evaluating inside recursion
+ (R1) (R2) ... true if directly inside capture group 1, 2, etc.
+ (R&NAME) true if directly inside named capture
+ (DEFINE) always false; for defining named subpatterns
+
+The <-- HERE shows whereabouts in the regular expression the problem was
+discovered. See L<perlre>.
=item switching effective %s is not implemented