start on package system

main
NotAFile 2022-01-23 21:52:08 +01:00
parent ec87f29c5c
commit a1f953e989
2 changed files with 23 additions and 0 deletions

View File

@ -3,6 +3,7 @@ mod frontend;
mod literals;
mod parser;
mod rtlil;
mod package;
use std::fs::File;
use std::io::prelude::*;

22
src/package.rs Normal file
View File

@ -0,0 +1,22 @@
use std::collections::BTreeMap;
use std::path::PathBuf;
struct Package {
name: String,
path: PathBuf,
}
struct PackageRegistry {
packages: BTreeMap<String, Package>
}
impl PackageRegistry {
fn new() -> Self {
let mut packages = BTreeMap::new();
packages.insert("builtins".to_string(), Package {
name: "builtins".to_string(),
path: "./lib/builtins/".into(),
});
Self { packages }
}
}