MCPcopy Create free account
hub / github.com/Bloom-Engine/engine / val

Method val

native/watchos/src/models.rs:611–623  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

609 }
610 }
611 fn val(&mut self) -> Option<JVal> {
612 self.skip_ws();
613 match self.peek()? {
614 b'{' => self.obj(),
615 b'[' => self.arr(),
616 b'"' => self.string().map(JVal::Str),
617 b'-' | b'0'..=b'9' => self.number().map(JVal::Num),
618 b't' => { for c in b"true" { if self.bump() != Some(*c) { return None; } } Some(JVal::Num(1.0)) }
619 b'f' => { for c in b"false" { if self.bump() != Some(*c) { return None; } } Some(JVal::Num(0.0)) }
620 b'n' => { for c in b"null" { if self.bump() != Some(*c) { return None; } } Some(JVal::Num(0.0)) }
621 _ => None,
622 }
623 }
624 fn obj(&mut self) -> Option<JVal> {
625 if self.bump() != Some(b'{') { return None; }
626 let mut kv = Vec::new();

Callers 3

objMethod · 0.80
arrMethod · 0.80
json_parseFunction · 0.80

Calls 7

skip_wsMethod · 0.80
peekMethod · 0.80
objMethod · 0.80
arrMethod · 0.80
stringMethod · 0.80
numberMethod · 0.80
bumpMethod · 0.80

Tested by

no test coverage detected