Skip to content
Permalink
Browse files

Offer kinder suggestions for placeholder slurpies

...when users try to use them in a method.  *@_ is perfectly acceptable
as a slurpy parameter name, and is often what the user would want to use
  • Loading branch information...
hoelzro committed Oct 26, 2018
1 parent 68b44e3 commit 8549c4c137a225ae02dcce184c1279b26a3edea4
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/Perl6/Actions.nqp
@@ -4324,7 +4324,9 @@ class Perl6::Actions is HLL::Actions does STDActions {
my $placeholder := nqp::shift($placeholders);
my $name := $placeholder<placeholder>;
my $non-placeholder-name;
if $placeholder<named_names> {
if $placeholder<pos_slurpy> || $placeholder<named_slurpy> {
$non-placeholder-name := nqp::concat('*', $name);
} elsif $placeholder<named_names> {
$non-placeholder-name := nqp::concat(':', nqp::concat(nqp::substr($name, 0, 1), nqp::substr($name, 2)));
} else {
$non-placeholder-name := nqp::concat(nqp::substr($name, 0, 1), nqp::substr($name, 2));

0 comments on commit 8549c4c

Please sign in to comment.
You can’t perform that action at this time.