Author: masak
Date: 2009-12-06 04:38:03 +0100 (Sun, 06 Dec 2009)
New Revision: 29268

Modified:
   docs/Perl6/Spec/S05-regex.pod
Log:
[S05] further corrections by uasi++

Modified: docs/Perl6/Spec/S05-regex.pod
===================================================================
--- docs/Perl6/Spec/S05-regex.pod       2009-12-06 02:53:21 UTC (rev 29267)
+++ docs/Perl6/Spec/S05-regex.pod       2009-12-06 03:38:03 UTC (rev 29268)
@@ -17,7 +17,7 @@
     Created: 24 Jun 2002
 
     Last Modified: 6 Dec 2009
-    Version: 113
+    Version: 114
 
 This document summarizes Apocalypse 5, which is about the new regex
 syntax.  We now try to call them I<regex> rather than "regular
@@ -3793,14 +3793,14 @@
 
    grammar Integer {
        token TOP {
-           | 0b<[01]>+ {*}  #= binary
-           | \d+       {*}  #= decimal
+           | 0b(<[01]>+) {*}  #= binary
+           | \d+         {*}  #= decimal
        }
    }
    class Twice {
        multi method TOP($/, $tag) {
-           my $text = $tag eq 'binary' ?? :2($0) !! ~$/;
-           make $text;
+           my $value = $tag eq 'binary' ?? :2($0) !! +$/;
+           make 2 * $value;
        }
    }
    say Integer.parse('21',      :actions(Twice.new)).ast;  # 42

Reply via email to