mirror of
https://github.com/crate-ci/typos.git
synced 2024-11-21 16:41:01 -05:00
feat(parser): Support C++ hex literal separators
This commit is contained in:
parent
b6ab968478
commit
92a2560c9a
1 changed files with 2 additions and 1 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue