Skip to content

Commit

Permalink
Merge dependencies stated in program.json w/ dependencies stated in…
Browse files Browse the repository at this point in the history
… `.leo` file
  • Loading branch information
evan-schott committed Nov 3, 2023
1 parent 4531ef1 commit cf7c2f4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions compiler/compiler/src/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,4 +329,15 @@ impl<'a> Compiler<'a> {
}
Ok(())
}

/// Merges the dependencies defined in `program.json` with the dependencies imported in `.leo` file
fn add_import_stubs(&mut self) {
for (symbol, stub) in self.import_stubs.iter() {
// Only add in the ones explicitly imported in `.leo` file
if self.ast.ast.stubs.contains_key(symbol) {
self.ast.ast.stubs.remove(symbol);
self.ast.ast.stubs.insert(*symbol, stub.clone());
}
}
}
}

0 comments on commit cf7c2f4

Please sign in to comment.