update the parser with the number of lines already read by the underlying stream (#836)

This commit is contained in:
Mark Thom
2021-02-27 23:56:58 -07:00
parent 064d261357
commit 590a0b8077
3 changed files with 15 additions and 3 deletions

View File

@@ -965,6 +965,11 @@ impl<'a, R: Read> Parser<'a, R> {
self.lexer.eof()
}
#[inline]
pub fn add_lines_read(&mut self, lines_read: usize) {
self.lexer.line_num += lines_read;
}
#[inline]
pub fn num_lines_read(&self) -> usize {
self.lexer.line_num