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) {
|
let tokens = match tokenize(&buffer) {
|
||||||
Ok(t) => t,
|
Ok(t) => t,
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
println!("Tokenization error");
|
println!("Tokenization error: {}", e.msg);
|
||||||
return;
|
std::process::exit(1)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let ast = match parse(&tokens, &[]) {
|
let ast = match parse(&tokens, &[]) {
|
||||||
Ok(ast) => ast,
|
Ok(ast) => ast,
|
||||||
Err(err) => { println!("Parse error: {:?}", err); return; }
|
Err(err) => {
|
||||||
|
println!("Parse error: {:?}", err);
|
||||||
|
std::process::exit(1)
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if compile {
|
if compile {
|
||||||
|
Loading…
Reference in New Issue
Block a user