]> Repositorios git - scryer-prolog.git/commitdiff
don't fail the build script if we couldn't parse a file
authorSkgland <[email protected]>
Fri, 8 Aug 2025 23:59:18 +0000 (01:59 +0200)
committerBennet Bleßmann <[email protected]>
Sun, 24 Aug 2025 17:56:17 +0000 (19:56 +0200)
this way we get to the actual compilation in which rustc shouldl fail with a more helpfull error message

build/static_string_indexing.rs

index 7309f1cfdb326791df7804e310b6d9aea576c48a..1a00e17b6c3cb2663d57f9b054d05a2dd4bfde4d 100644 (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)