diff --git a/Cargo.lock b/Cargo.lock index b9e5a8d..a29eeec 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -244,12 +244,6 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - [[package]] name = "errno" version = "0.3.9" @@ -314,18 +308,6 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" -[[package]] -name = "glob" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - [[package]] name = "heck" version = "0.5.0" @@ -343,16 +325,6 @@ dependencies = [ "notify-debouncer-full", ] -[[package]] -name = "indexmap" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c" -dependencies = [ - "equivalent", - "hashbrown", -] - [[package]] name = "inotify" version = "0.9.6" @@ -374,6 +346,7 @@ dependencies = [ ] [[package]] +======= name = "is_ci" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -413,13 +386,10 @@ dependencies = [ "clap", "colored", "fxhash", - "glob", "hotwatch", - "indexmap", "lazy_static", "miette", "predicates", - "regex", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index f2b2d9b..bfe0f47 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lace" -description = "A complete compiler and interpreter toolchain for the LC3 assembly language." +description = "A complete assembler toolchain for the LC3 assembly language." version = "0.1.0" authors = [ "Artemis Rosman" @@ -8,13 +8,10 @@ authors = [ edition = "2021" [dependencies] -glob = "0.3.1" clap = { version = "4.5.4", features = ["derive"] } colored = "2.1.0" -regex = "1.10.6" lazy_static = "1.5.0" miette = { version = "7.2.0", features = ["fancy"] } -indexmap = { version = "2.4.0", features = ["std"] } fxhash = "0.2.1" hotwatch = "0.5.0" diff --git a/src/symbol.rs b/src/symbol.rs index 873b244..60c4cdb 100644 --- a/src/symbol.rs +++ b/src/symbol.rs @@ -1,14 +1,10 @@ use std::{cell::RefCell, ops::Range, str::FromStr}; -use fxhash::FxBuildHasher; -use indexmap::IndexMap; +use fxhash::FxHashMap; use miette::{miette, Result, SourceSpan}; -// Symbol table of symbol -> memory address (line number) -type FxMap = IndexMap; - thread_local! { - pub static SYMBOL_TABLE: RefCell> = RefCell::new(IndexMap::with_hasher(FxBuildHasher::default())); + pub static SYMBOL_TABLE: RefCell> = RefCell::new(FxHashMap::default()); } pub fn reset_state() { @@ -18,7 +14,7 @@ pub fn reset_state() { /// Access to symbol table via closure pub fn with_symbol_table(f: F) -> R where - F: FnOnce(&mut FxMap) -> R, + F: FnOnce(&mut FxHashMap) -> R, { SYMBOL_TABLE.with_borrow_mut(f) }