Last active
December 20, 2015 05:39
-
-
Save gfldex/6079954 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 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