Reset the internal state of a parser. This is called at the beginning of every parse. This prevents the parser from running with inconsistent state (say, if a previous invocation returned an error and the parser is reused).
(&self)
| 360 | /// parser from running with inconsistent state (say, if a previous |
| 361 | /// invocation returned an error and the parser is reused). |
| 362 | fn reset(&self) { |
| 363 | // These settings should be in line with the construction |
| 364 | // in `ParserBuilder::build`. |
| 365 | self.pos.set(Position { offset: 0, line: 1, column: 1}); |
| 366 | self.ignore_whitespace.set(self.initial_ignore_whitespace); |
| 367 | self.comments.borrow_mut().clear(); |
| 368 | self.stack_group.borrow_mut().clear(); |
| 369 | self.stack_class.borrow_mut().clear(); |
| 370 | } |
| 371 | } |
| 372 | |
| 373 | impl<'s, P: Borrow<Parser>> ParserI<'s, P> { |
no test coverage detected