Remove the compare binary since this is now integrated with the tests.
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user