pub fn recognize_float(i: &str) -> IResult<&str, &str> {
    recognize(
        tuple((
            // We replace the value with () to avoid the types mismatching on
            // the alt branches. We don't need any value here since all this
            // parsing is being done inside a `recognize` parser.
            alt((
                value((), tuple((digit1, opt(pair(char('.'), opt(digit1)))))),
                value((), tuple((char('.'), digit1))),
            )),
            opt(tuple((alt((char('e'), char('E'))), digit1))),
        ))
    )(i)
}
/// This is a custom implementation of nom::recognize_float that does not parse
/// the optional sign before the number, so that expressions like `x+3` parse
/// correctly and not as `x(+3)`.
This is a custom implementation of nom::recognize_float that does not parse
the optional sign before the number, so that expressions like `x+3` parse
correctly and not as `x(+3)`.
This is a custom implementation of nom :: recognize_float that does not parse the optional sign before the number so that expressions like ` x + 3 ` parse correctly and not as ` x ( + 3 ) ` .
pub fn recognize_float(i: &str) -> IResult<&str, &str> {
    recognize(
        tuple((
            // We replace the value with () to avoid the types mismatching on
            // the alt branches. We don't need any value here since all this
            // parsing is being done inside a `recognize` parser.
            alt((
                value((), tuple((digit1, opt(pair(char('.'), opt(digit1)))))),
                value((), tuple((char('.'), digit1))),
            )),
            opt(tuple((alt((char('e'), char('E'))), digit1))),
        ))
    )(i)
}
pub fn recognize_float ( i : & str ) -> IResult < & str , & str > { recognize ( tuple ( ( // We replace the value with () to avoid the types mismatching on // the alt branches. We don't need any value here since all this // parsing is being done inside a `recognize` parser. alt ( ( value ( ( ) , tuple ( ( digit1 , opt ( pair ( char ( '.' ) , opt ( digit1 ) ) ) ) ) ) , value ( ( ) , tuple ( ( char ( '.' ) , digit1 ) ) ) , ) ) , opt ( tuple ( ( alt ( ( char ( 'e' ) , char ( 'E' ) ) ) , digit1 ) ) ) , ) ) ) ( i ) }
This is a custom implementation of nom::recognize_float that does not parse
the optional sign before the number, so that expressions like `x+3` parse
correctly and not as `x(+3)`.
This is a custom implementation of nom :: recognize_float that does not parse the optional sign before the number so that expressions like ` x + 3 ` parse correctly and not as ` x ( + 3 ) ` .
i
&str
i
&str