Add return code to parse_sv
This commit is contained in:
parent
5ebaa7017c
commit
ba89870178
@ -1,5 +1,6 @@
|
||||
use std::collections::HashMap;
|
||||
use std::path::PathBuf;
|
||||
use std::process;
|
||||
use structopt::StructOpt;
|
||||
use sv_parser::parse_sv;
|
||||
|
||||
@ -23,6 +24,7 @@ struct Opt {
|
||||
fn main() {
|
||||
let opt = Opt::from_args();
|
||||
let mut defines = HashMap::new();
|
||||
let mut exit = 0;
|
||||
for path in &opt.files {
|
||||
match parse_sv(&path, &defines, &opt.includes) {
|
||||
Ok((syntax_tree, new_defines)) => {
|
||||
@ -36,7 +38,9 @@ fn main() {
|
||||
}
|
||||
Err(x) => {
|
||||
println!("parse failed: {:?} ({})", path, x);
|
||||
exit = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
process::exit(exit);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user