Author: lwall Date: 2010-07-09 02:13:08 +0200 (Fri, 09 Jul 2010) New Revision: 31584
Modified: docs/Perl6/Spec/S05-regex.pod Log: [S05] also define how * does multi dispatch inside regexes delete <...> et al. since they're redundant with {...} Modified: docs/Perl6/Spec/S05-regex.pod =================================================================== --- docs/Perl6/Spec/S05-regex.pod 2010-07-08 21:04:28 UTC (rev 31583) +++ docs/Perl6/Spec/S05-regex.pod 2010-07-09 00:13:08 UTC (rev 31584) @@ -16,8 +16,8 @@ Created: 24 Jun 2002 - Last Modified: 11 Jun 2010 - Version: 125 + Last Modified: 8 Jul 2010 + Version: 126 This document summarizes Apocalypse 5, which is about the new regex syntax. We now try to call them I<regex> rather than "regular @@ -1127,7 +1127,7 @@ match. The symbol is specified as part of the "long name". It may also be matched within the rule using C<< <sym> >>, like this: - proto token sigil { } + proto token sigil {*} multi token sigil:sym<$> { <sym> } multi token sigil:sym<@> { <sym> } multi token sigil:sym<%> { <sym> } @@ -1147,6 +1147,13 @@ tie, a normal multiple dispatch is made using the arguments to the remaining variants, assuming they can be differentiated by type. +The proto calls into the subdispatcher when it sees a C<*> that +cannot be a quantifier and is the only thing in its bracket. Therefore +you can put items before and after the subdispatch by putting +the C<*> into square brackets: + +proto token foo { <prestuff> [*] <poststuff> } + =item * The use of a hash variable in patterns is reserved. @@ -1574,15 +1581,6 @@ =item * -The C<< <...> >>, C<< <???> >>, and C<< <!!!> >> special tokens -have the same "not-defined-yet" meanings within regexes that the bare -elipses have in ordinary code. (However, by the recursive rules above, -C<< <!!> >> is equivalent to C<< <?> >>, which matches the null string. -Likewise C<< <!!before x> >> is just like C<< <?before x> >>, except -that it is ignored by the longest-token matcher.) - -=item * - A leading C<*> indicates that the following pattern allows a partial match. It always succeeds after matching as many characters as possible. (It is not zero-width unless 0 characters match.)