From 0b17d6cef7bc2caec318815f191ce2a5fdfed5fe Mon Sep 17 00:00:00 2001 From: Maxim Svistunov Date: Mon, 5 Feb 2024 13:36:36 +0100 Subject: [PATCH] Improve identifier parsing checks --- parser/src/parsing/common.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/parser/src/parsing/common.rs b/parser/src/parsing/common.rs index 3c9a585..9d9aef6 100644 --- a/parser/src/parsing/common.rs +++ b/parser/src/parsing/common.rs @@ -17,7 +17,10 @@ pub fn parse_identifier(input: &str) -> IResult<&str, &str> { let (_, first) = peek(anychar)(input)?; if first.is_alphabetic() || first == '_' { take_while(|c: char| { - is_alphanumeric(c as u8) || c == '_' + match c { + 'a'..='z' | 'A'..='Z' | '_' | '0'..='9' => true, + _ => false + } })(input) } else { Err(nom::Err::Error(make_error(