Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use nqp;
- use QAST:from<NQP>;
- # Slang to make "dog" a synonym for "do"
- role Dogdo::Grammar {
- token statement_prefix:sym<dog> { <sym><.kok> <blorst> }
- }
- role Dogdo::Actions {
- method statement_prefix:sym<dog>(Mu $/) {
- say $/.dump;
- make QAST::Op.new( :op('call'), $<blorst>.ast );
- }
- }
- sub EXPORT {
- nqp::bindkey(%*LANG, 'MAIN', %*LANG<MAIN>.HOW.mixin(%*LANG<MAIN>, Dogdo::Grammar));
- nqp::bindkey(%*LANG, 'MAIN-actions', %*LANG<MAIN-actions>.HOW.mixin(%*LANG<MAIN-actions>, Dogdo::Actions));
- {}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement