4
在How can I pass arguments to a Perl 6 grammar?我作爲submerse的一部分傳遞了一個規則的參數。我想知道如何在語法中完全做到這一點。假設我有這樣的事情:Perl 6規則如何將參數傳遞給另一個規則?
grammar TryIt {
rule TOP { \d+ <stuff> }
rule stuff ($count) { <[ \S A..Z ]>{$count} }
}
my $match = TryIt.parse: "123 ABCD";
say $match;
我如何通過從TOP
到stuff
參數?我沒有找到任何例子,並且關於附近人物的各種猜測都沒有奏效。