pub fn recognize_float<T, E: ParseError<T>>(
input: T
) -> IResult<T, <T as IntoOutput>::Output, E>where
T: Slice<RangeFrom<usize>> + Slice<RangeTo<usize>>,
T: Clone + Offset,
T: InputIter,
T: IntoOutput,
<T as InputIter>::Item: AsChar,
T: InputTakeAtPosition + InputLength,
<T as InputTakeAtPosition>::Item: AsChar,
👎Deprecated since 8.0.0:
Replaced with nom8::character::recognize_float
with input wrapped in nom8::input::Streaming
Expand description
Recognizes a floating point number in text format and returns the corresponding part of the input.
Streaming version: Will return Err(nom8::Err::Incomplete(_))
if it reaches the end of input.
use nom8::number::streaming::recognize_float;
let parser = |s| {
recognize_float(s)
};
assert_eq!(parser("11e-1;"), Ok((";", "11e-1")));
assert_eq!(parser("123E-02;"), Ok((";", "123E-02")));
assert_eq!(parser("123K-01"), Ok(("K-01", "123")));
assert_eq!(parser("abc"), Err(Err::Error(("abc", ErrorKind::Char))));
WARNING: Deprecated, replaced with nom8::character::recognize_float
with input wrapped in nom8::input::Streaming