MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / read_newline

Method read_newline

atomic-core/src/diff/token/tokenizer.rs:293–306  ·  view source on GitHub ↗

Read a newline token.

(&mut self)

Source from the content-addressed store, hash-verified

291
292 /// Read a newline token.
293 fn read_newline(&mut self) -> Token<'a> {
294 let start = self.position;
295 if self.peek() == Some(b'\r') {
296 self.advance();
297 }
298 if self.peek() == Some(b'\n') {
299 self.advance();
300 }
301 Token::new(
302 &self.content[start..self.position],
303 TokenKind::Newline,
304 start,
305 )
306 }
307
308 /// Read an operator token, handling multi-character operators.
309 fn read_operator(&mut self) -> Token<'a> {

Callers 1

nextMethod · 0.80

Calls 2

peekMethod · 0.45
advanceMethod · 0.45

Tested by

no test coverage detected