use nom::{error::ErrorKind, Err, IResult, Needed};
#[allow(dead_code)] struct Range {
start: char,
end: char,
}
pubfn take_char(input: &[u8]) -> IResult<&[u8], char> { if !input.is_empty() {
Ok((&input[1..], input[0] as char))
} else {
Err(Err::Incomplete(Needed::new(1)))
}
}
#[cfg(feature = "std")] mod parse_int { use nom::HexDisplay; use nom::{
character::streaming::{digit1 as digit, space1 as space},
combinator::{complete, map, opt},
multi::many0,
IResult,
}; use std::str;
#[cfg(feature = "alloc")] fn issue_717(i: &[u8]) -> IResult<&[u8], Vec<&[u8]>> { use nom::bytes::complete::{is_not, tag}; use nom::multi::separated_list0;
separated_list0(tag([0x0]), is_not([0x0u8]))(i)
}
mod issue_647 { use nom::bytes::streaming::tag; use nom::combinator::complete; use nom::multi::separated_list0; use nom::{error::Error, number::streaming::be_f64, Err, IResult}; pubtype Input<'a> = &'a [u8];
#[test] fn issue_1027_convert_error_panic_nonempty() { use nom::character::complete::char; use nom::error::{convert_error, VerboseError}; use nom::sequence::pair;
let input = "a";
let result: IResult<_, _, VerboseError<&str>> = pair(char('a'), char('b'))(input); let err = match result.unwrap_err() {
Err::Error(e) => e,
_ => unreachable!(),
};
let msg = convert_error(input, err);
assert_eq!(
msg, "0: at line 1:\na\n ^\nexpected \'b\', got end of input\n\n"
);
}
#[test] fn issue_1617_count_parser_returning_zero_size() { use nom::{bytes::complete::tag, combinator::map, error::Error, multi::count};
// previously, `count()` panicked if the parser had type `O = ()` let parser = map(tag::<_, _, Error<&str>>("abc"), |_| ()); // shouldn't panic let result = count(parser, 3)("abcabcabcdef").expect("parsing should succeed");
assert_eq!(result, ("def", vec![(), (), ()]));
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet am 2026-06-18)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.