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

Method parse_array

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

Source from the content-addressed store, hash-verified

227 }
228
229 fn parse_array(&mut self) -> Result<JsonValue, JsonError> {
230 self.expect('[')?;
231 let mut values = Vec::new();
232 loop {
233 self.skip_whitespace();
234 if self.try_consume(']') {
235 break;
236 }
237 values.push(self.parse_value()?);
238 self.skip_whitespace();
239 if self.try_consume(']') {
240 break;
241 }
242 self.expect(',')?;
243 }
244 Ok(JsonValue::Array(values))
245 }
246
247 fn parse_object(&mut self) -> Result<JsonValue, JsonError> {
248 self.expect('{')?;

Callers 1

parse_valueMethod · 0.80

Calls 5

expectMethod · 0.80
skip_whitespaceMethod · 0.80
try_consumeMethod · 0.80
parse_valueMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected