Skip to content

Instantly share code, notes, and snippets.

@lucs

lucs/gram27.p6 Secret

Created June 7, 2020 03:56
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 lucs/b36066f1ade144767d9050af6bd97e36 to your computer and use it in GitHub Desktop.
Save lucs/b36066f1ade144767d9050af6bd97e36 to your computer and use it in GitHub Desktop.
grammar G { token TOP { \w } }
class A { method TOP ($/) { make uc ~$/ } }
my $m = G.parse('f');
say A.new.TOP: $m; # Prints 'F␤'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment