mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-04 17:04:18 +01:00
Finalize the parser in the case of Error while running queries. This resets the parser stack and prevents triggering the assertion and thereby panic.
Closes https://github.com/tursodatabase/limbo/issues/742
This commit is contained in:
@@ -28,6 +28,7 @@ pub use error::Error;
|
||||
pub struct Parser<'input> {
|
||||
input: &'input [u8],
|
||||
scanner: Scanner<Tokenizer>,
|
||||
/// lemon parser
|
||||
parser: yyParser<'input>,
|
||||
}
|
||||
|
||||
@@ -62,6 +63,11 @@ impl<'input> Parser<'input> {
|
||||
pub fn offset(&self) -> usize {
|
||||
self.scanner.offset()
|
||||
}
|
||||
|
||||
/// Public API for sqlite3ParserFinalize()
|
||||
pub fn finalize(&mut self) {
|
||||
self.parser.sqlite3ParserFinalize();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user