Improve identifier parsing checks
This commit is contained in:
parent
03e357fd40
commit
0b17d6cef7
1 changed files with 4 additions and 1 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue