On Thu, May 11, 2006 at 12:19:21PM -0700, Allison Randal wrote:
> Jonathan Scott Duff wrote:
> >On Wed, May 10, 2006 at 05:58:57PM -0700, Allison Randal wrote:
> >>rule:
> >>- Has :ratchet and :skip turned on by default
> >>
> >>- May only be used inside a grammar
> >
> >Should that be 
> >
> >- Must be declared as part of a grammar or role
> >
> >???
> 
> It is:
> 
> - The 'rule' keyword may only be used inside a grammar

So, just to be clear, does that mean that the following holds:

     # assume no surrounding grammar-context
     rule foo { ... }           # compile-time error, no grammar
     my $ar = rule { ... }      # compile-time error, no grammar

     grammar Foo;
     rule bar { ... }           # legal, Foo::bar rule
     my $ar = rule { ... }      # legal, Foo::ANON rule

     # assume no surrounding grammar-context
     rule Foo::bar { ... }                      # legal, Foo::bar rule
     my $ar = grammar Foo { rule { ... } }      # legal, Foo::ANON rule

And the way to get a grammarless rule is to use either rx or regex with
the appropriate modifiers.

-Scott
-- 
Jonathan Scott Duff
[EMAIL PROTECTED]

Reply via email to