【发布时间】:2020-01-08 22:50:18
【问题描述】:
我可以通过直接使用令牌名称轻松使用令牌签名:
my token t ( $x ) { $x };
'axb' ~~ / 'a' <t: 'x'> 'b' /; # match
'axb' ~~ / 'a' <t( 'x' )> 'b' /; # match
但是,当令牌存储在变量中时,我还没有找到一种方法:
my $t = token ( $x ) { $x };
'axb' ~~ / 'a' <$t: 'x'> 'b' /;
'axb' ~~ / 'a' <$t( 'x' )> 'b' /;
两者都给出:
===SORRY!=== Error while compiling ...
Unable to parse expression in metachar:sym<assert>; couldn't find final '>'
这样做的神奇语法是什么?
顺便说一句:我什至浏览过 Raku 测试套件,但它不包括 roast/S05-grammar/signatures.t 中的这种情况。
【问题讨论】:
标签: raku