MCPcopy Create free account
hub / github.com/davidblewett/rure-python / reset

Method reset

regex/regex-syntax/src/ast/parse.rs:362–370  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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
373impl<'s, P: Borrow<Parser>> ParserI<'s, P> {

Callers 2

compileMethod · 0.80
parse_with_commentsMethod · 0.80

Calls 1

clearMethod · 0.45

Tested by

no test coverage detected