Skip to content

Instantly share code, notes, and snippets.

@dnmfarrell
Created April 28, 2015 23:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dnmfarrell/47e413f4bd27f2c24eda to your computer and use it in GitHub Desktop.
Save dnmfarrell/47e413f4bd27f2c24eda to your computer and use it in GitHub Desktop.
grammar foo
{
token TOP { ^ .* $ }
}
class bar
{
method TOP ($/)
{
say $/;
'foobar' ~~ m/foobar/;
}
}
my $action = bar.new;
say "Calling parse with positional action class";
foo.parse('foobar', :$action);
say "Calling parse with named action class";
foo.parse('foobar', :actions($action));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment