Take a parser and input and return Result with a formatted error.
(f: F, input: &'a str)
| 209 | |
| 210 | /// Take a parser and input and return Result with a formatted error. |
| 211 | pub fn consume_all<'a, O, F>(f: F, input: &'a str) -> anyhow::Result<O> |
| 212 | where |
| 213 | F: FnMut(&'a str) -> NomResult<'a, O>, |
| 214 | { |
| 215 | map_parse_result(all_consuming(f)(input).map(|r| r.1), input) |
| 216 | } |
| 217 | |
| 218 | fn p_integer_string(input: &str) -> NomResult<'_, String> { |
| 219 | let parser = tuple(( |