MCPcopy Create free account
hub / github.com/LaBatata101/sith-language-server / checkpoint

Method checkpoint

crates/sith_python_parser/src/parser/mod.rs:648–656  ·  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

646
647 /// Creates a checkpoint to which the parser can later return to using [`Self::rewind`].
648 fn checkpoint(&self) -> ParserCheckpoint {
649 ParserCheckpoint {
650 tokens: self.tokens.checkpoint(),
651 errors_position: self.errors.len(),
652 current_token_id: self.current_token_id,
653 prev_token_end: self.prev_token_end,
654 recovery_context: self.recovery_context,
655 }
656 }
657
658 /// Restore the parser to the given checkpoint.
659 fn rewind(&mut self, checkpoint: ParserCheckpoint) {

Calls 1

lenMethod · 0.45

Tested by

no test coverage detected