Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@tadzik
Created November 6, 2011 12:03
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 tadzik/1342787 to your computer and use it in GitHub Desktop.
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