Skip to content

Instantly share code, notes, and snippets.

@lucasbuchala
Created July 30, 2018 21:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save lucasbuchala/7d51f0f809c0d8b3397d48fc74f76338 to your computer and use it in GitHub Desktop.
Save lucasbuchala/7d51f0f809c0d8b3397d48fc74f76338 to your computer and use it in GitHub Desktop.
use MySlang;
<begin>xxx<end1>
role G {
token term:sym<end1> { '<begin>' ~ '<end1>' \w+ }
token term:sym<end2> { '<begin>' ~ '<end2>' \w+ }
}
role A {
method term:sym<end1>(Mu $/) { say 'end1' }
method term:sym<end2>(Mu $/) { say 'end2' }
}
sub EXPORT {
$*LANG.refine_slang: 'MAIN', G, A;
{};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment