Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Simplify install_package_symbol; it now need only concern itself with…
… direct, not nested, installation.
  • Loading branch information
jnthn committed Aug 8, 2011
1 parent 1701656 commit 53133a7
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions src/Perl6/SymbolTable.pm
Expand Up @@ -416,28 +416,18 @@ class Perl6::SymbolTable is HLL::Compiler::SerializationContextBuilder {

# Installs a symbol into the package. Does so immediately, and
# makes sure this happens on deserialization also.
method install_package_symbol($package, $symbol, $obj) {
my @sym := pir::split('::', $symbol);
my $name := ~@sym.pop();

method install_package_symbol($package, $name, $obj) {
# Install symbol immediately.
my $target := $package;
for @sym {
$target := pir::perl6_get_package_through_who__PPs($target, $_);
}
($target.WHO){$name} := $obj;
($package.WHO){$name} := $obj;

# Add deserialization installation of the symbol.
my $path := self.get_object_sc_ref_past($package);
for @sym {
$path := PAST::Op.new(:pirop('perl6_get_package_through_who PPs'), $path, ~$_);
}
my $package_ref := self.get_object_sc_ref_past($package);
self.add_event(:deserialize_past(PAST::Op.new(
:pasttype('bind_6model'),
PAST::Var.new(
:scope('keyed'),
PAST::Op.new( :pirop('get_who PP'), $path ),
$name
PAST::Op.new( :pirop('get_who PP'), $package_ref ),
~$name
),
self.get_object_sc_ref_past($obj)
)));
Expand Down

0 comments on commit 53133a7

Please sign in to comment.