Created
January 7, 2011 20:39
-
-
Save moritz/770063 to your computer and use it in GitHub Desktop.
Match.pretty output
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 Color { | |
regex blue { :i "blue" } | |
regex green { :i "green" } | |
regex TOP { [<blue> | <green>] <rest> } | |
token rest { ' ' <alpha>+ } | |
} | |
my $match = Color.parse("Blue skies"); | |
say $match.pretty; |
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
=> <Blue skies> | |
blue => <Blue> | |
rest => < skies> | |
alpha => <s> | |
alpha => <k> | |
alpha => <i> | |
alpha => <e> | |
alpha => <s> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment