# New Ticket Created by "Carl Mäsak" # Please include the string: [perl #60922] # in the subject line of all future correspondence about this issue. # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=60922 >
<masak> rakudo: grammar G { token TOP { ^ <foo>+ $ }; token foo { ':' <bar>? }; token bar { \w } }; ":a:b" ~~ G; say ~$/<foo><bar> # is this a bug? shouldn't ~$/<foo><bar> be just 'a' ? <p6eval> rakudo 33354: OUTPUT[:a] <pmichaud> rakudo: grammar G { token TOP { ^ <foo>+ $ }; token foo { ':' <bar>? }; token bar { \w } }; my $m = G::TOP(':a:b'); say $m<foo><bar>; <p6eval> rakudo 33354: OUTPUT[:a] <pmichaud> rakudo: grammar G { token TOP { ^ <foo>+ $ }; token foo { ':' <bar>? }; token bar { \w } }; my $m = G::TOP(':a:b'); say $m<foo>; <p6eval> rakudo 33354: OUTPUT[:a:b] <pmichaud> rakudo: grammar G { token TOP { ^ <foo>+ $ }; token foo { ':' <bar>? }; token bar { \w } }; my $m = G::TOP(':a:b'); say $m<foo><bar>[0]; <p6eval> rakudo 33354: OUTPUT[Use of uninitialized value] <pmichaud> rakudo: grammar G { token TOP { ^ <foo>+ $ }; token foo { ':' <bar>? }; token bar { \w } }; my $m = G::TOP(':a:b'); say $m<foo>[0]<bar>[0]; <p6eval> rakudo 33354: OUTPUT[a] <pmichaud> masak: the problem is that Parrot doesn't distinguish hash access from array access <pmichaud> so $/<foo><bar> is actually the same as $/<foo>[0] <pmichaud> because $/<foo> is an array. <masak> pmichaud: so, is it a bug or not? <pmichaud> yes, but I'm not sure where yet. <masak> pmichaud: I'll report it, then.