Parsing number with nom 5.0
问题 I'm trying to parse a large file (tens of GB) streaming using Nom 5.0. One piece of the parser tries to parse numbers: use nom::IResult; use nom::character::streaming::{char, digit1}; // use nom::character::complete::{char, digit1}; use nom::combinator::{map, opt}; use nom::multi::many1; use nom::sequence::{preceded, tuple}; pub fn number(input: &str) -> IResult<&str, &str> { map( tuple(( opt(char('-')), many1(digit1), opt(preceded(char('.'), many1(digit1))) )), |_| "0" )(input) } (Obviously,