Increase default stack size of parse_sv
This commit is contained in:
parent
400140fae0
commit
b1c3f41dea
@ -55,48 +55,56 @@ fn main() {
|
|||||||
defines.insert(ident, Some(define));
|
defines.insert(ident, Some(define));
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut exit = 0;
|
let builder = std::thread::Builder::new().stack_size(20 * 1024 * 1024);
|
||||||
for path in &opt.files {
|
|
||||||
if opt.pp {
|
let child = builder
|
||||||
match preprocess(&path, &defines, &opt.includes, false, false) {
|
.spawn(move || {
|
||||||
Ok((preprocessed_text, new_defines)) => {
|
let mut exit = 0;
|
||||||
println!("{}", preprocessed_text.text());
|
for path in &opt.files {
|
||||||
defines = new_defines;
|
if opt.pp {
|
||||||
}
|
match preprocess(&path, &defines, &opt.includes, false, false) {
|
||||||
_ => (),
|
Ok((preprocessed_text, new_defines)) => {
|
||||||
}
|
println!("{}", preprocessed_text.text());
|
||||||
} else {
|
defines = new_defines;
|
||||||
match parse_sv(&path, &defines, &opt.includes, false, opt.incomplete) {
|
|
||||||
Ok((syntax_tree, new_defines)) => {
|
|
||||||
if opt.tree {
|
|
||||||
println!("{}", syntax_tree);
|
|
||||||
}
|
|
||||||
defines = new_defines;
|
|
||||||
if !opt.quiet {
|
|
||||||
println!("parse succeeded: {:?}", path);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Err(x) => {
|
|
||||||
match x {
|
|
||||||
Error::Parse(Some((origin_path, origin_pos))) => {
|
|
||||||
println!("parse failed: {:?}", path);
|
|
||||||
print_parse_error(&origin_path, &origin_pos);
|
|
||||||
}
|
}
|
||||||
x => {
|
_ => (),
|
||||||
println!("parse failed: {:?} ({})", path, x);
|
}
|
||||||
let mut err = x.source();
|
} else {
|
||||||
while let Some(x) = err {
|
match parse_sv(&path, &defines, &opt.includes, false, opt.incomplete) {
|
||||||
println!(" Caused by {}", x);
|
Ok((syntax_tree, new_defines)) => {
|
||||||
err = x.source();
|
if opt.tree {
|
||||||
|
println!("{}", syntax_tree);
|
||||||
|
}
|
||||||
|
defines = new_defines;
|
||||||
|
if !opt.quiet {
|
||||||
|
println!("parse succeeded: {:?}", path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Err(x) => {
|
||||||
|
match x {
|
||||||
|
Error::Parse(Some((origin_path, origin_pos))) => {
|
||||||
|
println!("parse failed: {:?}", path);
|
||||||
|
print_parse_error(&origin_path, &origin_pos);
|
||||||
|
}
|
||||||
|
x => {
|
||||||
|
println!("parse failed: {:?} ({})", path, x);
|
||||||
|
let mut err = x.source();
|
||||||
|
while let Some(x) = err {
|
||||||
|
println!(" Caused by {}", x);
|
||||||
|
err = x.source();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exit = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
exit = 1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
process::exit(exit);
|
||||||
}
|
})
|
||||||
process::exit(exit);
|
.expect("thread spawn failure");
|
||||||
|
|
||||||
|
let _ = child.join();
|
||||||
}
|
}
|
||||||
|
|
||||||
static CHAR_CR: u8 = 0x0d;
|
static CHAR_CR: u8 = 0x0d;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user