Next up is number parsing. We're keeping it simple here by accepting any number (> 1) of digits but ending the program if it doesn't fit into an i32.
(i: &'a str)
| 186 | /// Next up is number parsing. We're keeping it simple here by accepting any number (> 1) |
| 187 | /// of digits but ending the program if it doesn't fit into an i32. |
| 188 | fn parse_num<'a>(i: &'a str) -> IResult<&'a str, Atom, VerboseError<&'a str>> { |
| 189 | map_res(digit1, |digit_str: &str| { |
| 190 | digit_str.parse::<usize>().map(Wrapping).map(Atom::Num) |
| 191 | })(i) |
| 192 | } |
| 193 | |
| 194 | /// Now we take all these simple parsers and connect them. |
| 195 | /// We can now parse half of our language! |
nothing calls this directly
no outgoing calls
no test coverage detected