From d4d61ce5adf87e57047be88fc04247bd58e3094e Mon Sep 17 00:00:00 2001 From: greg Date: Wed, 28 Dec 2016 23:55:13 -0800 Subject: [PATCH] Use process::exit in main --- src/main.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index c11d307..8d87a96 100644 --- a/src/main.rs +++ b/src/main.rs @@ -47,14 +47,17 @@ fn run_noninteractive(filename: &str, compile: bool) { let tokens = match tokenize(&buffer) { Ok(t) => t, Err(e) => { - println!("Tokenization error"); - return; + println!("Tokenization error: {}", e.msg); + std::process::exit(1) } }; let ast = match parse(&tokens, &[]) { Ok(ast) => ast, - Err(err) => { println!("Parse error: {:?}", err); return; } + Err(err) => { + println!("Parse error: {:?}", err); + std::process::exit(1) + } }; if compile {