# New Ticket Created by  Joshua 
# Please include the string:  [perl #131847]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=131847 >


An array of tokens used to be able to match like this: 

my token foo { 'foo' };
my token bar { 'bar' };
my token baz { 'baz' };
my @tokens = /<foo>/, /<bar>/, /<baz>/;
say 'foo bar baz' ~~ / ^ <{ @tokens[$++] }> ** { +@tokens } % <.ws> $ /;

OUTPUT: 「foo bar baz」

This no longer work since commit 7a456ff80183a6e26dc91d811d992112c68ddb6d

You can simulate how it should work by providing your own state variable

state $i = 0;
say 'foo bar baz' ~~ / ^ <{ @tokens[$i++] }> ** { +@tokens } % <.ws> $ /;

Reply via email to