MCPcopy Create free account
hub / github.com/Work-Fisher/code-claw / parse_string

Method parse_string

claw-code/rust/crates/runtime/src/json.rs:187–198  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

185 }
186
187 fn parse_string(&mut self) -> Result<String, JsonError> {
188 self.expect('"')?;
189 let mut value = String::new();
190 while let Some(ch) = self.next() {
191 match ch {
192 '"' => return Ok(value),
193 '\\' => value.push(self.parse_escape()?),
194 plain => value.push(plain),
195 }
196 }
197 Err(JsonError::new("unterminated string"))
198 }
199
200 fn parse_escape(&mut self) -> Result<char, JsonError> {
201 match self.next() {

Callers 2

parse_valueMethod · 0.80
parse_objectMethod · 0.80

Calls 4

expectMethod · 0.80
nextMethod · 0.80
parse_escapeMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected