Skip to content

Instantly share code, notes, and snippets.

@tene
Created March 2, 2012 03:56
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 tene/1955491 to your computer and use it in GitHub Desktop.
Save tene/1955491 to your computer and use it in GitHub Desktop.
Problem with setting ASTs in Perl 6 grammars
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