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

Method skip_bytes

crates/sith_python_parser/src/lexer/cursor.rs:162–172  ·  view source on GitHub ↗

Skips the next `count` bytes. ## Panics - If `count` is larger than the remaining bytes in the input stream. - If `count` indexes into a multi-byte character.

(&mut self, count: usize)

Source from the content-addressed store, hash-verified

160 /// - If `count` is larger than the remaining bytes in the input stream.
161 /// - If `count` indexes into a multi-byte character.
162 pub(super) fn skip_bytes(&mut self, count: usize) {
163 #[cfg(debug_assertions)]
164 {
165 self.prev_char = self.chars.as_str()[..count]
166 .chars()
167 .next_back()
168 .unwrap_or('\0');
169 }
170
171 self.chars = self.chars.as_str()[count..].chars();
172 }
173
174 /// Skips to the end of the input stream.
175 pub(super) fn skip_to_end(&mut self) {

Callers 5

newMethod · 0.45
lex_stringMethod · 0.45
lex_commentMethod · 0.45
re_lex_logical_tokenMethod · 0.45
rewindMethod · 0.45

Calls 3

charsMethod · 0.80
next_backMethod · 0.45
as_strMethod · 0.45

Tested by

no test coverage detected