tamer: ir::xir::tree: Explicitly list unhandled tokens for exhaustiveness

This allows Rust to carry out its exhaustiveness check for when we add new
tokens.  It further ensure that we understand what we missed, or chose not
to handle.

DEV-10863
main
Mike Gerwitz 2021-11-02 14:06:10 -04:00
parent edf9a75575
commit 6eed728756
1 changed files with 3 additions and 1 deletions

View File

@ -718,7 +718,9 @@ impl ParserState {
Token::AttrValue(value, span) => stack.close_attr(value, span),
Token::Text(value, span) => stack.text(value, span),
todo => Err(ParseError::Todo(todo, stack)),
Token::Comment(..) | Token::CData(..) | Token::Whitespace(..) => {
Err(ParseError::Todo(tok, stack))
}
}
.map(|new_stack| self.store_or_emit(new_stack))
}