Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

r28957 - docs/Perl6/Spec

0 views
Skip to first unread message

pugs-c...@feather.perl6.nl

unread,
Oct 30, 2009, 1:56:13 PM10/30/09
to perl6-l...@perl.org
Author: lwall
Date: 2009-10-30 18:56:12 +0100 (Fri, 30 Oct 2009)
New Revision: 28957

Modified:
docs/Perl6/Spec/S05-regex.pod
Log:
[S05]
document reversed character range compilation failure
clarify what happens if an indirect rule fails to compile


Modified: docs/Perl6/Spec/S05-regex.pod
===================================================================
--- docs/Perl6/Spec/S05-regex.pod 2009-10-30 17:47:50 UTC (rev 28956)
+++ docs/Perl6/Spec/S05-regex.pod 2009-10-30 17:56:12 UTC (rev 28957)
@@ -16,8 +16,8 @@

Created: 24 Jun 2002

- Last Modified: 28 Oct 2009
- Version: 106
+ Last Modified: 30 Oct 2009
+ Version: 107

This document summarizes Apocalypse 5, which is about the new regex
syntax. We now try to call them I<regex> rather than "regular
@@ -1238,9 +1238,14 @@
either a C<Regex> object, or a string to be compiled as the regex. The
string is never matched literally.

-Such an assertion is not captured. (No assertion with leading punctuation
-is captured by default.) You may always capture it explicitly, of course.
+If the compilation of the string form fails, the error message is converted
+to a warning and the assertion fails.

+The indirect subrule assertion is not captured. (No assertion with leading punctuation
+is captured by default.) You may always capture it explicitly, of course:
+
+ / <name=$rx> /
+
A subrule is considered declarative to the extent that the front of it
is declarative, and to the extent that the variable doesn't change.
Prefix with a sequence point to defeat repeated static optimizations.
@@ -1336,8 +1341,18 @@

Whitespace is ignored within square brackets:

- / <[ a..z _ ]>* /
+ / <[ a .. z _ ]>* /

+A reversed range is illegal. In directly compiled code it's a compile-time
+error to say
+
+ / <[ z .. a ]> / # Reversed range is not allowed
+
+In indirectly compiled code, a similar warning is issued and the assertion fails:
+
+ $rx = '<[ z .. a ]>';
+ / <$rx> /; # warns and never matches
+
=item *

A leading C<-> indicates a complemented character class:

0 new messages