1#![deny(missing_docs)]
10
11use nom::{branch::alt, error::ParseError, IResult, Parser};
12use nom_supreme::{
13 tag::{complete::tag, TagError},
14 ParserExt,
15};
16
17pub mod annotation;
18pub mod node;
19pub mod number;
20pub mod property;
21pub mod string;
22mod util;
23pub mod value;
24pub mod whitespace;
25
26pub fn parse_null<'i, E>(input: &'i str) -> IResult<&'i str, (), E>
28where
29 E: TagError<&'i str, &'static str>,
30{
31 tag("null").value(()).parse(input)
32}
33
34pub fn parse_bool<'i, E>(input: &'i str) -> IResult<&'i str, bool, E>
36where
37 E: ParseError<&'i str>,
38 E: TagError<&'i str, &'static str>,
39{
40 alt((tag("true").value(true), tag("false").value(false))).parse(input)
41}