-
-
Save jnthn/f26b1ed53e6ee12d7f2f88256523af0e 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 Parser { | |
token TOP { <matcher>+ } | |
proto token matcher { * } | |
token matcher:sym<[]> { '[' <( <-[\]]>+ )> ']' } | |
token matcher:sym<lit> { <-[/*?[]>+ } | |
} | |
class RuleCompiler { | |
# Simply commenting out this causes the matcher:sym<lit> to get the .txt it should. With | |
# this, it gets ].txt instead. | |
method matcher:sym<[]>($/) { } | |
} | |
say Parser.parse('[AB].txt', :actions(RuleCompiler)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment