Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Implement simple need aliasing
  • Loading branch information
sorear committed Oct 24, 2010
1 parent dfcce51 commit 76bef32
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Metamodel.pm
Expand Up @@ -861,10 +861,14 @@ sub Op::Use::begin {
my $name = $self->unit;
my $u2 = $unit->need_unit($self->unit);

my @can = @{ $u2->mainline->find_pkg(split /::/, $name) };
my @can = @{ $u2->mainline->find_pkg(['MY', split /::/, $name]) };
my $exp = $unit->get_stash(@can, 'EXPORT', 'DEFAULT');

# XXX I am not sure how need binding should work
# XXX I am not sure how need binding should work in the :: case
if ($name !~ /::/) {
$opensubs[-1]->lexicals->{$name} =
Metamodel::Lexical::Stash->new(path => [@can]);
}

for my $en (sort keys %{ $exp->zyg }) {
my $uname = $en;
Expand Down

0 comments on commit 76bef32

Please sign in to comment.