Skip to content

Commit

Permalink
Do not load dependant modules more than once
Browse files Browse the repository at this point in the history
  • Loading branch information
sorear committed Dec 29, 2010
1 parent 7ab22da commit 7c0434c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/CompilerDriver.pm
Expand Up @@ -44,15 +44,16 @@ sub slurp {

sub metadata_for {
my ($unit) = @_;
$unit =~ s/::/./g;
my $file = "$unit.nam";
$file =~ s/::/./g;

NAMBackend::load(slurp(build_file("$unit.nam")));
$Metamodel::units{$unit} //= NAMBackend::load(slurp(build_file($file)));
}

sub syml_for {
my ($module, $file) = @_;
local %Metamodel::units;
my $meta = $Metamodel::units{$module} =
my $meta = $Metamodel::units{$module} //=
NAMBackend::load(slurp($file));

if ($meta->name ne $module) {
Expand Down

0 comments on commit 7c0434c

Please sign in to comment.