Raku / old-issue-tracker

Tickets from RT
https://github.com/Raku/old-issue-tracker/issues
2 stars 1 forks source link

%(:a:b) ignores all elements after the first one #4308

Open p6rt opened 9 years ago

p6rt commented 9 years ago

Migrated from rt.perl.org#125353 (status was 'open')

Searchable as RT125353$

p6rt commented 9 years ago

From @raydiak

19​:52​:25 raydiak | m​: say (​:a(1)​:b(2)).hash; say %(​:a(1)​:b(2)); say %(​:a(1),​:b(2)) 19​:52​:26 +camelia | rakudo-moar 442a56​: OUTPUT«a => 1, b => 2␤a => 1␤a => 1, b => 2␤»

p6rt commented 9 years ago

From @hoelzro

On 2015-06-07 13​:01​:49, raydiak@​cyberuniverses.com wrote​:

19​:52​:25 raydiak | m​: say (​:a(1)​:b(2)).hash; say %(​:a(1)​:b(2)); say %(​:a(1),​:b(2)) 19​:52​:26 +camelia | rakudo-moar 442a56​: OUTPUT«a => 1, b => 2␤a => 1␤a => 1, b => 2␤»

I believe the reason behind this is that contextualizers (such as %(...)) are not parsed with the normal () rule, and not handled by the circumfix​:sym\<( )> action method. They have their own parsing logic here​:

https://github.com/rakudo/rakudo/blob/164f1e070154bbb80a27d312be15de948fc8db81/src/Perl6/Grammar.nqp#L1917

...and the corresponding action method (found at https://github.com/rakudo/rakudo/blob/a927a5a2c7570cc2c78ea69e8b0eff3b26cf48a5/src/Perl6/Actions.nqp#L1777) does not invoke &infix​:\<,> like https://github.com/rakudo/rakudo/blob/a927a5a2c7570cc2c78ea69e8b0eff3b26cf48a5/src/Perl6/Actions.nqp#L4968 does.

p6rt commented 9 years ago

The RT System itself - Status changed from 'new' to 'open'

p6rt commented 6 years ago

From @AlexDaniel

Still reproducible (2017.11,HEAD(e5b660e))

On 2015-06-07 13​:01​:49, raydiak@​cyberuniverses.com wrote​:

19​:52​:25 raydiak | m​: say (​:a(1)​:b(2)).hash; say %(​:a(1)​:b(2)); say %(​:a(1),​:b(2)) 19​:52​:26 +camelia | rakudo-moar 442a56​: OUTPUT«a => 1, b => 2␤a => 1␤a => 1, b => 2␤»