diff --git a/Cargo.lock b/Cargo.lock index 7ef93b6..dbaef0f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -120,7 +120,7 @@ dependencies = [ [[package]] name = "lintc" -version = "0.2.2" +version = "0.3.0" dependencies = [ "built", ] diff --git a/Cargo.toml b/Cargo.toml index d991ce3..6b329d7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lintc" -version = "0.2.3" +version = "0.3.0" edition = "2021" build = "build.rs" diff --git a/src/main.rs b/src/main.rs index 2760ebb..8d93b5b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -98,7 +98,21 @@ fn load_macro(set: String, mac: String, inputs: String, vars: Vec) -> St if inputs.contains(")/") { let coolbeans: Vec<&str> = inputs.split(")/").collect(); - println!("{:?}", coolbeans[1]); + let mut isin = false; + let mut i: u8 = 0; + for x in vars.to_vec() { + if x == coolbeans[1].to_string() { + isin = true; + } + if isin != true { + i = i + 1; + } + } + if isin != true { + println!("ERROR: Reference to variable {} not assigned.", coolbeans[1]); + process::exit(1); + } + contents = format!("{} .{} STZ", contents, i.to_string()); } return contents.to_string(); }