MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / read_number_or_neg_infinity

Method read_number_or_neg_infinity

std/json/src/main/tokenizer.rs:78–85  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

76 }
77
78 fn read_number_or_neg_infinity(&mut self) -> Result<Token, JsonError> {
79 // `-Infinity` is the only number-like token that starts with `-` but isn't a digit sequence.
80 if self.src.len() >= self.pos + 9 && &self.src[self.pos..self.pos + 9] == b"-Infinity" {
81 self.pos += 9;
82 return Ok(Token::Constant("-Infinity".to_string()));
83 }
84 self.read_number()
85 }
86
87 fn read_string(&mut self) -> Result<Token, JsonError> {
88 self.pos += 1;

Callers 1

next_tokenMethod · 0.80

Calls 2

read_numberMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected