mirror of
https://github.com/AleoHQ/leo.git
synced 2024-12-01 10:17:30 +03:00
fix some cases where _ is the only character in the identifier
This commit is contained in:
parent
98fd0ac4dc
commit
becafb3798
@ -43,7 +43,12 @@ fn eat_identifier(input: &[u8]) -> Option<(&[u8], &[u8])> {
|
||||
if input.is_empty() {
|
||||
return None;
|
||||
}
|
||||
if !input[0].is_ascii_alphabetic() {
|
||||
if !input[0].is_ascii_alphabetic() && input[0] != b'_' {
|
||||
// Allow _ at start.
|
||||
return None;
|
||||
}
|
||||
if input.len() > 1 && input[0] == b'_' {
|
||||
// But only if it the length of the identifer is 1.
|
||||
return None;
|
||||
}
|
||||
let mut i = 1usize;
|
||||
|
Loading…
Reference in New Issue
Block a user