fixed numbers inside identifiers

This commit is contained in:
afonya2 2025-04-24 20:31:52 +02:00
parent 95e427f8d1
commit 4476e1db96
Signed by: afonya
GPG key ID: EBB9C4CAFAAFB2DC

View file

@ -109,10 +109,10 @@ fn read_identifier(splitted: &Vec<&str>, pos: &mut usize, out: &mut Vec<Token>)
while pos < &mut splitted.len() {
let prev_char = splitted[*pos-1];
let char = splitted[*pos];
*pos += 1;
if is_operator(char) || is_sep(char) || char == "\n" || char == "\r" {
if is_operator(char) || is_sep(char) || char == "\n" || char == "\r" || (prev_char == " " && is_number(char)) {
break;
}
*pos += 1;
if prev_char == " " {
word_pos.push(*pos-1);
}