/rust/registry/src/index.crates.io-1949cf8c6b5b557f/nom-7.1.3/src/branch/mod.rs
Line | Count | Source |
1 | | //! Choice combinators |
2 | | |
3 | | #[cfg(test)] |
4 | | mod tests; |
5 | | |
6 | | use crate::error::ErrorKind; |
7 | | use crate::error::ParseError; |
8 | | use crate::internal::{Err, IResult, Parser}; |
9 | | |
10 | | /// Helper trait for the [alt()] combinator. |
11 | | /// |
12 | | /// This trait is implemented for tuples of up to 21 elements |
13 | | pub trait Alt<I, O, E> { |
14 | | /// Tests each parser in the tuple and returns the result of the first one that succeeds |
15 | | fn choice(&mut self, input: I) -> IResult<I, O, E>; |
16 | | } |
17 | | |
18 | | /// Tests a list of parsers one by one until one succeeds. |
19 | | /// |
20 | | /// It takes as argument a tuple of parsers. There is a maximum of 21 |
21 | | /// parsers. If you need more, it is possible to nest them in other `alt` calls, |
22 | | /// like this: `alt(parser_a, alt(parser_b, parser_c))` |
23 | | /// |
24 | | /// ```rust |
25 | | /// # use nom::error_position; |
26 | | /// # use nom::{Err,error::ErrorKind, Needed, IResult}; |
27 | | /// use nom::character::complete::{alpha1, digit1}; |
28 | | /// use nom::branch::alt; |
29 | | /// # fn main() { |
30 | | /// fn parser(input: &str) -> IResult<&str, &str> { |
31 | | /// alt((alpha1, digit1))(input) |
32 | | /// }; |
33 | | /// |
34 | | /// // the first parser, alpha1, recognizes the input |
35 | | /// assert_eq!(parser("abc"), Ok(("", "abc"))); |
36 | | /// |
37 | | /// // the first parser returns an error, so alt tries the second one |
38 | | /// assert_eq!(parser("123456"), Ok(("", "123456"))); |
39 | | /// |
40 | | /// // both parsers failed, and with the default error type, alt will return the last error |
41 | | /// assert_eq!(parser(" "), Err(Err::Error(error_position!(" ", ErrorKind::Digit)))); |
42 | | /// # } |
43 | | /// ``` |
44 | | /// |
45 | | /// With a custom error type, it is possible to have alt return the error of the parser |
46 | | /// that went the farthest in the input data |
47 | 210M | pub fn alt<I: Clone, O, E: ParseError<I>, List: Alt<I, O, E>>( |
48 | 210M | mut l: List, |
49 | 210M | ) -> impl FnMut(I) -> IResult<I, O, E> { |
50 | 112M | move |i: I| l.choice(i) nom::branch::alt::<(&[u8], usize), u8, nom::error::Error<(&[u8], usize)>, (suricata::http2::huffman::http2_decode_huffman_len5, suricata::http2::huffman::http2_decode_huffman_len6, suricata::http2::huffman::http2_decode_huffman_len7, suricata::http2::huffman::http2_decode_huffman_len8, suricata::http2::huffman::http2_decode_huffman_len10, suricata::http2::huffman::http2_decode_huffman_len11, suricata::http2::huffman::http2_decode_huffman_len12, suricata::http2::huffman::http2_decode_huffman_len13, suricata::http2::huffman::http2_decode_huffman_len14, suricata::http2::huffman::http2_decode_huffman_len15, suricata::http2::huffman::http2_decode_huffman_len19, suricata::http2::huffman::http2_decode_huffman_len20, suricata::http2::huffman::http2_decode_huffman_len21, suricata::http2::huffman::http2_decode_huffman_len21, suricata::http2::huffman::http2_decode_huffman_len22, suricata::http2::huffman::http2_decode_huffman_len23, suricata::http2::huffman::http2_decode_huffman_len24, suricata::http2::huffman::http2_decode_huffman_len25, suricata::http2::huffman::http2_decode_huffman_len26, suricata::http2::huffman::http2_decode_huffman_len27, nom::branch::alt<(&[u8], usize), u8, nom::error::Error<(&[u8], usize)>, (suricata::http2::huffman::http2_decode_huffman_len28, suricata::http2::huffman::http2_decode_huffman_len30, suricata::http2::huffman::http2_decode_huffman_end)>::{closure#0})>::{closure#0}Line | Count | Source | 50 | 55.0M | move |i: I| l.choice(i) |
nom::branch::alt::<&[u8], suricata::http2::range::HTTPContentRange, nom::error::Error<&[u8]>, (suricata::http2::range::http2_parse_content_range_star, suricata::http2::range::http2_parse_content_range_def)>::{closure#0}Line | Count | Source | 50 | 101k | move |i: I| l.choice(i) |
nom::branch::alt::<&[u8], i64, nom::error::Error<&[u8]>, (nom::combinator::value<&[u8], i64, char, nom::error::Error<&[u8]>, nom::character::complete::char<&[u8], nom::error::Error<&[u8]>>::{closure#0}>::{closure#0}, nom::combinator::map_res<&[u8], &str, i64, nom::error::Error<&[u8]>, core::num::error::ParseIntError, nom::combinator::map_res<&[u8], &[u8], &str, nom::error::Error<&[u8]>, core::str::error::Utf8Error, nom::character::complete::digit1<&[u8], nom::error::Error<&[u8]>>, core::str::converts::from_utf8>::{closure#0}, <i64 as core::str::traits::FromStr>::from_str>::{closure#0})>::{closure#0}Line | Count | Source | 50 | 91.3k | move |i: I| l.choice(i) |
nom::branch::alt::<(&[u8], usize), u8, nom::error::Error<(&[u8], usize)>, (suricata::http2::huffman::http2_decode_huffman_len28, suricata::http2::huffman::http2_decode_huffman_len30, suricata::http2::huffman::http2_decode_huffman_end)>::{closure#0}Line | Count | Source | 50 | 1.81M | move |i: I| l.choice(i) |
nom::branch::alt::<&[u8], asn1_rs::asn1_types::any::Any, asn1_rs::error::Error, (<asn1_rs::asn1_types::any::Any as asn1_rs::traits::FromDer>::from_der, x509_parser::x509::parse_malformed_string)>::{closure#0}Line | Count | Source | 50 | 27.3k | move |i: I| l.choice(i) |
Unexecuted instantiation: nom::branch::alt::<&[u8], der_parser::ber::ber::BerObject, asn1_rs::error::Error, (der_parser::der::parser::parse_der_utf8string, der_parser::der::parser::parse_der_printablestring, der_parser::der::parser::parse_der_universalstring, der_parser::der::parser::parse_der_bmpstring, der_parser::der::parser::parse_der_t61string)>::{closure#0}nom::branch::alt::<&[u8], tls_parser::tls::TlsMessageHandshake, nom::error::Error<&[u8]>, (nom::combinator::complete<&[u8], tls_parser::tls::TlsMessageHandshake, nom::error::Error<&[u8]>, tls_parser::tls::parse_certrequest_full>::{closure#0}, nom::combinator::complete<&[u8], tls_parser::tls::TlsMessageHandshake, nom::error::Error<&[u8]>, tls_parser::tls::parse_certrequest_nosigalg>::{closure#0})>::{closure#0}Line | Count | Source | 50 | 31.5k | move |i: I| l.choice(i) |
Unexecuted instantiation: nom::branch::alt::<_, _, _, _>::{closure#0}nom::branch::alt::<(&[u8], usize), u8, nom::error::Error<(&[u8], usize)>, (suricata::http2::huffman::http2_decode_huffman_len5, suricata::http2::huffman::http2_decode_huffman_len6, suricata::http2::huffman::http2_decode_huffman_len7, suricata::http2::huffman::http2_decode_huffman_len8, suricata::http2::huffman::http2_decode_huffman_len10, suricata::http2::huffman::http2_decode_huffman_len11, suricata::http2::huffman::http2_decode_huffman_len12, suricata::http2::huffman::http2_decode_huffman_len13, suricata::http2::huffman::http2_decode_huffman_len14, suricata::http2::huffman::http2_decode_huffman_len15, suricata::http2::huffman::http2_decode_huffman_len19, suricata::http2::huffman::http2_decode_huffman_len20, suricata::http2::huffman::http2_decode_huffman_len21, suricata::http2::huffman::http2_decode_huffman_len21, suricata::http2::huffman::http2_decode_huffman_len22, suricata::http2::huffman::http2_decode_huffman_len23, suricata::http2::huffman::http2_decode_huffman_len24, suricata::http2::huffman::http2_decode_huffman_len25, suricata::http2::huffman::http2_decode_huffman_len26, suricata::http2::huffman::http2_decode_huffman_len27, nom::branch::alt<(&[u8], usize), u8, nom::error::Error<(&[u8], usize)>, (suricata::http2::huffman::http2_decode_huffman_len28, suricata::http2::huffman::http2_decode_huffman_len30, suricata::http2::huffman::http2_decode_huffman_end)>::{closure#0})>::{closure#0}Line | Count | Source | 50 | 46.2M | move |i: I| l.choice(i) |
nom::branch::alt::<&[u8], &[u8], nom::error::Error<&[u8]>, (suricata::mime::mime_parse_value_delimited, nom::combinator::complete<&[u8], &[u8], nom::error::Error<&[u8]>, nom::bytes::streaming::take_until<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0}>::{closure#0}, nom::combinator::rest<&[u8], nom::error::Error<&[u8]>>)>::{closure#0}Line | Count | Source | 50 | 6.96M | move |i: I| l.choice(i) |
nom::branch::alt::<&[u8], &[u8], nom::error::Error<&[u8]>, (nom::bytes::streaming::tag<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::bytes::streaming::tag<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0}, suricata::ssh::parser::ssh_parse_line::parser)>::{closure#0}Line | Count | Source | 50 | 17.0k | move |i: I| l.choice(i) |
nom::branch::alt::<&str, &str, nom::error::Error<&str>, (nom::character::complete::multispace1<&str, nom::error::Error<&str>>, nom::bytes::complete::tag<&str, &str, nom::error::Error<&str>>::{closure#0})>::{closure#0}Line | Count | Source | 50 | 6.01k | move |i: I| l.choice(i) |
nom::branch::alt::<&str, &str, nom::error::Error<&str>, (nom::combinator::complete<&str, &str, nom::error::Error<&str>, nom::bytes::streaming::is_not<&str, &str, nom::error::Error<&str>>::{closure#0}>::{closure#0}, nom::combinator::rest<&str, nom::error::Error<&str>>)>::{closure#0}Line | Count | Source | 50 | 9.30k | move |i: I| l.choice(i) |
nom::branch::alt::<&str, suricata::detect::requires::VersionCompareOp, nom::error::Error<&str>, (nom::combinator::map<&str, &str, suricata::detect::requires::VersionCompareOp, nom::error::Error<&str>, nom::bytes::complete::tag<&str, &str, nom::error::Error<&str>>::{closure#0}, suricata::detect::requires::parse_op::{closure#0}>::{closure#0}, nom::combinator::map<&str, &str, suricata::detect::requires::VersionCompareOp, nom::error::Error<&str>, nom::bytes::complete::tag<&str, &str, nom::error::Error<&str>>::{closure#0}, suricata::detect::requires::parse_op::{closure#1}>::{closure#0}, nom::combinator::map<&str, &str, suricata::detect::requires::VersionCompareOp, nom::error::Error<&str>, nom::bytes::complete::tag<&str, &str, nom::error::Error<&str>>::{closure#0}, suricata::detect::requires::parse_op::{closure#2}>::{closure#0}, nom::combinator::map<&str, &str, suricata::detect::requires::VersionCompareOp, nom::error::Error<&str>, nom::bytes::complete::tag<&str, &str, nom::error::Error<&str>>::{closure#0}, suricata::detect::requires::parse_op::{closure#3}>::{closure#0})>::{closure#0}Line | Count | Source | 50 | 62.2k | move |i: I| l.choice(i) |
Unexecuted instantiation: nom::branch::alt::<&str, char, nom::error::Error<&str>, (nom::character::complete::char<&str, nom::error::Error<&str>>::{closure#0}, nom::character::complete::char<&str, nom::error::Error<&str>>::{closure#0})>::{closure#0}Unexecuted instantiation: nom::branch::alt::<&str, (), nom::error::Error<&str>, (nom::combinator::map<&str, (&str, core::option::Option<(char, core::option::Option<&str>)>), (), nom::error::Error<&str>, nom::sequence::tuple<&str, (&str, core::option::Option<(char, core::option::Option<&str>)>), nom::error::Error<&str>, (nom::character::complete::digit1<&str, nom::error::Error<&str>>, nom::combinator::opt<&str, (char, core::option::Option<&str>), nom::error::Error<&str>, nom::sequence::pair<&str, char, core::option::Option<&str>, nom::error::Error<&str>, nom::character::complete::char<&str, nom::error::Error<&str>>::{closure#0}, nom::combinator::opt<&str, &str, nom::error::Error<&str>, nom::character::complete::digit1<&str, nom::error::Error<&str>>>::{closure#0}>::{closure#0}>::{closure#0})>::{closure#0}, nom::number::complete::recognize_float<&str, nom::error::Error<&str>>::{closure#0}>::{closure#0}, nom::combinator::map<&str, (char, &str), (), nom::error::Error<&str>, nom::sequence::tuple<&str, (char, &str), nom::error::Error<&str>, (nom::character::complete::char<&str, nom::error::Error<&str>>::{closure#0}, nom::character::complete::digit1<&str, nom::error::Error<&str>>)>::{closure#0}, nom::number::complete::recognize_float<&str, nom::error::Error<&str>>::{closure#1}>::{closure#0})>::{closure#0}nom::branch::alt::<(&[u8], usize), u8, nom::error::Error<(&[u8], usize)>, (suricata::http2::huffman::http2_decode_huffman_len28, suricata::http2::huffman::http2_decode_huffman_len30, suricata::http2::huffman::http2_decode_huffman_end)>::{closure#0}Line | Count | Source | 50 | 783k | move |i: I| l.choice(i) |
nom::branch::alt::<&[u8], suricata::http2::range::HTTPContentRange, nom::error::Error<&[u8]>, (suricata::http2::range::http2_parse_content_range_star, suricata::http2::range::http2_parse_content_range_def)>::{closure#0}Line | Count | Source | 50 | 71.1k | move |i: I| l.choice(i) |
nom::branch::alt::<&[u8], i64, nom::error::Error<&[u8]>, (nom::combinator::value<&[u8], i64, char, nom::error::Error<&[u8]>, nom::character::complete::char<&[u8], nom::error::Error<&[u8]>>::{closure#0}>::{closure#0}, nom::combinator::map_res<&[u8], &str, i64, nom::error::Error<&[u8]>, core::num::error::ParseIntError, nom::combinator::map_res<&[u8], &[u8], &str, nom::error::Error<&[u8]>, core::str::error::Utf8Error, nom::character::complete::digit1<&[u8], nom::error::Error<&[u8]>>, core::str::converts::from_utf8>::{closure#0}, <i64 as core::str::traits::FromStr>::from_str>::{closure#0})>::{closure#0}Line | Count | Source | 50 | 64.1k | move |i: I| l.choice(i) |
nom::branch::alt::<&[u8], &[u8], nom::error::Error<&[u8]>, (nom::combinator::complete<&[u8], &[u8], nom::error::Error<&[u8]>, nom::bytes::streaming::is_not<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0}>::{closure#0}, nom::combinator::rest<&[u8], nom::error::Error<&[u8]>>)>::{closure#0}Line | Count | Source | 50 | 3.71k | move |i: I| l.choice(i) |
nom::branch::alt::<&[u8], &[u8], nom::error::Error<&[u8]>, (nom::bytes::streaming::tag<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::bytes::streaming::tag<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::bytes::streaming::tag<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::bytes::streaming::tag<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::bytes::streaming::tag<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0})>::{closure#0}Line | Count | Source | 50 | 6.95k | move |i: I| l.choice(i) |
nom::branch::alt::<&[u8], &[u8], nom::error::Error<&[u8]>, (nom::bytes::streaming::tag<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::bytes::streaming::tag<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::bytes::streaming::tag<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0})>::{closure#0}Line | Count | Source | 50 | 8.55k | move |i: I| l.choice(i) |
nom::branch::alt::<&[u8], char, nom::error::Error<&[u8]>, (nom::character::streaming::char<&[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::character::streaming::char<&[u8], nom::error::Error<&[u8]>>::{closure#0})>::{closure#0}Line | Count | Source | 50 | 240k | move |i: I| l.choice(i) |
Unexecuted instantiation: nom::branch::alt::<&str, &str, nom::error::Error<&str>, (nom::number::complete::recognize_float_or_exceptions<&str, nom::error::Error<&str>>::{closure#0}, nom::number::complete::recognize_float_or_exceptions<&str, nom::error::Error<&str>>::{closure#1}, nom::number::complete::recognize_float_or_exceptions<&str, nom::error::Error<&str>>::{closure#2}, nom::number::complete::recognize_float_or_exceptions<&str, nom::error::Error<&str>>::{closure#3})>::{closure#0}nom::branch::alt::<&str, suricata::krb::detect::DetectKrb5TicketEncryptionData, nom::error::Error<&str>, (suricata::krb::detect::detect_parse_encryption_weak, suricata::krb::detect::detect_parse_encryption_list)>::{closure#0}Line | Count | Source | 50 | 5.44k | move |i: I| l.choice(i) |
nom::branch::alt::<&str, bool, nom::error::Error<&str>, (nom::combinator::value<&str, bool, &str, nom::error::Error<&str>, nom::bytes::complete::tag<&str, &str, nom::error::Error<&str>>::{closure#0}>::{closure#0}, nom::combinator::value<&str, bool, &str, nom::error::Error<&str>, nom::bytes::complete::tag<&str, &str, nom::error::Error<&str>>::{closure#0}>::{closure#0})>::{closure#0}Line | Count | Source | 50 | 507 | move |i: I| l.choice(i) |
nom::branch::alt::<&str, &str, nom::error::Error<&str>, (nom::bytes::complete::tag<&str, &str, nom::error::Error<&str>>::{closure#0}, nom::bytes::complete::tag<&str, &str, nom::error::Error<&str>>::{closure#0})>::{closure#0}Line | Count | Source | 50 | 92.0k | move |i: I| l.choice(i) |
nom::branch::alt::<&str, suricata::detect::uint::DetectUintData<u8>, nom::error::Error<&str>, (suricata::detect::uint::detect_parse_uint_start_interval<u8>, suricata::detect::uint::detect_parse_uint_start_equal<u8>, suricata::detect::uint::detect_parse_uint_start_symbol<u8>)>::{closure#0}Line | Count | Source | 50 | 37.8k | move |i: I| l.choice(i) |
nom::branch::alt::<&str, suricata::detect::uint::DetectUintData<u32>, nom::error::Error<&str>, (suricata::detect::uint::detect_parse_uint_start_interval<u32>, suricata::detect::uint::detect_parse_uint_start_equal<u32>, suricata::detect::uint::detect_parse_uint_start_symbol<u32>)>::{closure#0}Line | Count | Source | 50 | 37.3k | move |i: I| l.choice(i) |
nom::branch::alt::<&str, suricata::detect::uint::DetectUintData<u32>, nom::error::Error<&str>, (suricata::detect::uint::detect_parse_uint_start_interval_inclusive<u32>, suricata::detect::uint::detect_parse_uint_start_equal<u32>, suricata::detect::uint::detect_parse_uint_start_symbol<u32>)>::{closure#0}Line | Count | Source | 50 | 23.8k | move |i: I| l.choice(i) |
nom::branch::alt::<&str, suricata::detect::uint::DetectUintData<u16>, nom::error::Error<&str>, (suricata::detect::uint::detect_parse_uint_start_interval<u16>, suricata::detect::uint::detect_parse_uint_start_equal<u16>, suricata::detect::uint::detect_parse_uint_start_symbol<u16>)>::{closure#0}Line | Count | Source | 50 | 26.9k | move |i: I| l.choice(i) |
nom::branch::alt::<&str, suricata::detect::uint::DetectUintData<u64>, nom::error::Error<&str>, (suricata::detect::uint::detect_parse_uint_start_interval<u64>, suricata::detect::uint::detect_parse_uint_start_equal<u64>, suricata::detect::uint::detect_parse_uint_start_symbol<u64>)>::{closure#0}Line | Count | Source | 50 | 37.0k | move |i: I| l.choice(i) |
nom::branch::alt::<&str, suricata::detect::uint::DetectUintMode, nom::error::Error<&str>, (nom::combinator::value<&str, suricata::detect::uint::DetectUintMode, &str, nom::error::Error<&str>, nom::bytes::complete::tag<&str, &str, nom::error::Error<&str>>::{closure#0}>::{closure#0}, nom::combinator::value<&str, suricata::detect::uint::DetectUintMode, &str, nom::error::Error<&str>, nom::bytes::complete::tag<&str, &str, nom::error::Error<&str>>::{closure#0}>::{closure#0}, nom::combinator::value<&str, suricata::detect::uint::DetectUintMode, &str, nom::error::Error<&str>, nom::bytes::complete::tag<&str, &str, nom::error::Error<&str>>::{closure#0}>::{closure#0}, nom::combinator::value<&str, suricata::detect::uint::DetectUintMode, &str, nom::error::Error<&str>, nom::bytes::complete::tag<&str, &str, nom::error::Error<&str>>::{closure#0}>::{closure#0}, nom::combinator::value<&str, suricata::detect::uint::DetectUintMode, &str, nom::error::Error<&str>, nom::bytes::complete::tag<&str, &str, nom::error::Error<&str>>::{closure#0}>::{closure#0}, nom::combinator::value<&str, suricata::detect::uint::DetectUintMode, &str, nom::error::Error<&str>, nom::bytes::complete::tag<&str, &str, nom::error::Error<&str>>::{closure#0}>::{closure#0}, nom::combinator::value<&str, suricata::detect::uint::DetectUintMode, &str, nom::error::Error<&str>, nom::bytes::complete::tag<&str, &str, nom::error::Error<&str>>::{closure#0}>::{closure#0})>::{closure#0}Line | Count | Source | 50 | 75.5k | move |i: I| l.choice(i) |
nom::branch::alt::<&str, u64, nom::error::Error<&str>, (nom::combinator::value<&str, u64, &str, nom::error::Error<&str>, nom::bytes::complete::tag_no_case<&str, &str, nom::error::Error<&str>>::{closure#0}>::{closure#0}, nom::combinator::value<&str, u64, &str, nom::error::Error<&str>, nom::bytes::complete::tag_no_case<&str, &str, nom::error::Error<&str>>::{closure#0}>::{closure#0}, nom::combinator::value<&str, u64, &str, nom::error::Error<&str>, nom::bytes::complete::tag_no_case<&str, &str, nom::error::Error<&str>>::{closure#0}>::{closure#0})>::{closure#0}Line | Count | Source | 50 | 81.9k | move |i: I| l.choice(i) |
nom::branch::alt::<&[u8], asn1_rs::asn1_types::any::Any, asn1_rs::error::Error, (<asn1_rs::asn1_types::any::Any as asn1_rs::traits::FromDer>::from_der, x509_parser::x509::parse_malformed_string)>::{closure#0}Line | Count | Source | 50 | 25.1k | move |i: I| l.choice(i) |
Unexecuted instantiation: nom::branch::alt::<&[u8], der_parser::ber::ber::BerObject, asn1_rs::error::Error, (der_parser::der::parser::parse_der_utf8string, der_parser::der::parser::parse_der_printablestring, der_parser::der::parser::parse_der_universalstring, der_parser::der::parser::parse_der_bmpstring, der_parser::der::parser::parse_der_t61string)>::{closure#0}nom::branch::alt::<&[u8], tls_parser::tls::TlsMessageHandshake, nom::error::Error<&[u8]>, (nom::combinator::complete<&[u8], tls_parser::tls::TlsMessageHandshake, nom::error::Error<&[u8]>, tls_parser::tls::parse_certrequest_full>::{closure#0}, nom::combinator::complete<&[u8], tls_parser::tls::TlsMessageHandshake, nom::error::Error<&[u8]>, tls_parser::tls::parse_certrequest_nosigalg>::{closure#0})>::{closure#0}Line | Count | Source | 50 | 14.2k | move |i: I| l.choice(i) |
Unexecuted instantiation: nom::branch::alt::<_, _, _, _>::{closure#0} |
51 | 210M | } nom::branch::alt::<(&[u8], usize), u8, nom::error::Error<(&[u8], usize)>, (suricata::http2::huffman::http2_decode_huffman_len5, suricata::http2::huffman::http2_decode_huffman_len6, suricata::http2::huffman::http2_decode_huffman_len7, suricata::http2::huffman::http2_decode_huffman_len8, suricata::http2::huffman::http2_decode_huffman_len10, suricata::http2::huffman::http2_decode_huffman_len11, suricata::http2::huffman::http2_decode_huffman_len12, suricata::http2::huffman::http2_decode_huffman_len13, suricata::http2::huffman::http2_decode_huffman_len14, suricata::http2::huffman::http2_decode_huffman_len15, suricata::http2::huffman::http2_decode_huffman_len19, suricata::http2::huffman::http2_decode_huffman_len20, suricata::http2::huffman::http2_decode_huffman_len21, suricata::http2::huffman::http2_decode_huffman_len21, suricata::http2::huffman::http2_decode_huffman_len22, suricata::http2::huffman::http2_decode_huffman_len23, suricata::http2::huffman::http2_decode_huffman_len24, suricata::http2::huffman::http2_decode_huffman_len25, suricata::http2::huffman::http2_decode_huffman_len26, suricata::http2::huffman::http2_decode_huffman_len27, nom::branch::alt<(&[u8], usize), u8, nom::error::Error<(&[u8], usize)>, (suricata::http2::huffman::http2_decode_huffman_len28, suricata::http2::huffman::http2_decode_huffman_len30, suricata::http2::huffman::http2_decode_huffman_end)>::{closure#0})>Line | Count | Source | 47 | 55.0M | pub fn alt<I: Clone, O, E: ParseError<I>, List: Alt<I, O, E>>( | 48 | 55.0M | mut l: List, | 49 | 55.0M | ) -> impl FnMut(I) -> IResult<I, O, E> { | 50 | | move |i: I| l.choice(i) | 51 | 55.0M | } |
nom::branch::alt::<(&[u8], usize), u8, nom::error::Error<(&[u8], usize)>, (suricata::http2::huffman::http2_decode_huffman_len28, suricata::http2::huffman::http2_decode_huffman_len30, suricata::http2::huffman::http2_decode_huffman_end)> Line | Count | Source | 47 | 55.0M | pub fn alt<I: Clone, O, E: ParseError<I>, List: Alt<I, O, E>>( | 48 | 55.0M | mut l: List, | 49 | 55.0M | ) -> impl FnMut(I) -> IResult<I, O, E> { | 50 | | move |i: I| l.choice(i) | 51 | 55.0M | } |
nom::branch::alt::<&[u8], suricata::http2::range::HTTPContentRange, nom::error::Error<&[u8]>, (suricata::http2::range::http2_parse_content_range_star, suricata::http2::range::http2_parse_content_range_def)> Line | Count | Source | 47 | 101k | pub fn alt<I: Clone, O, E: ParseError<I>, List: Alt<I, O, E>>( | 48 | 101k | mut l: List, | 49 | 101k | ) -> impl FnMut(I) -> IResult<I, O, E> { | 50 | | move |i: I| l.choice(i) | 51 | 101k | } |
nom::branch::alt::<&[u8], i64, nom::error::Error<&[u8]>, (nom::combinator::value<&[u8], i64, char, nom::error::Error<&[u8]>, nom::character::complete::char<&[u8], nom::error::Error<&[u8]>>::{closure#0}>::{closure#0}, nom::combinator::map_res<&[u8], &str, i64, nom::error::Error<&[u8]>, core::num::error::ParseIntError, nom::combinator::map_res<&[u8], &[u8], &str, nom::error::Error<&[u8]>, core::str::error::Utf8Error, nom::character::complete::digit1<&[u8], nom::error::Error<&[u8]>>, core::str::converts::from_utf8>::{closure#0}, <i64 as core::str::traits::FromStr>::from_str>::{closure#0})>Line | Count | Source | 47 | 91.3k | pub fn alt<I: Clone, O, E: ParseError<I>, List: Alt<I, O, E>>( | 48 | 91.3k | mut l: List, | 49 | 91.3k | ) -> impl FnMut(I) -> IResult<I, O, E> { | 50 | | move |i: I| l.choice(i) | 51 | 91.3k | } |
nom::branch::alt::<&[u8], asn1_rs::asn1_types::any::Any, asn1_rs::error::Error, (<asn1_rs::asn1_types::any::Any as asn1_rs::traits::FromDer>::from_der, x509_parser::x509::parse_malformed_string)> Line | Count | Source | 47 | 27.3k | pub fn alt<I: Clone, O, E: ParseError<I>, List: Alt<I, O, E>>( | 48 | 27.3k | mut l: List, | 49 | 27.3k | ) -> impl FnMut(I) -> IResult<I, O, E> { | 50 | | move |i: I| l.choice(i) | 51 | 27.3k | } |
Unexecuted instantiation: nom::branch::alt::<&[u8], der_parser::ber::ber::BerObject, asn1_rs::error::Error, (der_parser::der::parser::parse_der_utf8string, der_parser::der::parser::parse_der_printablestring, der_parser::der::parser::parse_der_universalstring, der_parser::der::parser::parse_der_bmpstring, der_parser::der::parser::parse_der_t61string)> nom::branch::alt::<&[u8], tls_parser::tls::TlsMessageHandshake, nom::error::Error<&[u8]>, (nom::combinator::complete<&[u8], tls_parser::tls::TlsMessageHandshake, nom::error::Error<&[u8]>, tls_parser::tls::parse_certrequest_full>::{closure#0}, nom::combinator::complete<&[u8], tls_parser::tls::TlsMessageHandshake, nom::error::Error<&[u8]>, tls_parser::tls::parse_certrequest_nosigalg>::{closure#0})>Line | Count | Source | 47 | 31.5k | pub fn alt<I: Clone, O, E: ParseError<I>, List: Alt<I, O, E>>( | 48 | 31.5k | mut l: List, | 49 | 31.5k | ) -> impl FnMut(I) -> IResult<I, O, E> { | 50 | | move |i: I| l.choice(i) | 51 | 31.5k | } |
Unexecuted instantiation: nom::branch::alt::<_, _, _, _> nom::branch::alt::<(&[u8], usize), u8, nom::error::Error<(&[u8], usize)>, (suricata::http2::huffman::http2_decode_huffman_len5, suricata::http2::huffman::http2_decode_huffman_len6, suricata::http2::huffman::http2_decode_huffman_len7, suricata::http2::huffman::http2_decode_huffman_len8, suricata::http2::huffman::http2_decode_huffman_len10, suricata::http2::huffman::http2_decode_huffman_len11, suricata::http2::huffman::http2_decode_huffman_len12, suricata::http2::huffman::http2_decode_huffman_len13, suricata::http2::huffman::http2_decode_huffman_len14, suricata::http2::huffman::http2_decode_huffman_len15, suricata::http2::huffman::http2_decode_huffman_len19, suricata::http2::huffman::http2_decode_huffman_len20, suricata::http2::huffman::http2_decode_huffman_len21, suricata::http2::huffman::http2_decode_huffman_len21, suricata::http2::huffman::http2_decode_huffman_len22, suricata::http2::huffman::http2_decode_huffman_len23, suricata::http2::huffman::http2_decode_huffman_len24, suricata::http2::huffman::http2_decode_huffman_len25, suricata::http2::huffman::http2_decode_huffman_len26, suricata::http2::huffman::http2_decode_huffman_len27, nom::branch::alt<(&[u8], usize), u8, nom::error::Error<(&[u8], usize)>, (suricata::http2::huffman::http2_decode_huffman_len28, suricata::http2::huffman::http2_decode_huffman_len30, suricata::http2::huffman::http2_decode_huffman_end)>::{closure#0})>Line | Count | Source | 47 | 46.2M | pub fn alt<I: Clone, O, E: ParseError<I>, List: Alt<I, O, E>>( | 48 | 46.2M | mut l: List, | 49 | 46.2M | ) -> impl FnMut(I) -> IResult<I, O, E> { | 50 | | move |i: I| l.choice(i) | 51 | 46.2M | } |
nom::branch::alt::<(&[u8], usize), u8, nom::error::Error<(&[u8], usize)>, (suricata::http2::huffman::http2_decode_huffman_len28, suricata::http2::huffman::http2_decode_huffman_len30, suricata::http2::huffman::http2_decode_huffman_end)> Line | Count | Source | 47 | 46.2M | pub fn alt<I: Clone, O, E: ParseError<I>, List: Alt<I, O, E>>( | 48 | 46.2M | mut l: List, | 49 | 46.2M | ) -> impl FnMut(I) -> IResult<I, O, E> { | 50 | | move |i: I| l.choice(i) | 51 | 46.2M | } |
nom::branch::alt::<&[u8], &[u8], nom::error::Error<&[u8]>, (suricata::mime::mime_parse_value_delimited, nom::combinator::complete<&[u8], &[u8], nom::error::Error<&[u8]>, nom::bytes::streaming::take_until<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0}>::{closure#0}, nom::combinator::rest<&[u8], nom::error::Error<&[u8]>>)>Line | Count | Source | 47 | 6.96M | pub fn alt<I: Clone, O, E: ParseError<I>, List: Alt<I, O, E>>( | 48 | 6.96M | mut l: List, | 49 | 6.96M | ) -> impl FnMut(I) -> IResult<I, O, E> { | 50 | | move |i: I| l.choice(i) | 51 | 6.96M | } |
nom::branch::alt::<&[u8], suricata::http2::range::HTTPContentRange, nom::error::Error<&[u8]>, (suricata::http2::range::http2_parse_content_range_star, suricata::http2::range::http2_parse_content_range_def)> Line | Count | Source | 47 | 71.1k | pub fn alt<I: Clone, O, E: ParseError<I>, List: Alt<I, O, E>>( | 48 | 71.1k | mut l: List, | 49 | 71.1k | ) -> impl FnMut(I) -> IResult<I, O, E> { | 50 | | move |i: I| l.choice(i) | 51 | 71.1k | } |
nom::branch::alt::<&[u8], i64, nom::error::Error<&[u8]>, (nom::combinator::value<&[u8], i64, char, nom::error::Error<&[u8]>, nom::character::complete::char<&[u8], nom::error::Error<&[u8]>>::{closure#0}>::{closure#0}, nom::combinator::map_res<&[u8], &str, i64, nom::error::Error<&[u8]>, core::num::error::ParseIntError, nom::combinator::map_res<&[u8], &[u8], &str, nom::error::Error<&[u8]>, core::str::error::Utf8Error, nom::character::complete::digit1<&[u8], nom::error::Error<&[u8]>>, core::str::converts::from_utf8>::{closure#0}, <i64 as core::str::traits::FromStr>::from_str>::{closure#0})>Line | Count | Source | 47 | 64.1k | pub fn alt<I: Clone, O, E: ParseError<I>, List: Alt<I, O, E>>( | 48 | 64.1k | mut l: List, | 49 | 64.1k | ) -> impl FnMut(I) -> IResult<I, O, E> { | 50 | | move |i: I| l.choice(i) | 51 | 64.1k | } |
nom::branch::alt::<&[u8], &[u8], nom::error::Error<&[u8]>, (nom::combinator::complete<&[u8], &[u8], nom::error::Error<&[u8]>, nom::bytes::streaming::is_not<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0}>::{closure#0}, nom::combinator::rest<&[u8], nom::error::Error<&[u8]>>)>Line | Count | Source | 47 | 3.71k | pub fn alt<I: Clone, O, E: ParseError<I>, List: Alt<I, O, E>>( | 48 | 3.71k | mut l: List, | 49 | 3.71k | ) -> impl FnMut(I) -> IResult<I, O, E> { | 50 | | move |i: I| l.choice(i) | 51 | 3.71k | } |
nom::branch::alt::<&[u8], &[u8], nom::error::Error<&[u8]>, (nom::bytes::streaming::tag<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::bytes::streaming::tag<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::bytes::streaming::tag<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::bytes::streaming::tag<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::bytes::streaming::tag<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0})>Line | Count | Source | 47 | 6.95k | pub fn alt<I: Clone, O, E: ParseError<I>, List: Alt<I, O, E>>( | 48 | 6.95k | mut l: List, | 49 | 6.95k | ) -> impl FnMut(I) -> IResult<I, O, E> { | 50 | | move |i: I| l.choice(i) | 51 | 6.95k | } |
nom::branch::alt::<&[u8], &[u8], nom::error::Error<&[u8]>, (nom::bytes::streaming::tag<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::bytes::streaming::tag<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::bytes::streaming::tag<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0})>Line | Count | Source | 47 | 8.55k | pub fn alt<I: Clone, O, E: ParseError<I>, List: Alt<I, O, E>>( | 48 | 8.55k | mut l: List, | 49 | 8.55k | ) -> impl FnMut(I) -> IResult<I, O, E> { | 50 | | move |i: I| l.choice(i) | 51 | 8.55k | } |
nom::branch::alt::<&[u8], &[u8], nom::error::Error<&[u8]>, (nom::bytes::streaming::tag<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::bytes::streaming::tag<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0}, suricata::ssh::parser::ssh_parse_line::parser)>Line | Count | Source | 47 | 97.4k | pub fn alt<I: Clone, O, E: ParseError<I>, List: Alt<I, O, E>>( | 48 | 97.4k | mut l: List, | 49 | 97.4k | ) -> impl FnMut(I) -> IResult<I, O, E> { | 50 | | move |i: I| l.choice(i) | 51 | 97.4k | } |
nom::branch::alt::<&[u8], char, nom::error::Error<&[u8]>, (nom::character::streaming::char<&[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::character::streaming::char<&[u8], nom::error::Error<&[u8]>>::{closure#0})>Line | Count | Source | 47 | 240k | pub fn alt<I: Clone, O, E: ParseError<I>, List: Alt<I, O, E>>( | 48 | 240k | mut l: List, | 49 | 240k | ) -> impl FnMut(I) -> IResult<I, O, E> { | 50 | | move |i: I| l.choice(i) | 51 | 240k | } |
nom::branch::alt::<&str, &str, nom::error::Error<&str>, (nom::combinator::complete<&str, &str, nom::error::Error<&str>, nom::bytes::streaming::is_not<&str, &str, nom::error::Error<&str>>::{closure#0}>::{closure#0}, nom::combinator::rest<&str, nom::error::Error<&str>>)>Line | Count | Source | 47 | 9.30k | pub fn alt<I: Clone, O, E: ParseError<I>, List: Alt<I, O, E>>( | 48 | 9.30k | mut l: List, | 49 | 9.30k | ) -> impl FnMut(I) -> IResult<I, O, E> { | 50 | | move |i: I| l.choice(i) | 51 | 9.30k | } |
Unexecuted instantiation: nom::branch::alt::<&str, &str, nom::error::Error<&str>, (nom::number::complete::recognize_float_or_exceptions<&str, nom::error::Error<&str>>::{closure#0}, nom::number::complete::recognize_float_or_exceptions<&str, nom::error::Error<&str>>::{closure#1}, nom::number::complete::recognize_float_or_exceptions<&str, nom::error::Error<&str>>::{closure#2}, nom::number::complete::recognize_float_or_exceptions<&str, nom::error::Error<&str>>::{closure#3})>nom::branch::alt::<&str, suricata::krb::detect::DetectKrb5TicketEncryptionData, nom::error::Error<&str>, (suricata::krb::detect::detect_parse_encryption_weak, suricata::krb::detect::detect_parse_encryption_list)> Line | Count | Source | 47 | 5.44k | pub fn alt<I: Clone, O, E: ParseError<I>, List: Alt<I, O, E>>( | 48 | 5.44k | mut l: List, | 49 | 5.44k | ) -> impl FnMut(I) -> IResult<I, O, E> { | 50 | | move |i: I| l.choice(i) | 51 | 5.44k | } |
nom::branch::alt::<&str, bool, nom::error::Error<&str>, (nom::combinator::value<&str, bool, &str, nom::error::Error<&str>, nom::bytes::complete::tag<&str, &str, nom::error::Error<&str>>::{closure#0}>::{closure#0}, nom::combinator::value<&str, bool, &str, nom::error::Error<&str>, nom::bytes::complete::tag<&str, &str, nom::error::Error<&str>>::{closure#0}>::{closure#0})>Line | Count | Source | 47 | 507 | pub fn alt<I: Clone, O, E: ParseError<I>, List: Alt<I, O, E>>( | 48 | 507 | mut l: List, | 49 | 507 | ) -> impl FnMut(I) -> IResult<I, O, E> { | 50 | | move |i: I| l.choice(i) | 51 | 507 | } |
Unexecuted instantiation: nom::branch::alt::<&str, char, nom::error::Error<&str>, (nom::character::complete::char<&str, nom::error::Error<&str>>::{closure#0}, nom::character::complete::char<&str, nom::error::Error<&str>>::{closure#0})>Unexecuted instantiation: nom::branch::alt::<&str, (), nom::error::Error<&str>, (nom::combinator::map<&str, (&str, core::option::Option<(char, core::option::Option<&str>)>), (), nom::error::Error<&str>, nom::sequence::tuple<&str, (&str, core::option::Option<(char, core::option::Option<&str>)>), nom::error::Error<&str>, (nom::character::complete::digit1<&str, nom::error::Error<&str>>, nom::combinator::opt<&str, (char, core::option::Option<&str>), nom::error::Error<&str>, nom::sequence::pair<&str, char, core::option::Option<&str>, nom::error::Error<&str>, nom::character::complete::char<&str, nom::error::Error<&str>>::{closure#0}, nom::combinator::opt<&str, &str, nom::error::Error<&str>, nom::character::complete::digit1<&str, nom::error::Error<&str>>>::{closure#0}>::{closure#0}>::{closure#0})>::{closure#0}, nom::number::complete::recognize_float<&str, nom::error::Error<&str>>::{closure#0}>::{closure#0}, nom::combinator::map<&str, (char, &str), (), nom::error::Error<&str>, nom::sequence::tuple<&str, (char, &str), nom::error::Error<&str>, (nom::character::complete::char<&str, nom::error::Error<&str>>::{closure#0}, nom::character::complete::digit1<&str, nom::error::Error<&str>>)>::{closure#0}, nom::number::complete::recognize_float<&str, nom::error::Error<&str>>::{closure#1}>::{closure#0})>nom::branch::alt::<&str, &str, nom::error::Error<&str>, (nom::character::complete::multispace1<&str, nom::error::Error<&str>>, nom::bytes::complete::tag<&str, &str, nom::error::Error<&str>>::{closure#0})>Line | Count | Source | 47 | 6.01k | pub fn alt<I: Clone, O, E: ParseError<I>, List: Alt<I, O, E>>( | 48 | 6.01k | mut l: List, | 49 | 6.01k | ) -> impl FnMut(I) -> IResult<I, O, E> { | 50 | | move |i: I| l.choice(i) | 51 | 6.01k | } |
nom::branch::alt::<&str, &str, nom::error::Error<&str>, (nom::bytes::complete::tag<&str, &str, nom::error::Error<&str>>::{closure#0}, nom::bytes::complete::tag<&str, &str, nom::error::Error<&str>>::{closure#0})>Line | Count | Source | 47 | 92.0k | pub fn alt<I: Clone, O, E: ParseError<I>, List: Alt<I, O, E>>( | 48 | 92.0k | mut l: List, | 49 | 92.0k | ) -> impl FnMut(I) -> IResult<I, O, E> { | 50 | | move |i: I| l.choice(i) | 51 | 92.0k | } |
nom::branch::alt::<&str, suricata::detect::uint::DetectUintData<u8>, nom::error::Error<&str>, (suricata::detect::uint::detect_parse_uint_start_interval<u8>, suricata::detect::uint::detect_parse_uint_start_equal<u8>, suricata::detect::uint::detect_parse_uint_start_symbol<u8>)> Line | Count | Source | 47 | 37.8k | pub fn alt<I: Clone, O, E: ParseError<I>, List: Alt<I, O, E>>( | 48 | 37.8k | mut l: List, | 49 | 37.8k | ) -> impl FnMut(I) -> IResult<I, O, E> { | 50 | | move |i: I| l.choice(i) | 51 | 37.8k | } |
nom::branch::alt::<&str, suricata::detect::uint::DetectUintData<u32>, nom::error::Error<&str>, (suricata::detect::uint::detect_parse_uint_start_interval<u32>, suricata::detect::uint::detect_parse_uint_start_equal<u32>, suricata::detect::uint::detect_parse_uint_start_symbol<u32>)> Line | Count | Source | 47 | 37.3k | pub fn alt<I: Clone, O, E: ParseError<I>, List: Alt<I, O, E>>( | 48 | 37.3k | mut l: List, | 49 | 37.3k | ) -> impl FnMut(I) -> IResult<I, O, E> { | 50 | | move |i: I| l.choice(i) | 51 | 37.3k | } |
nom::branch::alt::<&str, suricata::detect::uint::DetectUintData<u32>, nom::error::Error<&str>, (suricata::detect::uint::detect_parse_uint_start_interval_inclusive<u32>, suricata::detect::uint::detect_parse_uint_start_equal<u32>, suricata::detect::uint::detect_parse_uint_start_symbol<u32>)> Line | Count | Source | 47 | 23.8k | pub fn alt<I: Clone, O, E: ParseError<I>, List: Alt<I, O, E>>( | 48 | 23.8k | mut l: List, | 49 | 23.8k | ) -> impl FnMut(I) -> IResult<I, O, E> { | 50 | | move |i: I| l.choice(i) | 51 | 23.8k | } |
nom::branch::alt::<&str, suricata::detect::uint::DetectUintData<u16>, nom::error::Error<&str>, (suricata::detect::uint::detect_parse_uint_start_interval<u16>, suricata::detect::uint::detect_parse_uint_start_equal<u16>, suricata::detect::uint::detect_parse_uint_start_symbol<u16>)> Line | Count | Source | 47 | 26.9k | pub fn alt<I: Clone, O, E: ParseError<I>, List: Alt<I, O, E>>( | 48 | 26.9k | mut l: List, | 49 | 26.9k | ) -> impl FnMut(I) -> IResult<I, O, E> { | 50 | | move |i: I| l.choice(i) | 51 | 26.9k | } |
nom::branch::alt::<&str, suricata::detect::uint::DetectUintData<u64>, nom::error::Error<&str>, (suricata::detect::uint::detect_parse_uint_start_interval<u64>, suricata::detect::uint::detect_parse_uint_start_equal<u64>, suricata::detect::uint::detect_parse_uint_start_symbol<u64>)> Line | Count | Source | 47 | 37.0k | pub fn alt<I: Clone, O, E: ParseError<I>, List: Alt<I, O, E>>( | 48 | 37.0k | mut l: List, | 49 | 37.0k | ) -> impl FnMut(I) -> IResult<I, O, E> { | 50 | | move |i: I| l.choice(i) | 51 | 37.0k | } |
nom::branch::alt::<&str, suricata::detect::uint::DetectUintMode, nom::error::Error<&str>, (nom::combinator::value<&str, suricata::detect::uint::DetectUintMode, &str, nom::error::Error<&str>, nom::bytes::complete::tag<&str, &str, nom::error::Error<&str>>::{closure#0}>::{closure#0}, nom::combinator::value<&str, suricata::detect::uint::DetectUintMode, &str, nom::error::Error<&str>, nom::bytes::complete::tag<&str, &str, nom::error::Error<&str>>::{closure#0}>::{closure#0}, nom::combinator::value<&str, suricata::detect::uint::DetectUintMode, &str, nom::error::Error<&str>, nom::bytes::complete::tag<&str, &str, nom::error::Error<&str>>::{closure#0}>::{closure#0}, nom::combinator::value<&str, suricata::detect::uint::DetectUintMode, &str, nom::error::Error<&str>, nom::bytes::complete::tag<&str, &str, nom::error::Error<&str>>::{closure#0}>::{closure#0}, nom::combinator::value<&str, suricata::detect::uint::DetectUintMode, &str, nom::error::Error<&str>, nom::bytes::complete::tag<&str, &str, nom::error::Error<&str>>::{closure#0}>::{closure#0}, nom::combinator::value<&str, suricata::detect::uint::DetectUintMode, &str, nom::error::Error<&str>, nom::bytes::complete::tag<&str, &str, nom::error::Error<&str>>::{closure#0}>::{closure#0}, nom::combinator::value<&str, suricata::detect::uint::DetectUintMode, &str, nom::error::Error<&str>, nom::bytes::complete::tag<&str, &str, nom::error::Error<&str>>::{closure#0}>::{closure#0})>Line | Count | Source | 47 | 75.5k | pub fn alt<I: Clone, O, E: ParseError<I>, List: Alt<I, O, E>>( | 48 | 75.5k | mut l: List, | 49 | 75.5k | ) -> impl FnMut(I) -> IResult<I, O, E> { | 50 | | move |i: I| l.choice(i) | 51 | 75.5k | } |
nom::branch::alt::<&str, suricata::detect::requires::VersionCompareOp, nom::error::Error<&str>, (nom::combinator::map<&str, &str, suricata::detect::requires::VersionCompareOp, nom::error::Error<&str>, nom::bytes::complete::tag<&str, &str, nom::error::Error<&str>>::{closure#0}, suricata::detect::requires::parse_op::{closure#0}>::{closure#0}, nom::combinator::map<&str, &str, suricata::detect::requires::VersionCompareOp, nom::error::Error<&str>, nom::bytes::complete::tag<&str, &str, nom::error::Error<&str>>::{closure#0}, suricata::detect::requires::parse_op::{closure#1}>::{closure#0}, nom::combinator::map<&str, &str, suricata::detect::requires::VersionCompareOp, nom::error::Error<&str>, nom::bytes::complete::tag<&str, &str, nom::error::Error<&str>>::{closure#0}, suricata::detect::requires::parse_op::{closure#2}>::{closure#0}, nom::combinator::map<&str, &str, suricata::detect::requires::VersionCompareOp, nom::error::Error<&str>, nom::bytes::complete::tag<&str, &str, nom::error::Error<&str>>::{closure#0}, suricata::detect::requires::parse_op::{closure#3}>::{closure#0})>Line | Count | Source | 47 | 62.2k | pub fn alt<I: Clone, O, E: ParseError<I>, List: Alt<I, O, E>>( | 48 | 62.2k | mut l: List, | 49 | 62.2k | ) -> impl FnMut(I) -> IResult<I, O, E> { | 50 | | move |i: I| l.choice(i) | 51 | 62.2k | } |
nom::branch::alt::<&str, u64, nom::error::Error<&str>, (nom::combinator::value<&str, u64, &str, nom::error::Error<&str>, nom::bytes::complete::tag_no_case<&str, &str, nom::error::Error<&str>>::{closure#0}>::{closure#0}, nom::combinator::value<&str, u64, &str, nom::error::Error<&str>, nom::bytes::complete::tag_no_case<&str, &str, nom::error::Error<&str>>::{closure#0}>::{closure#0}, nom::combinator::value<&str, u64, &str, nom::error::Error<&str>, nom::bytes::complete::tag_no_case<&str, &str, nom::error::Error<&str>>::{closure#0}>::{closure#0})>Line | Count | Source | 47 | 81.9k | pub fn alt<I: Clone, O, E: ParseError<I>, List: Alt<I, O, E>>( | 48 | 81.9k | mut l: List, | 49 | 81.9k | ) -> impl FnMut(I) -> IResult<I, O, E> { | 50 | | move |i: I| l.choice(i) | 51 | 81.9k | } |
nom::branch::alt::<&[u8], asn1_rs::asn1_types::any::Any, asn1_rs::error::Error, (<asn1_rs::asn1_types::any::Any as asn1_rs::traits::FromDer>::from_der, x509_parser::x509::parse_malformed_string)> Line | Count | Source | 47 | 25.1k | pub fn alt<I: Clone, O, E: ParseError<I>, List: Alt<I, O, E>>( | 48 | 25.1k | mut l: List, | 49 | 25.1k | ) -> impl FnMut(I) -> IResult<I, O, E> { | 50 | | move |i: I| l.choice(i) | 51 | 25.1k | } |
Unexecuted instantiation: nom::branch::alt::<&[u8], der_parser::ber::ber::BerObject, asn1_rs::error::Error, (der_parser::der::parser::parse_der_utf8string, der_parser::der::parser::parse_der_printablestring, der_parser::der::parser::parse_der_universalstring, der_parser::der::parser::parse_der_bmpstring, der_parser::der::parser::parse_der_t61string)> nom::branch::alt::<&[u8], tls_parser::tls::TlsMessageHandshake, nom::error::Error<&[u8]>, (nom::combinator::complete<&[u8], tls_parser::tls::TlsMessageHandshake, nom::error::Error<&[u8]>, tls_parser::tls::parse_certrequest_full>::{closure#0}, nom::combinator::complete<&[u8], tls_parser::tls::TlsMessageHandshake, nom::error::Error<&[u8]>, tls_parser::tls::parse_certrequest_nosigalg>::{closure#0})>Line | Count | Source | 47 | 14.2k | pub fn alt<I: Clone, O, E: ParseError<I>, List: Alt<I, O, E>>( | 48 | 14.2k | mut l: List, | 49 | 14.2k | ) -> impl FnMut(I) -> IResult<I, O, E> { | 50 | | move |i: I| l.choice(i) | 51 | 14.2k | } |
Unexecuted instantiation: nom::branch::alt::<_, _, _, _> |
52 | | |
53 | | /// Helper trait for the [permutation()] combinator. |
54 | | /// |
55 | | /// This trait is implemented for tuples of up to 21 elements |
56 | | pub trait Permutation<I, O, E> { |
57 | | /// Tries to apply all parsers in the tuple in various orders until all of them succeed |
58 | | fn permutation(&mut self, input: I) -> IResult<I, O, E>; |
59 | | } |
60 | | |
61 | | /// Applies a list of parsers in any order. |
62 | | /// |
63 | | /// Permutation will succeed if all of the child parsers succeeded. |
64 | | /// It takes as argument a tuple of parsers, and returns a |
65 | | /// tuple of the parser results. |
66 | | /// |
67 | | /// ```rust |
68 | | /// # use nom::{Err,error::{Error, ErrorKind}, Needed, IResult}; |
69 | | /// use nom::character::complete::{alpha1, digit1}; |
70 | | /// use nom::branch::permutation; |
71 | | /// # fn main() { |
72 | | /// fn parser(input: &str) -> IResult<&str, (&str, &str)> { |
73 | | /// permutation((alpha1, digit1))(input) |
74 | | /// } |
75 | | /// |
76 | | /// // permutation recognizes alphabetic characters then digit |
77 | | /// assert_eq!(parser("abc123"), Ok(("", ("abc", "123")))); |
78 | | /// |
79 | | /// // but also in inverse order |
80 | | /// assert_eq!(parser("123abc"), Ok(("", ("abc", "123")))); |
81 | | /// |
82 | | /// // it will fail if one of the parsers failed |
83 | | /// assert_eq!(parser("abc;"), Err(Err::Error(Error::new(";", ErrorKind::Digit)))); |
84 | | /// # } |
85 | | /// ``` |
86 | | /// |
87 | | /// The parsers are applied greedily: if there are multiple unapplied parsers |
88 | | /// that could parse the next slice of input, the first one is used. |
89 | | /// ```rust |
90 | | /// # use nom::{Err, error::{Error, ErrorKind}, IResult}; |
91 | | /// use nom::branch::permutation; |
92 | | /// use nom::character::complete::{anychar, char}; |
93 | | /// |
94 | | /// fn parser(input: &str) -> IResult<&str, (char, char)> { |
95 | | /// permutation((anychar, char('a')))(input) |
96 | | /// } |
97 | | /// |
98 | | /// // anychar parses 'b', then char('a') parses 'a' |
99 | | /// assert_eq!(parser("ba"), Ok(("", ('b', 'a')))); |
100 | | /// |
101 | | /// // anychar parses 'a', then char('a') fails on 'b', |
102 | | /// // even though char('a') followed by anychar would succeed |
103 | | /// assert_eq!(parser("ab"), Err(Err::Error(Error::new("b", ErrorKind::Char)))); |
104 | | /// ``` |
105 | | /// |
106 | 0 | pub fn permutation<I: Clone, O, E: ParseError<I>, List: Permutation<I, O, E>>( |
107 | 0 | mut l: List, |
108 | 0 | ) -> impl FnMut(I) -> IResult<I, O, E> { |
109 | 0 | move |i: I| l.permutation(i) Unexecuted instantiation: nom::branch::permutation::<_, _, _, _>::{closure#0}Unexecuted instantiation: nom::branch::permutation::<_, _, _, _>::{closure#0} |
110 | 0 | } Unexecuted instantiation: nom::branch::permutation::<_, _, _, _> Unexecuted instantiation: nom::branch::permutation::<_, _, _, _> |
111 | | |
112 | | macro_rules! alt_trait( |
113 | | ($first:ident $second:ident $($id: ident)+) => ( |
114 | | alt_trait!(__impl $first $second; $($id)+); |
115 | | ); |
116 | | (__impl $($current:ident)*; $head:ident $($id: ident)+) => ( |
117 | | alt_trait_impl!($($current)*); |
118 | | |
119 | | alt_trait!(__impl $($current)* $head; $($id)+); |
120 | | ); |
121 | | (__impl $($current:ident)*; $head:ident) => ( |
122 | | alt_trait_impl!($($current)*); |
123 | | alt_trait_impl!($($current)* $head); |
124 | | ); |
125 | | ); |
126 | | |
127 | | macro_rules! alt_trait_impl( |
128 | | ($($id:ident)+) => ( |
129 | | impl< |
130 | | Input: Clone, Output, Error: ParseError<Input>, |
131 | | $($id: Parser<Input, Output, Error>),+ |
132 | | > Alt<Input, Output, Error> for ( $($id),+ ) { |
133 | | |
134 | 112M | fn choice(&mut self, input: Input) -> IResult<Input, Output, Error> { |
135 | 112M | match self.0.parse(input.clone()) { |
136 | 67.0M | Err(Err::Error(e)) => alt_trait_inner!(1, self, input, e, $($id)+), |
137 | 45.0M | res => res, |
138 | | } |
139 | 112M | } <(suricata::http2::huffman::http2_decode_huffman_len28, suricata::http2::huffman::http2_decode_huffman_len30, suricata::http2::huffman::http2_decode_huffman_end) as nom::branch::Alt<(&[u8], usize), u8, nom::error::Error<(&[u8], usize)>>>::choice Line | Count | Source | 134 | 1.81M | fn choice(&mut self, input: Input) -> IResult<Input, Output, Error> { | 135 | 1.81M | match self.0.parse(input.clone()) { | 136 | 1.71M | Err(Err::Error(e)) => alt_trait_inner!(1, self, input, e, $($id)+), | 137 | 105k | res => res, | 138 | | } | 139 | 1.81M | } |
<(suricata::http2::huffman::http2_decode_huffman_len5, suricata::http2::huffman::http2_decode_huffman_len6, suricata::http2::huffman::http2_decode_huffman_len7, suricata::http2::huffman::http2_decode_huffman_len8, suricata::http2::huffman::http2_decode_huffman_len10, suricata::http2::huffman::http2_decode_huffman_len11, suricata::http2::huffman::http2_decode_huffman_len12, suricata::http2::huffman::http2_decode_huffman_len13, suricata::http2::huffman::http2_decode_huffman_len14, suricata::http2::huffman::http2_decode_huffman_len15, suricata::http2::huffman::http2_decode_huffman_len19, suricata::http2::huffman::http2_decode_huffman_len20, suricata::http2::huffman::http2_decode_huffman_len21, suricata::http2::huffman::http2_decode_huffman_len21, suricata::http2::huffman::http2_decode_huffman_len22, suricata::http2::huffman::http2_decode_huffman_len23, suricata::http2::huffman::http2_decode_huffman_len24, suricata::http2::huffman::http2_decode_huffman_len25, suricata::http2::huffman::http2_decode_huffman_len26, suricata::http2::huffman::http2_decode_huffman_len27, nom::branch::alt<(&[u8], usize), u8, nom::error::Error<(&[u8], usize)>, (suricata::http2::huffman::http2_decode_huffman_len28, suricata::http2::huffman::http2_decode_huffman_len30, suricata::http2::huffman::http2_decode_huffman_end)>::{closure#0}) as nom::branch::Alt<(&[u8], usize), u8, nom::error::Error<(&[u8], usize)>>>::choiceLine | Count | Source | 134 | 55.0M | fn choice(&mut self, input: Input) -> IResult<Input, Output, Error> { | 135 | 55.0M | match self.0.parse(input.clone()) { | 136 | 31.8M | Err(Err::Error(e)) => alt_trait_inner!(1, self, input, e, $($id)+), | 137 | 23.1M | res => res, | 138 | | } | 139 | 55.0M | } |
<(nom::combinator::value<&[u8], i64, char, nom::error::Error<&[u8]>, nom::character::complete::char<&[u8], nom::error::Error<&[u8]>>::{closure#0}>::{closure#0}, nom::combinator::map_res<&[u8], &str, i64, nom::error::Error<&[u8]>, core::num::error::ParseIntError, nom::combinator::map_res<&[u8], &[u8], &str, nom::error::Error<&[u8]>, core::str::error::Utf8Error, nom::character::complete::digit1<&[u8], nom::error::Error<&[u8]>>, core::str::converts::from_utf8>::{closure#0}, <i64 as core::str::traits::FromStr>::from_str>::{closure#0}) as nom::branch::Alt<&[u8], i64, nom::error::Error<&[u8]>>>::choiceLine | Count | Source | 134 | 91.3k | fn choice(&mut self, input: Input) -> IResult<Input, Output, Error> { | 135 | 91.3k | match self.0.parse(input.clone()) { | 136 | 90.9k | Err(Err::Error(e)) => alt_trait_inner!(1, self, input, e, $($id)+), | 137 | 401 | res => res, | 138 | | } | 139 | 91.3k | } |
<(suricata::http2::range::http2_parse_content_range_star, suricata::http2::range::http2_parse_content_range_def) as nom::branch::Alt<&[u8], suricata::http2::range::HTTPContentRange, nom::error::Error<&[u8]>>>::choice Line | Count | Source | 134 | 101k | fn choice(&mut self, input: Input) -> IResult<Input, Output, Error> { | 135 | 101k | match self.0.parse(input.clone()) { | 136 | 101k | Err(Err::Error(e)) => alt_trait_inner!(1, self, input, e, $($id)+), | 137 | 256 | res => res, | 138 | | } | 139 | 101k | } |
Unexecuted instantiation: <(der_parser::der::parser::parse_der_utf8string, der_parser::der::parser::parse_der_printablestring, der_parser::der::parser::parse_der_universalstring, der_parser::der::parser::parse_der_bmpstring, der_parser::der::parser::parse_der_t61string) as nom::branch::Alt<&[u8], der_parser::ber::ber::BerObject, asn1_rs::error::Error>>::choice <(<asn1_rs::asn1_types::any::Any as asn1_rs::traits::FromDer>::from_der, x509_parser::x509::parse_malformed_string) as nom::branch::Alt<&[u8], asn1_rs::asn1_types::any::Any, asn1_rs::error::Error>>::choice Line | Count | Source | 134 | 27.3k | fn choice(&mut self, input: Input) -> IResult<Input, Output, Error> { | 135 | 27.3k | match self.0.parse(input.clone()) { | 136 | 102 | Err(Err::Error(e)) => alt_trait_inner!(1, self, input, e, $($id)+), | 137 | 27.2k | res => res, | 138 | | } | 139 | 27.3k | } |
<(nom::combinator::complete<&[u8], tls_parser::tls::TlsMessageHandshake, nom::error::Error<&[u8]>, tls_parser::tls::parse_certrequest_full>::{closure#0}, nom::combinator::complete<&[u8], tls_parser::tls::TlsMessageHandshake, nom::error::Error<&[u8]>, tls_parser::tls::parse_certrequest_nosigalg>::{closure#0}) as nom::branch::Alt<&[u8], tls_parser::tls::TlsMessageHandshake, nom::error::Error<&[u8]>>>::choiceLine | Count | Source | 134 | 31.5k | fn choice(&mut self, input: Input) -> IResult<Input, Output, Error> { | 135 | 31.5k | match self.0.parse(input.clone()) { | 136 | 30.6k | Err(Err::Error(e)) => alt_trait_inner!(1, self, input, e, $($id)+), | 137 | 928 | res => res, | 138 | | } | 139 | 31.5k | } |
Unexecuted instantiation: <(_, _, _) as nom::branch::Alt<_, _, _>>::choice Unexecuted instantiation: <(_, _, _, _) as nom::branch::Alt<_, _, _>>::choice Unexecuted instantiation: <(_, _, _, _, _) as nom::branch::Alt<_, _, _>>::choice Unexecuted instantiation: <(_, _, _, _, _, _) as nom::branch::Alt<_, _, _>>::choice Unexecuted instantiation: <(_, _, _, _, _, _, _) as nom::branch::Alt<_, _, _>>::choice Unexecuted instantiation: <(_, _, _, _, _, _, _, _) as nom::branch::Alt<_, _, _>>::choice Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _) as nom::branch::Alt<_, _, _>>::choice Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _) as nom::branch::Alt<_, _, _>>::choice Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _) as nom::branch::Alt<_, _, _>>::choice Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _) as nom::branch::Alt<_, _, _>>::choice Unexecuted instantiation: <(_, _) as nom::branch::Alt<_, _, _>>::choice Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _) as nom::branch::Alt<_, _, _>>::choice Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _) as nom::branch::Alt<_, _, _>>::choice Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as nom::branch::Alt<_, _, _>>::choice Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as nom::branch::Alt<_, _, _>>::choice Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as nom::branch::Alt<_, _, _>>::choice Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as nom::branch::Alt<_, _, _>>::choice Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as nom::branch::Alt<_, _, _>>::choice Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as nom::branch::Alt<_, _, _>>::choice Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as nom::branch::Alt<_, _, _>>::choice <(suricata::http2::huffman::http2_decode_huffman_len28, suricata::http2::huffman::http2_decode_huffman_len30, suricata::http2::huffman::http2_decode_huffman_end) as nom::branch::Alt<(&[u8], usize), u8, nom::error::Error<(&[u8], usize)>>>::choice Line | Count | Source | 134 | 783k | fn choice(&mut self, input: Input) -> IResult<Input, Output, Error> { | 135 | 783k | match self.0.parse(input.clone()) { | 136 | 559k | Err(Err::Error(e)) => alt_trait_inner!(1, self, input, e, $($id)+), | 137 | 224k | res => res, | 138 | | } | 139 | 783k | } |
<(suricata::http2::huffman::http2_decode_huffman_len5, suricata::http2::huffman::http2_decode_huffman_len6, suricata::http2::huffman::http2_decode_huffman_len7, suricata::http2::huffman::http2_decode_huffman_len8, suricata::http2::huffman::http2_decode_huffman_len10, suricata::http2::huffman::http2_decode_huffman_len11, suricata::http2::huffman::http2_decode_huffman_len12, suricata::http2::huffman::http2_decode_huffman_len13, suricata::http2::huffman::http2_decode_huffman_len14, suricata::http2::huffman::http2_decode_huffman_len15, suricata::http2::huffman::http2_decode_huffman_len19, suricata::http2::huffman::http2_decode_huffman_len20, suricata::http2::huffman::http2_decode_huffman_len21, suricata::http2::huffman::http2_decode_huffman_len21, suricata::http2::huffman::http2_decode_huffman_len22, suricata::http2::huffman::http2_decode_huffman_len23, suricata::http2::huffman::http2_decode_huffman_len24, suricata::http2::huffman::http2_decode_huffman_len25, suricata::http2::huffman::http2_decode_huffman_len26, suricata::http2::huffman::http2_decode_huffman_len27, nom::branch::alt<(&[u8], usize), u8, nom::error::Error<(&[u8], usize)>, (suricata::http2::huffman::http2_decode_huffman_len28, suricata::http2::huffman::http2_decode_huffman_len30, suricata::http2::huffman::http2_decode_huffman_end)>::{closure#0}) as nom::branch::Alt<(&[u8], usize), u8, nom::error::Error<(&[u8], usize)>>>::choiceLine | Count | Source | 134 | 46.2M | fn choice(&mut self, input: Input) -> IResult<Input, Output, Error> { | 135 | 46.2M | match self.0.parse(input.clone()) { | 136 | 25.4M | Err(Err::Error(e)) => alt_trait_inner!(1, self, input, e, $($id)+), | 137 | 20.8M | res => res, | 138 | | } | 139 | 46.2M | } |
<(suricata::mime::mime_parse_value_delimited, nom::combinator::complete<&[u8], &[u8], nom::error::Error<&[u8]>, nom::bytes::streaming::take_until<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0}>::{closure#0}, nom::combinator::rest<&[u8], nom::error::Error<&[u8]>>) as nom::branch::Alt<&[u8], &[u8], nom::error::Error<&[u8]>>>::choiceLine | Count | Source | 134 | 6.96M | fn choice(&mut self, input: Input) -> IResult<Input, Output, Error> { | 135 | 6.96M | match self.0.parse(input.clone()) { | 136 | 6.41M | Err(Err::Error(e)) => alt_trait_inner!(1, self, input, e, $($id)+), | 137 | 556k | res => res, | 138 | | } | 139 | 6.96M | } |
<(nom::character::streaming::char<&[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::character::streaming::char<&[u8], nom::error::Error<&[u8]>>::{closure#0}) as nom::branch::Alt<&[u8], char, nom::error::Error<&[u8]>>>::choiceLine | Count | Source | 134 | 240k | fn choice(&mut self, input: Input) -> IResult<Input, Output, Error> { | 135 | 240k | match self.0.parse(input.clone()) { | 136 | 239k | Err(Err::Error(e)) => alt_trait_inner!(1, self, input, e, $($id)+), | 137 | 1.34k | res => res, | 138 | | } | 139 | 240k | } |
<(nom::bytes::streaming::tag<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::bytes::streaming::tag<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::bytes::streaming::tag<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0}) as nom::branch::Alt<&[u8], &[u8], nom::error::Error<&[u8]>>>::choiceLine | Count | Source | 134 | 8.55k | fn choice(&mut self, input: Input) -> IResult<Input, Output, Error> { | 135 | 8.55k | match self.0.parse(input.clone()) { | 136 | 4.96k | Err(Err::Error(e)) => alt_trait_inner!(1, self, input, e, $($id)+), | 137 | 3.59k | res => res, | 138 | | } | 139 | 8.55k | } |
<(nom::bytes::streaming::tag<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::bytes::streaming::tag<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0}, suricata::ssh::parser::ssh_parse_line::parser) as nom::branch::Alt<&[u8], &[u8], nom::error::Error<&[u8]>>>::choiceLine | Count | Source | 134 | 17.0k | fn choice(&mut self, input: Input) -> IResult<Input, Output, Error> { | 135 | 17.0k | match self.0.parse(input.clone()) { | 136 | 6.87k | Err(Err::Error(e)) => alt_trait_inner!(1, self, input, e, $($id)+), | 137 | 10.1k | res => res, | 138 | | } | 139 | 17.0k | } |
<(nom::bytes::streaming::tag<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::bytes::streaming::tag<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::bytes::streaming::tag<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::bytes::streaming::tag<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::bytes::streaming::tag<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0}) as nom::branch::Alt<&[u8], &[u8], nom::error::Error<&[u8]>>>::choiceLine | Count | Source | 134 | 6.95k | fn choice(&mut self, input: Input) -> IResult<Input, Output, Error> { | 135 | 6.95k | match self.0.parse(input.clone()) { | 136 | 5.91k | Err(Err::Error(e)) => alt_trait_inner!(1, self, input, e, $($id)+), | 137 | 1.04k | res => res, | 138 | | } | 139 | 6.95k | } |
<(nom::combinator::value<&str, u64, &str, nom::error::Error<&str>, nom::bytes::complete::tag_no_case<&str, &str, nom::error::Error<&str>>::{closure#0}>::{closure#0}, nom::combinator::value<&str, u64, &str, nom::error::Error<&str>, nom::bytes::complete::tag_no_case<&str, &str, nom::error::Error<&str>>::{closure#0}>::{closure#0}, nom::combinator::value<&str, u64, &str, nom::error::Error<&str>, nom::bytes::complete::tag_no_case<&str, &str, nom::error::Error<&str>>::{closure#0}>::{closure#0}) as nom::branch::Alt<&str, u64, nom::error::Error<&str>>>::choiceLine | Count | Source | 134 | 81.9k | fn choice(&mut self, input: Input) -> IResult<Input, Output, Error> { | 135 | 81.9k | match self.0.parse(input.clone()) { | 136 | 81.3k | Err(Err::Error(e)) => alt_trait_inner!(1, self, input, e, $($id)+), | 137 | 658 | res => res, | 138 | | } | 139 | 81.9k | } |
<(nom::combinator::map<&str, &str, suricata::detect::requires::VersionCompareOp, nom::error::Error<&str>, nom::bytes::complete::tag<&str, &str, nom::error::Error<&str>>::{closure#0}, suricata::detect::requires::parse_op::{closure#0}>::{closure#0}, nom::combinator::map<&str, &str, suricata::detect::requires::VersionCompareOp, nom::error::Error<&str>, nom::bytes::complete::tag<&str, &str, nom::error::Error<&str>>::{closure#0}, suricata::detect::requires::parse_op::{closure#1}>::{closure#0}, nom::combinator::map<&str, &str, suricata::detect::requires::VersionCompareOp, nom::error::Error<&str>, nom::bytes::complete::tag<&str, &str, nom::error::Error<&str>>::{closure#0}, suricata::detect::requires::parse_op::{closure#2}>::{closure#0}, nom::combinator::map<&str, &str, suricata::detect::requires::VersionCompareOp, nom::error::Error<&str>, nom::bytes::complete::tag<&str, &str, nom::error::Error<&str>>::{closure#0}, suricata::detect::requires::parse_op::{closure#3}>::{closure#0}) as nom::branch::Alt<&str, suricata::detect::requires::VersionCompareOp, nom::error::Error<&str>>>::choiceLine | Count | Source | 134 | 62.2k | fn choice(&mut self, input: Input) -> IResult<Input, Output, Error> { | 135 | 62.2k | match self.0.parse(input.clone()) { | 136 | 47.7k | Err(Err::Error(e)) => alt_trait_inner!(1, self, input, e, $($id)+), | 137 | 14.5k | res => res, | 138 | | } | 139 | 62.2k | } |
<(nom::combinator::value<&str, suricata::detect::uint::DetectUintMode, &str, nom::error::Error<&str>, nom::bytes::complete::tag<&str, &str, nom::error::Error<&str>>::{closure#0}>::{closure#0}, nom::combinator::value<&str, suricata::detect::uint::DetectUintMode, &str, nom::error::Error<&str>, nom::bytes::complete::tag<&str, &str, nom::error::Error<&str>>::{closure#0}>::{closure#0}, nom::combinator::value<&str, suricata::detect::uint::DetectUintMode, &str, nom::error::Error<&str>, nom::bytes::complete::tag<&str, &str, nom::error::Error<&str>>::{closure#0}>::{closure#0}, nom::combinator::value<&str, suricata::detect::uint::DetectUintMode, &str, nom::error::Error<&str>, nom::bytes::complete::tag<&str, &str, nom::error::Error<&str>>::{closure#0}>::{closure#0}, nom::combinator::value<&str, suricata::detect::uint::DetectUintMode, &str, nom::error::Error<&str>, nom::bytes::complete::tag<&str, &str, nom::error::Error<&str>>::{closure#0}>::{closure#0}, nom::combinator::value<&str, suricata::detect::uint::DetectUintMode, &str, nom::error::Error<&str>, nom::bytes::complete::tag<&str, &str, nom::error::Error<&str>>::{closure#0}>::{closure#0}, nom::combinator::value<&str, suricata::detect::uint::DetectUintMode, &str, nom::error::Error<&str>, nom::bytes::complete::tag<&str, &str, nom::error::Error<&str>>::{closure#0}>::{closure#0}) as nom::branch::Alt<&str, suricata::detect::uint::DetectUintMode, nom::error::Error<&str>>>::choiceLine | Count | Source | 134 | 75.5k | fn choice(&mut self, input: Input) -> IResult<Input, Output, Error> { | 135 | 75.5k | match self.0.parse(input.clone()) { | 136 | 72.8k | Err(Err::Error(e)) => alt_trait_inner!(1, self, input, e, $($id)+), | 137 | 2.73k | res => res, | 138 | | } | 139 | 75.5k | } |
Unexecuted instantiation: <(nom::combinator::map<&str, (&str, core::option::Option<(char, core::option::Option<&str>)>), (), nom::error::Error<&str>, nom::sequence::tuple<&str, (&str, core::option::Option<(char, core::option::Option<&str>)>), nom::error::Error<&str>, (nom::character::complete::digit1<&str, nom::error::Error<&str>>, nom::combinator::opt<&str, (char, core::option::Option<&str>), nom::error::Error<&str>, nom::sequence::pair<&str, char, core::option::Option<&str>, nom::error::Error<&str>, nom::character::complete::char<&str, nom::error::Error<&str>>::{closure#0}, nom::combinator::opt<&str, &str, nom::error::Error<&str>, nom::character::complete::digit1<&str, nom::error::Error<&str>>>::{closure#0}>::{closure#0}>::{closure#0})>::{closure#0}, nom::number::complete::recognize_float<&str, nom::error::Error<&str>>::{closure#0}>::{closure#0}, nom::combinator::map<&str, (char, &str), (), nom::error::Error<&str>, nom::sequence::tuple<&str, (char, &str), nom::error::Error<&str>, (nom::character::complete::char<&str, nom::error::Error<&str>>::{closure#0}, nom::character::complete::digit1<&str, nom::error::Error<&str>>)>::{closure#0}, nom::number::complete::recognize_float<&str, nom::error::Error<&str>>::{closure#1}>::{closure#0}) as nom::branch::Alt<&str, (), nom::error::Error<&str>>>::choice<(nom::combinator::value<&[u8], i64, char, nom::error::Error<&[u8]>, nom::character::complete::char<&[u8], nom::error::Error<&[u8]>>::{closure#0}>::{closure#0}, nom::combinator::map_res<&[u8], &str, i64, nom::error::Error<&[u8]>, core::num::error::ParseIntError, nom::combinator::map_res<&[u8], &[u8], &str, nom::error::Error<&[u8]>, core::str::error::Utf8Error, nom::character::complete::digit1<&[u8], nom::error::Error<&[u8]>>, core::str::converts::from_utf8>::{closure#0}, <i64 as core::str::traits::FromStr>::from_str>::{closure#0}) as nom::branch::Alt<&[u8], i64, nom::error::Error<&[u8]>>>::choiceLine | Count | Source | 134 | 64.1k | fn choice(&mut self, input: Input) -> IResult<Input, Output, Error> { | 135 | 64.1k | match self.0.parse(input.clone()) { | 136 | 63.9k | Err(Err::Error(e)) => alt_trait_inner!(1, self, input, e, $($id)+), | 137 | 245 | res => res, | 138 | | } | 139 | 64.1k | } |
<(nom::combinator::value<&str, bool, &str, nom::error::Error<&str>, nom::bytes::complete::tag<&str, &str, nom::error::Error<&str>>::{closure#0}>::{closure#0}, nom::combinator::value<&str, bool, &str, nom::error::Error<&str>, nom::bytes::complete::tag<&str, &str, nom::error::Error<&str>>::{closure#0}>::{closure#0}) as nom::branch::Alt<&str, bool, nom::error::Error<&str>>>::choiceLine | Count | Source | 134 | 507 | fn choice(&mut self, input: Input) -> IResult<Input, Output, Error> { | 135 | 507 | match self.0.parse(input.clone()) { | 136 | 421 | Err(Err::Error(e)) => alt_trait_inner!(1, self, input, e, $($id)+), | 137 | 86 | res => res, | 138 | | } | 139 | 507 | } |
<(nom::combinator::complete<&[u8], &[u8], nom::error::Error<&[u8]>, nom::bytes::streaming::is_not<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0}>::{closure#0}, nom::combinator::rest<&[u8], nom::error::Error<&[u8]>>) as nom::branch::Alt<&[u8], &[u8], nom::error::Error<&[u8]>>>::choiceLine | Count | Source | 134 | 3.71k | fn choice(&mut self, input: Input) -> IResult<Input, Output, Error> { | 135 | 3.71k | match self.0.parse(input.clone()) { | 136 | 3.06k | Err(Err::Error(e)) => alt_trait_inner!(1, self, input, e, $($id)+), | 137 | 653 | res => res, | 138 | | } | 139 | 3.71k | } |
<(nom::combinator::complete<&str, &str, nom::error::Error<&str>, nom::bytes::streaming::is_not<&str, &str, nom::error::Error<&str>>::{closure#0}>::{closure#0}, nom::combinator::rest<&str, nom::error::Error<&str>>) as nom::branch::Alt<&str, &str, nom::error::Error<&str>>>::choiceLine | Count | Source | 134 | 9.30k | fn choice(&mut self, input: Input) -> IResult<Input, Output, Error> { | 135 | 9.30k | match self.0.parse(input.clone()) { | 136 | 6.26k | Err(Err::Error(e)) => alt_trait_inner!(1, self, input, e, $($id)+), | 137 | 3.04k | res => res, | 138 | | } | 139 | 9.30k | } |
<(suricata::http2::range::http2_parse_content_range_star, suricata::http2::range::http2_parse_content_range_def) as nom::branch::Alt<&[u8], suricata::http2::range::HTTPContentRange, nom::error::Error<&[u8]>>>::choice Line | Count | Source | 134 | 71.1k | fn choice(&mut self, input: Input) -> IResult<Input, Output, Error> { | 135 | 71.1k | match self.0.parse(input.clone()) { | 136 | 71.1k | Err(Err::Error(e)) => alt_trait_inner!(1, self, input, e, $($id)+), | 137 | 1 | res => res, | 138 | | } | 139 | 71.1k | } |
Unexecuted instantiation: <(nom::number::complete::recognize_float_or_exceptions<&str, nom::error::Error<&str>>::{closure#0}, nom::number::complete::recognize_float_or_exceptions<&str, nom::error::Error<&str>>::{closure#1}, nom::number::complete::recognize_float_or_exceptions<&str, nom::error::Error<&str>>::{closure#2}, nom::number::complete::recognize_float_or_exceptions<&str, nom::error::Error<&str>>::{closure#3}) as nom::branch::Alt<&str, &str, nom::error::Error<&str>>>::choice<(nom::character::complete::multispace1<&str, nom::error::Error<&str>>, nom::bytes::complete::tag<&str, &str, nom::error::Error<&str>>::{closure#0}) as nom::branch::Alt<&str, &str, nom::error::Error<&str>>>::choiceLine | Count | Source | 134 | 6.01k | fn choice(&mut self, input: Input) -> IResult<Input, Output, Error> { | 135 | 6.01k | match self.0.parse(input.clone()) { | 136 | 3.55k | Err(Err::Error(e)) => alt_trait_inner!(1, self, input, e, $($id)+), | 137 | 2.46k | res => res, | 138 | | } | 139 | 6.01k | } |
<(nom::bytes::complete::tag<&str, &str, nom::error::Error<&str>>::{closure#0}, nom::bytes::complete::tag<&str, &str, nom::error::Error<&str>>::{closure#0}) as nom::branch::Alt<&str, &str, nom::error::Error<&str>>>::choiceLine | Count | Source | 134 | 92.0k | fn choice(&mut self, input: Input) -> IResult<Input, Output, Error> { | 135 | 92.0k | match self.0.parse(input.clone()) { | 136 | 87.7k | Err(Err::Error(e)) => alt_trait_inner!(1, self, input, e, $($id)+), | 137 | 4.35k | res => res, | 138 | | } | 139 | 92.0k | } |
Unexecuted instantiation: <(nom::character::complete::char<&str, nom::error::Error<&str>>::{closure#0}, nom::character::complete::char<&str, nom::error::Error<&str>>::{closure#0}) as nom::branch::Alt<&str, char, nom::error::Error<&str>>>::choice<(suricata::krb::detect::detect_parse_encryption_weak, suricata::krb::detect::detect_parse_encryption_list) as nom::branch::Alt<&str, suricata::krb::detect::DetectKrb5TicketEncryptionData, nom::error::Error<&str>>>::choice Line | Count | Source | 134 | 5.44k | fn choice(&mut self, input: Input) -> IResult<Input, Output, Error> { | 135 | 5.44k | match self.0.parse(input.clone()) { | 136 | 4.44k | Err(Err::Error(e)) => alt_trait_inner!(1, self, input, e, $($id)+), | 137 | 997 | res => res, | 138 | | } | 139 | 5.44k | } |
<(suricata::detect::uint::detect_parse_uint_start_interval<u8>, suricata::detect::uint::detect_parse_uint_start_equal<u8>, suricata::detect::uint::detect_parse_uint_start_symbol<u8>) as nom::branch::Alt<&str, suricata::detect::uint::DetectUintData<u8>, nom::error::Error<&str>>>::choice Line | Count | Source | 134 | 37.8k | fn choice(&mut self, input: Input) -> IResult<Input, Output, Error> { | 135 | 37.8k | match self.0.parse(input.clone()) { | 136 | 36.6k | Err(Err::Error(e)) => alt_trait_inner!(1, self, input, e, $($id)+), | 137 | 1.21k | res => res, | 138 | | } | 139 | 37.8k | } |
<(suricata::detect::uint::detect_parse_uint_start_interval<u32>, suricata::detect::uint::detect_parse_uint_start_equal<u32>, suricata::detect::uint::detect_parse_uint_start_symbol<u32>) as nom::branch::Alt<&str, suricata::detect::uint::DetectUintData<u32>, nom::error::Error<&str>>>::choice Line | Count | Source | 134 | 37.3k | fn choice(&mut self, input: Input) -> IResult<Input, Output, Error> { | 135 | 37.3k | match self.0.parse(input.clone()) { | 136 | 36.2k | Err(Err::Error(e)) => alt_trait_inner!(1, self, input, e, $($id)+), | 137 | 1.13k | res => res, | 138 | | } | 139 | 37.3k | } |
<(suricata::detect::uint::detect_parse_uint_start_interval<u16>, suricata::detect::uint::detect_parse_uint_start_equal<u16>, suricata::detect::uint::detect_parse_uint_start_symbol<u16>) as nom::branch::Alt<&str, suricata::detect::uint::DetectUintData<u16>, nom::error::Error<&str>>>::choice Line | Count | Source | 134 | 26.9k | fn choice(&mut self, input: Input) -> IResult<Input, Output, Error> { | 135 | 26.9k | match self.0.parse(input.clone()) { | 136 | 25.6k | Err(Err::Error(e)) => alt_trait_inner!(1, self, input, e, $($id)+), | 137 | 1.25k | res => res, | 138 | | } | 139 | 26.9k | } |
<(suricata::detect::uint::detect_parse_uint_start_interval<u64>, suricata::detect::uint::detect_parse_uint_start_equal<u64>, suricata::detect::uint::detect_parse_uint_start_symbol<u64>) as nom::branch::Alt<&str, suricata::detect::uint::DetectUintData<u64>, nom::error::Error<&str>>>::choice Line | Count | Source | 134 | 37.0k | fn choice(&mut self, input: Input) -> IResult<Input, Output, Error> { | 135 | 37.0k | match self.0.parse(input.clone()) { | 136 | 31.0k | Err(Err::Error(e)) => alt_trait_inner!(1, self, input, e, $($id)+), | 137 | 6.01k | res => res, | 138 | | } | 139 | 37.0k | } |
<(suricata::detect::uint::detect_parse_uint_start_interval_inclusive<u32>, suricata::detect::uint::detect_parse_uint_start_equal<u32>, suricata::detect::uint::detect_parse_uint_start_symbol<u32>) as nom::branch::Alt<&str, suricata::detect::uint::DetectUintData<u32>, nom::error::Error<&str>>>::choice Line | Count | Source | 134 | 23.8k | fn choice(&mut self, input: Input) -> IResult<Input, Output, Error> { | 135 | 23.8k | match self.0.parse(input.clone()) { | 136 | 20.5k | Err(Err::Error(e)) => alt_trait_inner!(1, self, input, e, $($id)+), | 137 | 3.34k | res => res, | 138 | | } | 139 | 23.8k | } |
Unexecuted instantiation: <(der_parser::der::parser::parse_der_utf8string, der_parser::der::parser::parse_der_printablestring, der_parser::der::parser::parse_der_universalstring, der_parser::der::parser::parse_der_bmpstring, der_parser::der::parser::parse_der_t61string) as nom::branch::Alt<&[u8], der_parser::ber::ber::BerObject, asn1_rs::error::Error>>::choice <(<asn1_rs::asn1_types::any::Any as asn1_rs::traits::FromDer>::from_der, x509_parser::x509::parse_malformed_string) as nom::branch::Alt<&[u8], asn1_rs::asn1_types::any::Any, asn1_rs::error::Error>>::choice Line | Count | Source | 134 | 25.1k | fn choice(&mut self, input: Input) -> IResult<Input, Output, Error> { | 135 | 25.1k | match self.0.parse(input.clone()) { | 136 | 126 | Err(Err::Error(e)) => alt_trait_inner!(1, self, input, e, $($id)+), | 137 | 25.0k | res => res, | 138 | | } | 139 | 25.1k | } |
<(nom::combinator::complete<&[u8], tls_parser::tls::TlsMessageHandshake, nom::error::Error<&[u8]>, tls_parser::tls::parse_certrequest_full>::{closure#0}, nom::combinator::complete<&[u8], tls_parser::tls::TlsMessageHandshake, nom::error::Error<&[u8]>, tls_parser::tls::parse_certrequest_nosigalg>::{closure#0}) as nom::branch::Alt<&[u8], tls_parser::tls::TlsMessageHandshake, nom::error::Error<&[u8]>>>::choiceLine | Count | Source | 134 | 14.2k | fn choice(&mut self, input: Input) -> IResult<Input, Output, Error> { | 135 | 14.2k | match self.0.parse(input.clone()) { | 136 | 12.4k | Err(Err::Error(e)) => alt_trait_inner!(1, self, input, e, $($id)+), | 137 | 1.81k | res => res, | 138 | | } | 139 | 14.2k | } |
Unexecuted instantiation: <(_, _, _) as nom::branch::Alt<_, _, _>>::choice Unexecuted instantiation: <(_, _, _, _) as nom::branch::Alt<_, _, _>>::choice Unexecuted instantiation: <(_, _, _, _, _) as nom::branch::Alt<_, _, _>>::choice Unexecuted instantiation: <(_, _, _, _, _, _) as nom::branch::Alt<_, _, _>>::choice Unexecuted instantiation: <(_, _, _, _, _, _, _) as nom::branch::Alt<_, _, _>>::choice Unexecuted instantiation: <(_, _, _, _, _, _, _, _) as nom::branch::Alt<_, _, _>>::choice Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _) as nom::branch::Alt<_, _, _>>::choice Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _) as nom::branch::Alt<_, _, _>>::choice Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _) as nom::branch::Alt<_, _, _>>::choice Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _) as nom::branch::Alt<_, _, _>>::choice Unexecuted instantiation: <(_, _) as nom::branch::Alt<_, _, _>>::choice Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _) as nom::branch::Alt<_, _, _>>::choice Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _) as nom::branch::Alt<_, _, _>>::choice Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as nom::branch::Alt<_, _, _>>::choice Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as nom::branch::Alt<_, _, _>>::choice Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as nom::branch::Alt<_, _, _>>::choice Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as nom::branch::Alt<_, _, _>>::choice Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as nom::branch::Alt<_, _, _>>::choice Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as nom::branch::Alt<_, _, _>>::choice Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as nom::branch::Alt<_, _, _>>::choice |
140 | | } |
141 | | ); |
142 | | ); |
143 | | |
144 | | macro_rules! alt_trait_inner( |
145 | | ($it:tt, $self:expr, $input:expr, $err:expr, $head:ident $($id:ident)+) => ( |
146 | | match $self.$it.parse($input.clone()) { |
147 | | Err(Err::Error(e)) => { |
148 | | let err = $err.or(e); |
149 | | succ!($it, alt_trait_inner!($self, $input, err, $($id)+)) |
150 | | } |
151 | | res => res, |
152 | | } |
153 | | ); |
154 | | ($it:tt, $self:expr, $input:expr, $err:expr, $head:ident) => ( |
155 | | Err(Err::Error(Error::append($input, ErrorKind::Alt, $err))) |
156 | | ); |
157 | | ); |
158 | | |
159 | | alt_trait!(A B C D E F G H I J K L M N O P Q R S T U); |
160 | | |
161 | | // Manually implement Alt for (A,), the 1-tuple type |
162 | | impl<Input, Output, Error: ParseError<Input>, A: Parser<Input, Output, Error>> |
163 | | Alt<Input, Output, Error> for (A,) |
164 | | { |
165 | 0 | fn choice(&mut self, input: Input) -> IResult<Input, Output, Error> { |
166 | 0 | self.0.parse(input) |
167 | 0 | } Unexecuted instantiation: <(_,) as nom::branch::Alt<_, _, _>>::choice Unexecuted instantiation: <(_,) as nom::branch::Alt<_, _, _>>::choice |
168 | | } |
169 | | |
170 | | macro_rules! permutation_trait( |
171 | | ( |
172 | | $name1:ident $ty1:ident $item1:ident |
173 | | $name2:ident $ty2:ident $item2:ident |
174 | | $($name3:ident $ty3:ident $item3:ident)* |
175 | | ) => ( |
176 | | permutation_trait!(__impl $name1 $ty1 $item1, $name2 $ty2 $item2; $($name3 $ty3 $item3)*); |
177 | | ); |
178 | | ( |
179 | | __impl $($name:ident $ty:ident $item:ident),+; |
180 | | $name1:ident $ty1:ident $item1:ident $($name2:ident $ty2:ident $item2:ident)* |
181 | | ) => ( |
182 | | permutation_trait_impl!($($name $ty $item),+); |
183 | | permutation_trait!(__impl $($name $ty $item),+ , $name1 $ty1 $item1; $($name2 $ty2 $item2)*); |
184 | | ); |
185 | | (__impl $($name:ident $ty:ident $item:ident),+;) => ( |
186 | | permutation_trait_impl!($($name $ty $item),+); |
187 | | ); |
188 | | ); |
189 | | |
190 | | macro_rules! permutation_trait_impl( |
191 | | ($($name:ident $ty:ident $item:ident),+) => ( |
192 | | impl< |
193 | | Input: Clone, $($ty),+ , Error: ParseError<Input>, |
194 | | $($name: Parser<Input, $ty, Error>),+ |
195 | | > Permutation<Input, ( $($ty),+ ), Error> for ( $($name),+ ) { |
196 | | |
197 | 0 | fn permutation(&mut self, mut input: Input) -> IResult<Input, ( $($ty),+ ), Error> { |
198 | 0 | let mut res = ($(Option::<$ty>::None),+); |
199 | | |
200 | | loop { |
201 | 0 | let mut err: Option<Error> = None; |
202 | 0 | permutation_trait_inner!(0, self, input, res, err, $($name)+); |
203 | | |
204 | | // If we reach here, every iterator has either been applied before, |
205 | | // or errored on the remaining input |
206 | 0 | if let Some(err) = err { |
207 | | // There are remaining parsers, and all errored on the remaining input |
208 | 0 | return Err(Err::Error(Error::append(input, ErrorKind::Permutation, err))); |
209 | 0 | } |
210 | | |
211 | | // All parsers were applied |
212 | 0 | match res { |
213 | 0 | ($(Some($item)),+) => return Ok((input, ($($item),+))), |
214 | 0 | _ => unreachable!(), |
215 | | } |
216 | | } |
217 | 0 | } Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as nom::branch::Permutation<_, (_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _), _>>::permutation Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as nom::branch::Permutation<_, (_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _), _>>::permutation Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as nom::branch::Permutation<_, (_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _), _>>::permutation Unexecuted instantiation: <(_, _) as nom::branch::Permutation<_, (_, _), _>>::permutation Unexecuted instantiation: <(_, _, _) as nom::branch::Permutation<_, (_, _, _), _>>::permutation Unexecuted instantiation: <(_, _, _, _) as nom::branch::Permutation<_, (_, _, _, _), _>>::permutation Unexecuted instantiation: <(_, _, _, _, _) as nom::branch::Permutation<_, (_, _, _, _, _), _>>::permutation Unexecuted instantiation: <(_, _, _, _, _, _) as nom::branch::Permutation<_, (_, _, _, _, _, _), _>>::permutation Unexecuted instantiation: <(_, _, _, _, _, _, _) as nom::branch::Permutation<_, (_, _, _, _, _, _, _), _>>::permutation Unexecuted instantiation: <(_, _, _, _, _, _, _, _) as nom::branch::Permutation<_, (_, _, _, _, _, _, _, _), _>>::permutation Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _) as nom::branch::Permutation<_, (_, _, _, _, _, _, _, _, _), _>>::permutation Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _) as nom::branch::Permutation<_, (_, _, _, _, _, _, _, _, _, _), _>>::permutation Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _) as nom::branch::Permutation<_, (_, _, _, _, _, _, _, _, _, _, _), _>>::permutation Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _) as nom::branch::Permutation<_, (_, _, _, _, _, _, _, _, _, _, _, _), _>>::permutation Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _) as nom::branch::Permutation<_, (_, _, _, _, _, _, _, _, _, _, _, _, _), _>>::permutation Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _) as nom::branch::Permutation<_, (_, _, _, _, _, _, _, _, _, _, _, _, _, _), _>>::permutation Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as nom::branch::Permutation<_, (_, _, _, _, _, _, _, _, _, _, _, _, _, _, _), _>>::permutation Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as nom::branch::Permutation<_, (_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _), _>>::permutation Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as nom::branch::Permutation<_, (_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _), _>>::permutation Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as nom::branch::Permutation<_, (_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _), _>>::permutation Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as nom::branch::Permutation<_, (_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _), _>>::permutation Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as nom::branch::Permutation<_, (_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _), _>>::permutation Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as nom::branch::Permutation<_, (_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _), _>>::permutation Unexecuted instantiation: <(_, _) as nom::branch::Permutation<_, (_, _), _>>::permutation Unexecuted instantiation: <(_, _, _) as nom::branch::Permutation<_, (_, _, _), _>>::permutation Unexecuted instantiation: <(_, _, _, _) as nom::branch::Permutation<_, (_, _, _, _), _>>::permutation Unexecuted instantiation: <(_, _, _, _, _) as nom::branch::Permutation<_, (_, _, _, _, _), _>>::permutation Unexecuted instantiation: <(_, _, _, _, _, _) as nom::branch::Permutation<_, (_, _, _, _, _, _), _>>::permutation Unexecuted instantiation: <(_, _, _, _, _, _, _) as nom::branch::Permutation<_, (_, _, _, _, _, _, _), _>>::permutation Unexecuted instantiation: <(_, _, _, _, _, _, _, _) as nom::branch::Permutation<_, (_, _, _, _, _, _, _, _), _>>::permutation Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _) as nom::branch::Permutation<_, (_, _, _, _, _, _, _, _, _), _>>::permutation Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _) as nom::branch::Permutation<_, (_, _, _, _, _, _, _, _, _, _), _>>::permutation Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _) as nom::branch::Permutation<_, (_, _, _, _, _, _, _, _, _, _, _), _>>::permutation Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _) as nom::branch::Permutation<_, (_, _, _, _, _, _, _, _, _, _, _, _), _>>::permutation Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _) as nom::branch::Permutation<_, (_, _, _, _, _, _, _, _, _, _, _, _, _), _>>::permutation Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _) as nom::branch::Permutation<_, (_, _, _, _, _, _, _, _, _, _, _, _, _, _), _>>::permutation Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as nom::branch::Permutation<_, (_, _, _, _, _, _, _, _, _, _, _, _, _, _, _), _>>::permutation Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as nom::branch::Permutation<_, (_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _), _>>::permutation Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as nom::branch::Permutation<_, (_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _), _>>::permutation Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as nom::branch::Permutation<_, (_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _), _>>::permutation |
218 | | } |
219 | | ); |
220 | | ); |
221 | | |
222 | | macro_rules! permutation_trait_inner( |
223 | | ($it:tt, $self:expr, $input:ident, $res:expr, $err:expr, $head:ident $($id:ident)*) => ( |
224 | | if $res.$it.is_none() { |
225 | | match $self.$it.parse($input.clone()) { |
226 | | Ok((i, o)) => { |
227 | | $input = i; |
228 | | $res.$it = Some(o); |
229 | | continue; |
230 | | } |
231 | | Err(Err::Error(e)) => { |
232 | | $err = Some(match $err { |
233 | | Some(err) => err.or(e), |
234 | | None => e, |
235 | | }); |
236 | | } |
237 | | Err(e) => return Err(e), |
238 | | }; |
239 | | } |
240 | | succ!($it, permutation_trait_inner!($self, $input, $res, $err, $($id)*)); |
241 | | ); |
242 | | ($it:tt, $self:expr, $input:ident, $res:expr, $err:expr,) => (); |
243 | | ); |
244 | | |
245 | | permutation_trait!( |
246 | | FnA A a |
247 | | FnB B b |
248 | | FnC C c |
249 | | FnD D d |
250 | | FnE E e |
251 | | FnF F f |
252 | | FnG G g |
253 | | FnH H h |
254 | | FnI I i |
255 | | FnJ J j |
256 | | FnK K k |
257 | | FnL L l |
258 | | FnM M m |
259 | | FnN N n |
260 | | FnO O o |
261 | | FnP P p |
262 | | FnQ Q q |
263 | | FnR R r |
264 | | FnS S s |
265 | | FnT T t |
266 | | FnU U u |
267 | | ); |