Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
move check for post decl placeholder to add_param helper
This is a more direct theft^Wtranslation of std, and it will show the eject near the
polaceholder and not right after the entire block/routine the placeholder is in.
  • Loading branch information
FROGGS committed Dec 21, 2014
1 parent e2adfae commit c0dd8ae
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/Perl6/Actions.nqp
Expand Up @@ -2397,15 +2397,6 @@ class Perl6::Actions is HLL::Actions does STDActions {
[];
}
my @params := %sig_info<parameters>;
for @params -> {
if $block.ann('also_uses') && $block.ann('also_uses'){$_<variable_name>} {
$*W.throw($/, ['X', 'Placeholder', 'NonPlaceholder'],
placeholder => $_<placeholder>,
variable_name => $_<variable_name>,
decl => $*IN_DECL,
)
}
}
set_default_parameter_type(@params, 'Any');
my $signature := create_signature_object($<multisig> ?? $<multisig> !! $/, %sig_info, $block);
add_signature_binding_code($block, $signature, @params);
Expand Down Expand Up @@ -6635,6 +6626,13 @@ class Perl6::Actions is HLL::Actions does STDActions {

# If we already declared this as a placeholder, we're done.
my $name := ~$sigil ~ ~$ident;
if $block.ann('also_uses') && $block.ann('also_uses'){$name} {
$*W.throw($/, ['X', 'Placeholder', 'NonPlaceholder'],
placeholder => $full_name,
variable_name => $name,
decl => $block.ann('IN_DECL'),
)
}
for @params {
if $_<variable_name> eq $name {
return QAST::Var.new( :name($name), :scope('lexical') );
Expand Down

0 comments on commit c0dd8ae

Please sign in to comment.