MCPcopy Create free account
hub / github.com/astral-sh/ruff / checkpoint

Method checkpoint

crates/ruff_python_parser/src/parser/mod.rs:867–876  ·  view source on GitHub ↗

Creates a checkpoint to which the parser can later return to using [`Self::rewind`].

(&self)

Source from the content-addressed store, hash-verified

865
866 /// Creates a checkpoint to which the parser can later return to using [`Self::rewind`].
867 fn checkpoint(&self) -> ParserCheckpoint {
868 ParserCheckpoint {
869 tokens: self.tokens.checkpoint(),
870 errors_position: self.errors.len(),
871 unsupported_syntax_errors_position: self.unsupported_syntax_errors.len(),
872 current_token_id: self.current_token_id,
873 prev_token_end: self.prev_token_end,
874 recovery_context: self.recovery_context,
875 }
876 }
877
878 /// Restore the parser to the given checkpoint.
879 fn rewind(&mut self, checkpoint: ParserCheckpoint) {

Calls 1

lenMethod · 0.45

Tested by

no test coverage detected