Do the variable stuff. But it's broken
This commit is contained in:
parent
69986b6801
commit
68cf76ab6d
3 changed files with 17 additions and 3 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -120,7 +120,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lintc"
|
name = "lintc"
|
||||||
version = "0.2.2"
|
version = "0.3.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"built",
|
"built",
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "lintc"
|
name = "lintc"
|
||||||
version = "0.2.3"
|
version = "0.3.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
build = "build.rs"
|
build = "build.rs"
|
||||||
|
|
||||||
|
|
16
src/main.rs
16
src/main.rs
|
@ -98,7 +98,21 @@ fn load_macro(set: String, mac: String, inputs: String, vars: Vec<String>) -> St
|
||||||
|
|
||||||
if inputs.contains(")/") {
|
if inputs.contains(")/") {
|
||||||
let coolbeans: Vec<&str> = inputs.split(")/").collect();
|
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();
|
return contents.to_string();
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue