Permalink
Browse files

$.foo, @.foo and %.foo should contextualize appropriately.

  • Loading branch information...
jnthn committed Apr 21, 2012
1 parent fa1ca28 commit 6ef66c9521b14f33ded88c3da8569032488d2442
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/Perl6/Actions.pm
View
@@ -1117,6 +1117,13 @@ class Perl6::Actions is HLL::Actions {
$past.pasttype('callmethod');
$past.name($desigilname);
$past.unshift(PAST::Var.new( :name('self'), :scope('lexical_6model') ));
# Contextualize based on sigil.
$past := PAST::Op.new(
:pasttype('callmethod'),
:name($sigil eq '@' ?? 'list' !!
$sigil eq '%' ?? 'hash' !!
'item'),
$past);
}
elsif $twigil eq '^' || $twigil eq ':' {
$past := add_placeholder_parameter($/, $sigil, $desigilname,

0 comments on commit 6ef66c9

Please sign in to comment.