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

r28952 - docs/Perl6/Spec

0 views
Skip to first unread message

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

unread,
Oct 29, 2009, 4:22:35 PM10/29/09
to perl6-l...@perl.org
Author: lwall
Date: 2009-10-29 21:22:34 +0100 (Thu, 29 Oct 2009)
New Revision: 28952

Modified:
docs/Perl6/Spec/S05-regex.pod
Log:
s/action/actions/ as suggested by pmichaud++


Modified: docs/Perl6/Spec/S05-regex.pod
===================================================================
--- docs/Perl6/Spec/S05-regex.pod 2009-10-29 20:08:52 UTC (rev 28951)
+++ docs/Perl6/Spec/S05-regex.pod 2009-10-29 20:22:34 UTC (rev 28952)
@@ -17,7 +17,7 @@
Created: 24 Jun 2002

Last Modified: 28 Oct 2009
- Version: 105
+ Version: 106

This document summarizes Apocalypse 5, which is about the new regex
syntax. We now try to call them I<regex> rather than "regular
@@ -3787,13 +3787,13 @@
=item *

A string can be matched against a grammar by calling C<.parse> on the grammar,
-and optionally pass an I<action> object to that grammar:
+and optionally pass an I<actions> object to that grammar:

- MyGrammar.parse($str, :action($action-object))
+ MyGrammar.parse($str, :actions($actions-object))

Whenever a closure within the grammar returns a C<Whatever> object, the
grammar engine tries to call a method of the same name as the name of the
-current regex on the action object, passing along the current C<Match>
+current regex on the actions object, passing along the current C<Match>
object as the first positional argument, and the tag of the reduction (if
any) as the second argument. The tag is supplied via a C<#=> comment later
on the same line as the C<{*}>. There must be whitespace between the C<#=>
@@ -3815,7 +3815,7 @@
make 2 * $match.ast;
}
}
- Integer.parse('21', :action(Twice.new)).ast # 42
+ Integer.parse('21', :actions(Twice.new)).ast # 42

A C<{*}> is assumed at the end of every rule, and the method is
called with no tag argument. Note that the implicit C<{*}> is

0 new messages