Fixes identifiers starting with Z or z, and numbers starting with 9 not being lexed
This commit is contained in:
parent
373794a830
commit
2e87674720
|
@ -456,8 +456,10 @@ pub fn lex(s: &str, log: &mut dyn FnMut(Message, Span)) -> Vec<LexToken> {
|
|||
'.' => lex_and_consume(&mut chars, TT::Dot, &mut add_token),
|
||||
'?' => lex_and_consume(&mut chars, TT::QuestionMark, &mut add_token),
|
||||
|
||||
'0'..'9' => lex_numeric(&mut chars, &mut add_token),
|
||||
'a'..'z' | 'A'..'Z' | '_' => lex_keyword_or_identifier(&mut chars, &mut add_token),
|
||||
'0'..='9' => lex_numeric(&mut chars, &mut add_token),
|
||||
'a'..='z' | 'A'..='Z' | '_' => {
|
||||
lex_keyword_or_identifier(&mut chars, &mut add_token)
|
||||
}
|
||||
'\'' => lex_string(&mut chars, &'\'', false, log, &mut add_token),
|
||||
'"' if chars.peek() == Some(&'\"') && chars.peek() == Some(&'\"') => {
|
||||
lex_string(&mut chars, &'"', true, log, &mut add_token)
|
||||
|
|
Loading…
Reference in New Issue