Skip to content

Instantly share code, notes, and snippets.

@moritz
Created January 7, 2011 20:39
Show Gist options
  • Save moritz/770063 to your computer and use it in GitHub Desktop.
Save moritz/770063 to your computer and use it in GitHub Desktop.
Match.pretty output
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;
=> <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