Created
April 28, 2015 23:00
-
-
Save dnmfarrell/47e413f4bd27f2c24eda to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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