Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
proto routine auto-generation for lexical multis.
  • Loading branch information
jnthn committed Jul 9, 2011
1 parent e66182f commit 1c4235b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/Perl6/Actions.pm
Expand Up @@ -1147,7 +1147,16 @@ class Perl6::Actions is HLL::Actions {
$new_proto := $*ST.derive_dispatcher($proto);
}
else {
$/.CURSOR.panic("proto auto-gen NYI");
# Generate a proto foo(|$) { * }
my $p_past := PAST::Block.new(
:name($block.name), :nsentry(''),
PAST::Stmts.new(),
PAST::Op.new( :pirop('perl6_enter_multi_dispatch_from_onlystar_block P') ));
$outer[0].push(PAST::Stmt.new($p_past));
my @p_params := [hash(is_capture => 1, nominal_type => $*ST.find_symbol(['Mu']) )];
my $p_sig := $*ST.create_signature([$*ST.create_parameter(@p_params[0])]);
add_signature_binding_code($p_past, $p_sig, @p_params);
$new_proto := $*ST.create_code_object($p_past, 'Sub', $p_sig, 1);
}

# Install in current scope.
Expand Down

0 comments on commit 1c4235b

Please sign in to comment.