On Fri, May 21, 2010 at 1:59 PM, David Green <david.gr...@telus.net> wrote:

>
> I wanted to check that named regexes aren't in Rakudo yet -- I get "Useless
> declaration of has-scoped regex in a module".
>
>
>
That's going to be a common first hurdle, I can see.

I ran into the same thing writing a IRI parser. Here's a way you can do
this:

# Totally from memory, someone correct me if I'm wrong:
grammar X {
  token TOP { <matchmything> }
  token matchmything { .* }
}

if X.parse("stuff") {
  say "My thing: ", $/<matchmything>;
}

The magical "TOP" is the entry point that .parse will call automatically.

-- 
Aaron Sherman
Email or GTalk: a...@ajs.com
http://www.ajs.com/~ajs

Reply via email to