From 9f5776f98cdc8daba9f77f57b2536236d1fe05fd Mon Sep 17 00:00:00 2001 From: Matt Pelland Date: Wed, 30 Jan 2019 17:36:06 -0500 Subject: [PATCH] add doc for C #define regex --- build.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build.rs b/build.rs index 7f6e63ab..3b2a39d4 100644 --- a/build.rs +++ b/build.rs @@ -83,6 +83,9 @@ static SYSCONFIG_VALUES: [&'static str; 1] = [ fn parse_header_defines>( pyconfig_path: P, ) -> Result, String> { + // This regex picks apart a C style, single line `#define` statement into an identifier and a + // value. e.g. for the line `#define Py_DEBUG 1`, this regex will capture `Py_DEBUG` into + // `ident` and `1` into `value`. let define_regex = Regex::new(r"^\s*#define\s+(?P[a-zA-Z0-9_]+)\s+(?P.+)\s*$").unwrap();