MCPcopy Create free account
hub / github.com/chc4/lineiform / parse_bool

Function parse_bool

src/parser.rs:166–171  ·  view source on GitHub ↗

Our boolean values are also constant, so we can do it the same way

(i: &'a str)

Source from the content-addressed store, hash-verified

164
165/// Our boolean values are also constant, so we can do it the same way
166fn parse_bool<'a>(i: &'a str) -> IResult<&'a str, Atom, VerboseError<&'a str>> {
167 alt((
168 map(tag("#t"), |_| Atom::Num(Wrapping(1))),
169 map(tag("#f"), |_| Atom::Num(Wrapping(0))),
170 ))(i)
171}
172
173/// The next easiest thing to parse are keywords.
174/// We introduce some error handling combinators: `context` for human readable errors

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected