From fce5ba3dbfec865f1ec4c4601ea201ff4c612043 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 f3a84d9e..d70f9424 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]);