develooper Front page | perl.perl6.language | Postings from August 2010

r31964 -[S05] saner defaults for :c and :p; without a previous match, $/.to blows up

From:
pugs-commits
Date:
August 12, 2010 01:03
Subject:
r31964 -[S05] saner defaults for :c and :p; without a previous match, $/.to blows up
Message ID:
20100812080306.23643.qmail@feather.perl6.nl
Author: moritz
Date: 2010-08-12 10:02:42 +0200 (Thu, 12 Aug 2010)
New Revision: 31964

Modified:
   docs/Perl6/Spec/S05-regex.pod
Log:
[S05] saner defaults for :c and :p; without a previous match, $/.to blows up

Modified: docs/Perl6/Spec/S05-regex.pod
===================================================================
--- docs/Perl6/Spec/S05-regex.pod	2010-08-12 06:47:06 UTC (rev 31963)
+++ docs/Perl6/Spec/S05-regex.pod	2010-08-12 08:02:42 UTC (rev 31964)
@@ -278,7 +278,7 @@
 =item *
 
 The C<:c> (or C<:continue>) modifier causes the pattern to continue
-scanning from the specified position (defaulting to C<$/.to>):
+scanning from the specified position (defaulting to C<($/ ?? $/.to !! 0)>):
 
      m:c($p)/ pattern /     # start scanning at position $p
 
@@ -296,7 +296,7 @@
 
      m:pos($p)/ pattern /  # match at position $p
 
-If the argument is omitted, it defaults to C<$/.to>.  (Unlike in
+If the argument is omitted, it defaults to C<($/ ?? $/.to !! 0)>.  (Unlike in
 PerlĀ 5, the string itself has no clue where its last match ended.)
 All subrule matches are implicitly passed their starting position.
 Likewise, the pattern you supply to a Perl macro's C<is parsed>




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About