Skip to content

Commit

Permalink
Test token ::($method) {...}.
Browse files Browse the repository at this point in the history
  • Loading branch information
pmurias committed Apr 5, 2016
1 parent 875e3ad commit f0939b3
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion t/nqp/66-pararole.t
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
plan(6);
plan(7);

role ParaTest[$a] {
method m() { $a }
Expand Down Expand Up @@ -38,3 +38,15 @@ role AnotherFoo[$x] {
ok(LolGrammar.parse('abc') eq 'a', "parametric mixin/grammar/LTM interaction (sanity)");
my $derived := LolGrammar.HOW.mixin(LolGrammar, AnotherFoo.HOW.curry(AnotherFoo, 'ab'));
ok($derived.parse('abc') eq 'ab', "parametric mixin/grammar/LTM interaction");


grammar LolerGrammar {
token TOP { <foo> }
proto token foo {*}
token foo:sym<a> { <sym> }
}
role YetAnotherFoo[$method, $x] {
token ::($method) { $x }
}
my $both := LolerGrammar.HOW.mixin(LolerGrammar, YetAnotherFoo.HOW.curry(YetAnotherFoo, 'foo:sym<more>', 'ab'));
ok($both.parse('abc') eq 'ab', "parametric mixin/grammar/LTM interaction with parametrized method name");

0 comments on commit f0939b3

Please sign in to comment.