From 518f21d174be48c7fc527bb184fe700b3b68136b Mon Sep 17 00:00:00 2001 From: lyken Date: Sat, 13 Jul 2024 14:02:50 +0800 Subject: [PATCH] core/irrt: build.rs capture IR defined constants --- nac3core/build.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nac3core/build.rs b/nac3core/build.rs index f3a84d9e2..d70f94249 100644 --- a/nac3core/build.rs +++ b/nac3core/build.rs @@ -63,8 +63,11 @@ fn main() { // - `(?ms:^define.*?\}$)` captures LLVM `define` blocks // - `(?m:^declare.*?$)` captures LLVM `declare` lines // - `(?m:^%.+?=\s*type\s*\{.+?\}$)` captures LLVM `type` declarations - let regex_filter = - Regex::new(r"(?ms:^define.*?\}$)|(?m:^declare.*?$)|(?m:^%.+?=\s*type\s*\{.+?\}$)").unwrap(); + // - `(?m:^@.+?=.+$)` captures global constants + let regex_filter = Regex::new( + r"(?ms:^define.*?\}$)|(?m:^declare.*?$)|(?m:^%.+?=\s*type\s*\{.+?\}$)|(?m:^@.+?=.+$)", + ) + .unwrap(); for f in regex_filter.captures_iter(&output) { assert_eq!(f.len(), 1); filtered_output.push_str(&f[0]);