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

Function parse

std/json/src/main/parser.rs:18–25  ·  view source on GitHub ↗
(src: &str, ctx: &LoadCtx)

Source from the content-addressed store, hash-verified

16}
17
18pub fn parse(src: &str, ctx: &LoadCtx) -> Result<Handle> {
19 let mut tk = Tokenizer::new(src);
20 let value = parse_value(&mut tk, ctx)?;
21 match tk.next_token().map_err(to_pdk_err)? {
22 Token::Eof => Ok(value),
23 _ => Err(value_err(tk.pos(), "trailing data after JSON value")),
24 }
25}
26
27fn parse_value(tk: &mut Tokenizer, ctx: &LoadCtx) -> Result<Handle> {
28 let t = tk.next_token().map_err(to_pdk_err)?;

Callers 1

loadsFunction · 0.50

Calls 4

parse_valueFunction · 0.85
value_errFunction · 0.85
posMethod · 0.80
next_tokenMethod · 0.45

Tested by

no test coverage detected