diff --git a/sv-parser/examples/parse_sv.rs b/sv-parser/examples/parse_sv.rs index 7d62dbd..9a55c82 100644 --- a/sv-parser/examples/parse_sv.rs +++ b/sv-parser/examples/parse_sv.rs @@ -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); }