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

Method rewind

crates/sith_python_parser/src/parser/mod.rs:659–673  ·  view source on GitHub ↗

Restore the parser to the given checkpoint.

(&mut self, checkpoint: ParserCheckpoint)

Source from the content-addressed store, hash-verified

657
658 /// Restore the parser to the given checkpoint.
659 fn rewind(&mut self, checkpoint: ParserCheckpoint) {
660 let ParserCheckpoint {
661 tokens,
662 errors_position,
663 current_token_id,
664 prev_token_end,
665 recovery_context,
666 } = checkpoint;
667
668 self.tokens.rewind(tokens);
669 self.errors.truncate(errors_position);
670 self.current_token_id = current_token_id;
671 self.prev_token_end = prev_token_end;
672 self.recovery_context = recovery_context;
673 }
674}
675
676struct ParserCheckpoint {

Calls 1

truncateMethod · 0.80

Tested by

no test coverage detected