[prev in list] [next in list] [prev in thread] [next in thread] 

List:       perl6-language
Subject:    r28957 - docs/Perl6/Spec
From:       pugs-commits () feather ! perl6 ! nl
Date:       2009-10-30 17:56:13
Message-ID: 20091030175613.630.qmail () feather ! perl6 ! nl
[Download RAW message or body]

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:

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic