lexer: Fix bug that did not check the second character of identifiers. This also fixes one-character identifiers not being properly detected.

This commit is contained in:
John 2024-01-31 13:47:18 -06:00
parent b31295ad21
commit 5a77985b39

View File

@ -124,7 +124,7 @@ impl<'t> Lexer<'t> {
'|' => self.then().emit(TokenKind::Bar),
'}' => self.then().emit(TokenKind::CloseCurly),
c if c.is_numeric() => self.number::<DEFAULT_BASE>(),
&c if is_xid_start(c) => self.then().identifier(),
&c if is_xid_start(c) => self.identifier(),
c => todo!("Unrecognized character: {c}"),
}
}