From 9835e2ae736235810b4ea1c162ca5e65c547e770 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 18 May 2024 04:49:50 +0200 Subject: Merging upstream version 1.71.1+dfsg1. Signed-off-by: Daniel Baumann --- vendor/nom/src/sequence/mod.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'vendor/nom/src/sequence/mod.rs') diff --git a/vendor/nom/src/sequence/mod.rs b/vendor/nom/src/sequence/mod.rs index 100c63f90..735ab45cc 100644 --- a/vendor/nom/src/sequence/mod.rs +++ b/vendor/nom/src/sequence/mod.rs @@ -252,8 +252,17 @@ macro_rules! tuple_trait_inner( tuple_trait!(FnA A, FnB B, FnC C, FnD D, FnE E, FnF F, FnG G, FnH H, FnI I, FnJ J, FnK K, FnL L, FnM M, FnN N, FnO O, FnP P, FnQ Q, FnR R, FnS S, FnT T, FnU U); +// Special case: implement `Tuple` for `()`, the unit type. +// This can come up in macros which accept a variable number of arguments. +// Literally, `()` is an empty tuple, so it should simply parse nothing. +impl> Tuple for () { + fn parse(&mut self, input: I) -> IResult { + Ok((input, ())) + } +} + ///Applies a tuple of parsers one by one and returns their results as a tuple. -/// +///There is a maximum of 21 parsers /// ```rust /// # use nom::{Err, error::ErrorKind}; /// use nom::sequence::tuple; -- cgit v1.2.3