From 305605647bf3331cf5fc7e2ba1c8b2c3c8ffbc3e Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 2 Mar 2023 15:17:39 +0100 Subject: [PATCH] Output asm parser errors. --- src/compiler.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/compiler.rs b/src/compiler.rs index a30c26ae6..2115d0072 100644 --- a/src/compiler.rs +++ b/src/compiler.rs @@ -55,7 +55,11 @@ pub fn compile_asm( force_overwrite: bool, ) { let contents = fs::read_to_string(file_name).unwrap(); - let pil = asm_compiler::compile(Some(file_name), &contents).unwrap(); + let pil = asm_compiler::compile(Some(file_name), &contents).unwrap_or_else(|err| { + eprintln!("Error parsing .asm file:"); + err.output_to_stderr(); + panic!(); + }); let pil_file_name = output_dir.join(format!( "{}.pil", Path::new(file_name).file_stem().unwrap().to_str().unwrap()