pub fn seq<'a, 'b: 'a, I>(tag: &'b [I]) -> Parser<'a, I, &'a [I]>
where
	I: PartialEq + Debug,
{
	Parser::new(move |input: &'a [I], start: usize| {
		let mut index = 0;
		loop {
			let pos = start + index;
			if index == tag.len() {
				return Ok((tag, pos));
			}
			if let Some(s) = input.get(pos) {
				if tag[index] != *s {
					return Err(Error::Mismatch {
						message: format!("seq {:?} expect: {:?}, found: {:?}", tag, tag[index], s),
						position: pos,
					});
				}
			} else {
				return Err(Error::Incomplete);
			}
			index += 1;
		}
	})
}
/// Success when sequence of symbols matches current input.
Success when sequence of symbols matches current input.
Success when sequence of symbols matches current input .
pub fn seq<'a, 'b: 'a, I>(tag: &'b [I]) -> Parser<'a, I, &'a [I]>
where
	I: PartialEq + Debug,
{
	Parser::new(move |input: &'a [I], start: usize| {
		let mut index = 0;
		loop {
			let pos = start + index;
			if index == tag.len() {
				return Ok((tag, pos));
			}
			if let Some(s) = input.get(pos) {
				if tag[index] != *s {
					return Err(Error::Mismatch {
						message: format!("seq {:?} expect: {:?}, found: {:?}", tag, tag[index], s),
						position: pos,
					});
				}
			} else {
				return Err(Error::Incomplete);
			}
			index += 1;
		}
	})
}
pub fn seq < ' a , ' b : ' a , I > ( tag : & ' b [ I ] ) -> Parser < ' a , I , & ' a [ I ] > where I : PartialEq + Debug , { Parser :: new ( move | input : & ' a [ I ] , start : usize | { let mut index = 0 ; loop { let pos = start + index ; if index == tag . len ( ) { return Ok ( ( tag , pos ) ) ; } if let Some ( s ) = input . get ( pos ) { if tag [ index ] != * s { return Err ( Error :: Mismatch { message : format ! ( " " tag tag [ index ] s ) , position : pos , } ) ; } } else { return Err ( Error :: Incomplete ) ; } index += 1 ; } } ) }
Success when sequence of symbols matches current input.
Success when sequence of symbols matches current input .
tag
&'b [I]