From 6da5726ac1f5cf6860d1e252e7a051b55c0fa332 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 781d4da89..5b425bcf1 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) }