MCPcopy Create free account
hub / github.com/csskit/csskit / rewind

Method rewind

crates/css_parse/src/parser.rs:237–256  ·  view source on GitHub ↗
(&mut self, checkpoint: ParserCheckpoint<I>)

Source from the content-addressed store, hash-verified

235 }
236
237 pub fn rewind(&mut self, checkpoint: ParserCheckpoint<I>) {
238 let ParserCheckpoint { iter, errors_pos, trivia_pos, buffer, buffer_index, skip, stop, state, .. } = checkpoint;
239
240 self.cursor_iter = iter;
241
242 self.errors.truncate(errors_pos as usize);
243 self.trivia.truncate(trivia_pos as usize);
244
245 self.buffer = buffer;
246 self.buffer_index = buffer_index;
247
248 self.skip = skip;
249 self.stop = stop;
250 self.state = state;
251
252 #[cfg(debug_assertions)]
253 {
254 self.last_cursor = None;
255 }
256 }
257
258 #[inline]
259 pub fn checkpoint(&self) -> ParserCheckpoint<I> {

Callers 8

peek_and_nextFunction · 0.45
parseMethod · 0.45
parseMethod · 0.45
parseMethod · 0.45
try_parseMethod · 0.45
parse_rule_variantsMethod · 0.45

Calls

no outgoing calls

Tested by 2

peek_and_nextFunction · 0.36