From 92a2560c9a203525b4e4c5e15cd8732bd2d64c4c Mon Sep 17 00:00:00 2001 From: Ed Page Date: Sat, 13 Jul 2019 19:28:33 -0600 Subject: [PATCH] feat(parser): Support C++ hex literal separators --- src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 781d4da..5b425bc 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -63,7 +63,8 @@ pub fn process_file( fn is_hex(ident: &str) -> bool { lazy_static::lazy_static! { // `_`: number literal separator in Rust and other languages - static ref HEX: regex::Regex = regex::Regex::new(r#"^0[xX][0-9a-fA-F_]+$"#).unwrap(); + // `'`: number literal separator in C++ + static ref HEX: regex::Regex = regex::Regex::new(r#"^0[xX][0-9a-fA-F_']+$"#).unwrap(); } HEX.is_match(ident) }