Use process::exit in main
This commit is contained in:
parent
743311d18a
commit
d4d61ce5ad
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user