[fine] Dump CSTs and an example zoo

This commit is contained in:
John Doty 2024-01-04 13:25:17 -08:00
parent 757db0ba3e
commit 1f6d7ec131
9 changed files with 357 additions and 32 deletions

View file

@ -646,8 +646,13 @@ impl<'a> Parser<'a> {
fn advance(&mut self) {
self.previous = self.current.clone();
self.current = self.tokens.next();
while self.current.kind == TokenKind::Error {
self.error_at_current(self.current.to_string());
while self.current.kind == TokenKind::Error
|| self.current.kind == TokenKind::Whitespace
|| self.current.kind == TokenKind::Comment
{
if self.current.kind == TokenKind::Error {
self.error_at_current(self.current.to_string());
}
self.current = self.tokens.next();
}
}