Skip to content

Instantly share code, notes, and snippets.

@smls
Last active August 29, 2015 14:22
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 smls/1d6cf6af547f7f7cfba5 to your computer and use it in GitHub Desktop.
Save smls/1d6cf6af547f7f7cfba5 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl6
grammar Foo {
token TOP { <custom(42)> "a" }
method custom ($cursor: $n) {
# say $cursor.^mro;
# say $cursor.^methods>>.name;
return $cursor;
}
}
say Foo.parse("a");
P6opaque: no such attribute '$!pos'
in regex TOP at ./01_grammar_custom_method.p6:4
in block <unit> at ./01_grammar_custom_method.p6:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment