Remove the compare binary since this is now integrated with the tests.

This commit is contained in:
Tom Alexander 2023-04-19 00:12:14 -04:00
parent 7649ff7990
commit d69522c7dc
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
2 changed files with 0 additions and 49 deletions

View File

@ -13,12 +13,6 @@ path = "src/lib.rs"
name = "toy"
path = "src/main.rs"
[[bin]]
name = "org_compare"
path = "src/org_compare.rs"
[dependencies]
nom = "7.1.1"
opentelemetry = "0.17.0"

View File

@ -1,43 +0,0 @@
#![feature(round_char_boundary)]
#![feature(exit_status_error)]
use std::process::ExitCode;
use crate::compare::compare_document;
use crate::init_tracing::init_telemetry;
use crate::init_tracing::shutdown_telemetry;
use crate::parser::document;
use compare::emacs_parse_org_document;
use compare::sexp;
mod compare;
mod init_tracing;
mod parser;
fn main() -> ExitCode {
let result = _main().expect("Ran into an error comparing the parses.");
ExitCode::from(result)
}
fn _main() -> Result<u8, Box<dyn std::error::Error>> {
let mut ran_into_problems: bool = false;
init_telemetry()?;
for org_path in std::env::args().skip(1) {
let org_contents = std::fs::read_to_string(&org_path)?;
let org_sexp = emacs_parse_org_document(&org_path)?;
println!("{}", org_sexp);
let (_remaining, parsed_sexp) = sexp(org_sexp.as_str()).expect("Sexp Parse failure");
let (_remaining, rust_parsed) = document(org_contents.as_str()).expect("Org Parse failure");
println!("{:#?}", rust_parsed);
let diff_result = compare_document(&parsed_sexp, &rust_parsed)?;
diff_result.print()?;
if diff_result.is_bad() {
ran_into_problems = true;
}
}
println!("Done.");
shutdown_telemetry()?;
if ran_into_problems {
Ok(1)
} else {
Ok(0)
}
}