don't fail the build script if we couldn't parse a file

this way we get to the actual compilation in which rustc shouldl fail with a more helpfull error message
This commit is contained in:
Skgland
2025-08-09 01:59:18 +02:00
committed by Bennet Bleßmann
parent cd501beb0b
commit 35d34231f2

View File

@@ -133,7 +133,12 @@ pub fn index_static_strings(instruction_rs_path: &std::path::Path) -> TokenStrea
let syntax = match syn::parse_file(&src) {
Ok(s) => s,
Err(e) => {
panic!("parse error: {e} in file {path:?}");
println!("cargo::warning=parse error: {e} in file {path:?}");
syn::File{
shebang: None,
attrs: vec![],
items: vec![],
}
}
};
Ok(syntax)