1
0
forked from M-Labs/nac3

core: build.rs rewrite regex to capture = type

This commit is contained in:
lyken 2024-07-09 21:02:20 +08:00
parent 1721ebac66
commit 9ad7a78dbe

View File

@ -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]);