Skip to content

Instantly share code, notes, and snippets.

@tadzik
Created November 6, 2011 12:03
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save tadzik/1342787 to your computer and use it in GitHub Desktop.
grammar foo {
token TOP {
<tok> ** ','
}
token tok {
\d+
}
}
class foo::actions {
method TOP($/) {
say $/.keys.perl;
}
}
my $a = "1,2,33,4";
my $b = foo.parse($a, :actions(foo::actions.new));
# outputs: ().list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment