Created
March 2, 2012 03:56
-
-
Save tene/1955491 to your computer and use it in GitHub Desktop.
Problem with setting ASTs in Perl 6 grammars
This file contains hidden or 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 element { | |
| 'a' <element> { make 'a' ~ $<element>.ast } | |
| ';' { make ';' } | |
} | |
} | |
my $m = Foo.parse("aaaa;", :rule('element')); | |
say $m.gist; | |
say $m.ast; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment