lex: fix incorrect keyword recognition

main
anna 2 years ago
parent c7e4244972
commit 7b715a2cfb
Signed by: fef
GPG Key ID: EC22E476DC2D3D84

@ -245,9 +245,8 @@ impl Lexer {
fn skip_if_match(&mut self, s: &str) -> bool {
let mut n: usize = 0;
for c in s.chars() {
if self.cursor.next() == Some(c) {
n += 1;
} else {
n += 1;
if self.cursor.next() != Some(c) {
self.cursor.seek_back(n);
return false;
}

Loading…
Cancel
Save