Skip to content

Instantly share code, notes, and snippets.

@gfldex
Last active December 20, 2015 05:39
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 gfldex/6079954 to your computer and use it in GitHub Desktop.
Save gfldex/6079954 to your computer and use it in GitHub Desktop.
grammar Confusion {
token TOP { ^ <element> $ }
rule element { <name> <list> }
rule list { '(' ~ ')' [ <name> ]+ % ',' }
rule name { \w+ }
}
class Build {
method element ($/) { }
# method list ($/) { }
}
say Confusion.parse('html (head, body)', :actions(Build));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment