From 9ad7a78dbe40dedc06e7db8d4343df52ab612efa Mon Sep 17 00:00:00 2001 From: lyken Date: Tue, 9 Jul 2024 21:02:20 +0800 Subject: [PATCH] core: build.rs rewrite regex to capture `= type` --- nac3core/build.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nac3core/build.rs b/nac3core/build.rs index 7f4e0454..108a636b 100644 --- a/nac3core/build.rs +++ b/nac3core/build.rs @@ -73,7 +73,9 @@ fn compile_irrt_cpp() { // Regex: // - `(?ms:^define.*?\}$)` captures LLVM `define` blocks // - `(?m:^declare.*?$)` captures LLVM `declare` lines - let regex_filter = Regex::new(r"(?ms:^define.*?\}$)|(?m:^declare.*?$)").unwrap(); + // - `(?m:^%.+?=\s*type\s*\{.+?\}$)` captures LLVM `type` declarations + let regex_filter = + Regex::new(r"(?ms:^define.*?\}$)|(?m:^declare.*?$)|(?m:^%.+?=\s*type\s*\{.+?\}$)").unwrap(); for f in regex_filter.captures_iter(&output) { assert_eq!(f.len(), 1); filtered_output.push_str(&f[0]);