Skip to content

Commit

Permalink
Fix stdlib import ordering and source fetching.
Browse files Browse the repository at this point in the history
  • Loading branch information
KtorZ committed Oct 2, 2024
1 parent 32f914c commit cb257f9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,9 @@ impl Project {

fn setup_dependency(&mut self, context: &str, modules: HashMap<&str, &str>, sequence: &[&str]) {
for module_name in sequence {
let module_src = modules
.get(module_name)
.expect("couldn't find sources for '{module_name}' when compiling {context}");
let module_src = modules.get(module_name).unwrap_or_else(|| {
panic!("couldn't find sources for '{module_name}' when compiling {context}")
});
let (mut ast, _extra) = parser::module(module_src, ModuleKind::Lib).unwrap();

ast.name = module_name.to_string();
Expand Down
16 changes: 8 additions & 8 deletions src/vendor/stdlib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,24 @@ pub const MODULES_SEQUENCE: [&str; 27] = [
"aiken/collection/dict",
"aiken/collection/list",
"aiken/math/rational",
"aiken/cbor",
"aiken/collection/pairs",
"aiken/interval",
"aiken/crypto/bls12_381/scalar",
"aiken/crypto/bls12_381/g1",
"aiken/crypto/bls12_381/g2",
"cardano/address",
"cardano/address/credential",
"cardano/assets",
"cardano/governance/protocol_parameters",
"cardano/governance/voter",
"aiken/cbor",
"cardano/certificate",
"aiken/primitive/string",
"cardano/governance",
"aiken/collection/pairs",
"aiken/interval",
"cardano/governance/voter",
"cardano/transaction",
"cardano/transaction/output_reference",
"cardano/script_context",
"cardano/transaction/script_purpose",
"cardano/crypto/bls12_381/scalar",
"cardano/crypto/bls12_381/g1",
"cardano/crypto/bls12_381/g2",
];

pub fn modules() -> HashMap<&'static str, &'static str> {
Expand All @@ -55,7 +55,7 @@ pub fn modules() -> HashMap<&'static str, &'static str> {
"aiken/primitive/int" => include_str!("../../stdlib/lib/aiken/primitive/int.ak"),
"aiken/primitive/string" => include_str!("../../stdlib/lib/aiken/primitive/string.ak"),
"cardano/address" => include_str!("../../stdlib/lib/cardano/address.ak"),
"cardano/address/credential" => include_str!("../../stdlib/lib/cardano/address.ak"),
"cardano/address/credential" => include_str!("../../stdlib/lib/cardano/address/credential.ak"),
"cardano/assets" => include_str!("../../stdlib/lib/cardano/assets.ak"),
"cardano/certificate" => include_str!("../../stdlib/lib/cardano/certificate.ak"),
"cardano/governance" => include_str!("../../stdlib/lib/cardano/governance.ak"),
Expand Down

0 comments on commit cb257f9

Please sign in to comment.