0.3.1: )!!/ and )../ are now supported.

This commit is contained in:
abbie 2022-01-29 17:41:26 +00:00
parent f75cabab83
commit f4c497e8a4
No known key found for this signature in database
GPG key ID: 04DDE463F9200F87
5 changed files with 58 additions and 7 deletions

2
Cargo.lock generated
View file

@ -120,7 +120,7 @@ dependencies = [
[[package]] [[package]]
name = "lintc" name = "lintc"
version = "0.3.0" version = "0.3.1"
dependencies = [ dependencies = [
"built", "built",
] ]

View file

@ -1,6 +1,6 @@
[package] [package]
name = "lintc" name = "lintc"
version = "0.3.0" version = "0.3.1"
edition = "2021" edition = "2021"
build = "build.rs" build = "build.rs"

4
README
View file

@ -14,10 +14,10 @@ Latest release and setup
---------------------------- ----------------------------
Clone this repository to get the latest development version. Clone this repository to get the latest development version.
Currently we are at version 0.3.0 of the software. Currently we are at version 0.3.1 of the software.
If you'd like the point release (stable) version, run these commands below: If you'd like the point release (stable) version, run these commands below:
git reset --hard 0.3.0 git reset --hard 0.3.1
cargo build --release cargo build --release
If you want the latest development release, run these commands: If you want the latest development release, run these commands:

View file

@ -11,10 +11,10 @@
<h2>Latest release and setup</h2> <h2>Latest release and setup</h2>
<p>Clone this repository to get the latest development version.</p> <p>Clone this repository to get the latest development version.</p>
<p>Currently we are at version 0.3.0 of the software.</p> <p>Currently we are at version 0.3.1 of the software.</p>
<p>If you'd like the point release (stable) version, run these commands below:</p> <p>If you'd like the point release (stable) version, run these commands below:</p>
<pre>git reset --hard 0.3.0 <pre>git reset --hard 0.3.1
cargo build --release</pre> cargo build --release</pre>

View file

@ -97,7 +97,6 @@ fn load_macro(set: String, mac: String, inputs: String, vars: Vec<String>) -> St
} }
if inputs.contains(")/") { if inputs.contains(")/") {
println!("e");
let coolbeans: Vec<&str> = inputs.split(")/").collect(); let coolbeans: Vec<&str> = inputs.split(")/").collect();
let mut isin = false; let mut isin = false;
let mut i: u8 = 0; let mut i: u8 = 0;
@ -122,6 +121,58 @@ fn load_macro(set: String, mac: String, inputs: String, vars: Vec<String>) -> St
} }
contents = contelt.to_string(); contents = contelt.to_string();
} }
if inputs.contains(")!!/") {
let coolbeans: Vec<&str> = inputs.split(")!!/").collect();
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);
}
let contunt: Vec<&str> = contents.split("\n").collect();
let mut contelt = "".to_string();
for x in contunt {
if x.len() > 2 {
contelt = format!("{}\n{} .{} STZ",contelt,x,i.to_string());
}
}
contents = contelt.to_string();
}
if inputs.contains(")../") {
let coolbeans: Vec<&str> = inputs.split(")../").collect();
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);
}
let contunt: Vec<&str> = contents.split("\n").collect();
let mut contelt = "".to_string();
for x in contunt {
if x.len() > 2 {
contelt = format!("{}\n{} .{} STZ",contelt,x,i.to_string());
}
}
contents = contelt.to_string();
}
return contents.to_string(); return contents.to_string();
} }