(src: &str, ctx: &LoadCtx)
| 16 | } |
| 17 | |
| 18 | pub 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 | |
| 27 | fn parse_value(tk: &mut Tokenizer, ctx: &LoadCtx) -> Result<Handle> { |
| 28 | let t = tk.next_token().map_err(to_pdk_err)?; |
no test coverage detected