From a1f953e98910988c5c9de03cd7256ac2a7570808 Mon Sep 17 00:00:00 2001 From: NotAFile Date: Sun, 23 Jan 2022 21:52:08 +0100 Subject: [PATCH] start on package system --- src/main.rs | 1 + src/package.rs | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 src/package.rs diff --git a/src/main.rs b/src/main.rs index ca40c1e..83c05af 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,6 +3,7 @@ mod frontend; mod literals; mod parser; mod rtlil; +mod package; use std::fs::File; use std::io::prelude::*; diff --git a/src/package.rs b/src/package.rs new file mode 100644 index 0000000..6d9e840 --- /dev/null +++ b/src/package.rs @@ -0,0 +1,22 @@ +use std::collections::BTreeMap; +use std::path::PathBuf; + +struct Package { + name: String, + path: PathBuf, +} + +struct PackageRegistry { + packages: BTreeMap +} + +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 } + } +}