diff --git a/lang/src/fs.rs b/lang/src/fs.rs index 0c8a7f2..0b6354e 100644 --- a/lang/src/fs.rs +++ b/lang/src/fs.rs @@ -81,6 +81,11 @@ pub fn run_compiler(root_file: &str, options: Options, out: &mut Vec) -> std Ok(()) } + if !options.optimize && !parsed.errors.is_empty() { + log::error!("{}", parsed.errors); + return Err(std::io::Error::other("parsing failed")); + } + if options.fmt { for parsed in parsed.ast { format_ast(parsed)?; @@ -109,11 +114,6 @@ pub fn run_compiler(root_file: &str, options: Options, out: &mut Vec) -> std codegen.assemble(out); } } else { - if !parsed.errors.is_empty() { - log::error!("{}", parsed.errors); - return Err(std::io::Error::other("parsing failed")); - } - let mut codegen = codegen::Codegen::default(); codegen.files = parsed.ast; codegen.push_embeds(parsed.embeds); diff --git a/lang/src/son.rs b/lang/src/son.rs index e34b951..2299482 100644 --- a/lang/src/son.rs +++ b/lang/src/son.rs @@ -141,7 +141,7 @@ impl Nodes { log::info!("{out}"); } - fn graphviz_in_browser(&self, tys: &Types, files: &[parser::Ast]) { + fn graphviz_in_browser(&self, _tys: &Types, _files: &[parser::Ast]) { #[cfg(all(debug_assertions, feature = "std"))] { // let out = &mut String::new();