issue singleton variable warnings from loader.pl (#812)

This commit is contained in:
Mark Thom
2021-02-21 19:18:06 -07:00
parent a323a4dd8e
commit 0ef5f7f9b1
12 changed files with 178 additions and 63 deletions

View File

@@ -965,6 +965,12 @@ impl<'a, R: Read> Parser<'a, R> {
self.lexer.eof()
}
#[inline]
pub fn num_lines_read(&self) -> usize {
self.lexer.line_num
}
// on success, returns the parsed term and the number of lines read.
pub fn read_term(&mut self, op_dir: &CompositeOpDir) -> Result<Term, ParserError> {
self.tokens = read_tokens(&mut self.lexer)?;
@@ -998,18 +1004,4 @@ impl<'a, R: Read> Parser<'a, R> {
)),
}
}
pub fn read(&mut self, op_dir: &CompositeOpDir) -> Result<Vec<Term>, ParserError> {
let mut terms = Vec::new();
loop {
terms.push(self.read_term(op_dir)?);
if self.lexer.eof()? {
break;
}
}
Ok(terms)
}
}