diff --git a/Cargo.lock b/Cargo.lock index 86310ef..c989f7e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -186,7 +186,6 @@ dependencies = [ name = "hir" version = "0.1.0" dependencies = [ - "levenshtein", "parser", ] @@ -206,12 +205,6 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" -[[package]] -name = "levenshtein" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db13adb97ab515a3691f56e4dbab09283d0b86cb45abd991d8634a9d6f501760" - [[package]] name = "lexer" version = "0.1.0" diff --git a/crates/hir/Cargo.toml b/crates/hir/Cargo.toml index 76a59c5..178f2d3 100644 --- a/crates/hir/Cargo.toml +++ b/crates/hir/Cargo.toml @@ -7,5 +7,4 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -parser = { path = "../parser" } -levenshtein = "1.0.5" # Used for error reporting \ No newline at end of file +parser = { path = "../parser" } \ No newline at end of file diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs index 0f25e50..bbbd29b 100644 --- a/crates/hir/src/lib.rs +++ b/crates/hir/src/lib.rs @@ -453,18 +453,4 @@ fn gen_type_hint(type_hint: &str) -> String { "vec_str" => "string[]".to_string(), _ => { dbg!(type_hint); todo!() } } -} - -// Get the closet intrinsic name to the given name -fn closet_intrinsic(got: String) -> String { - let mut closest = String::new(); - let mut closest_dist = std::usize::MAX; - for intrinsic in INTRINSICS.iter() { - let dist = levenshtein::levenshtein(got.as_str(), intrinsic); - if dist < closest_dist { - closest = intrinsic.to_string(); - closest_dist = dist; - } - } - closest -} +} \ No newline at end of file