Scanner - Allow identifiers with a leading '_'

This commit is contained in:
Emmanuel BENOîT 2023-01-07 11:39:19 +01:00
parent 4bce85e14b
commit 670b50e8cd

View file

@ -143,7 +143,7 @@ impl Scanner {
// Numbers
ch if ch.is_ascii_digit() => self.number(),
// Identifiers
ch if ch.is_ascii_alphabetic() => self.identifier(),
ch if ch.is_ascii_alphabetic() || ch == '_' => self.identifier(),
// Anything else is an error
_ => self.error("unexpected character".to_owned()),
}