Panic when unmatched delimiters aren't emitted
This commit is contained in:
parent
e38e915cdf
commit
c70a516c23
2 changed files with 8 additions and 1 deletions
|
@ -259,6 +259,13 @@ pub struct Parser<'a> {
|
|||
last_unexpected_token_span: Option<Span>,
|
||||
}
|
||||
|
||||
impl<'a> Drop for Parser<'a> {
|
||||
fn drop(&mut self) {
|
||||
if !self.unclosed_delims.is_empty() {
|
||||
panic!("unclosed delimiter errors not emitted");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
struct TokenCursor {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue