pub fn tag<'a, 'b: 'a>(tag: &'b str) -> Parser<'a, char, &'a str> {
	Parser::new(move |input: &'a [char], start: usize| {
		let mut pos = start;
		for c in tag.chars() {
			if let Some(&s) = input.get(pos) {
				if c != s {
					return Err(Error::Mismatch {
						message: format!("tag {:?} expect: {:?}, found: {}", tag, c, s),
						position: pos,
					});
				}
			} else {
				return Err(Error::Incomplete);
			}
			pos += 1;
		}
		Ok((tag, pos))
	})
}
/// Success when tag matches current input.
Success when tag matches current input.
Success when tag matches current input .
pub fn tag<'a, 'b: 'a>(tag: &'b str) -> Parser<'a, char, &'a str> {
	Parser::new(move |input: &'a [char], start: usize| {
		let mut pos = start;
		for c in tag.chars() {
			if let Some(&s) = input.get(pos) {
				if c != s {
					return Err(Error::Mismatch {
						message: format!("tag {:?} expect: {:?}, found: {}", tag, c, s),
						position: pos,
					});
				}
			} else {
				return Err(Error::Incomplete);
			}
			pos += 1;
		}
		Ok((tag, pos))
	})
}
pub fn tag < ' a , ' b : ' a > ( tag : & ' b str ) -> Parser < ' a , char , & ' a str > { Parser :: new ( move | input : & ' a [ char ] , start : usize | { let mut pos = start ; for c in tag . chars ( ) { if let Some ( & s ) = input . get ( pos ) { if c != s { return Err ( Error :: Mismatch { message : format ! ( " " tag c s ) , position : pos , } ) ; } } else { return Err ( Error :: Incomplete ) ; } pos += 1 ; } Ok ( ( tag , pos ) ) } ) }
Success when tag matches current input.
Success when tag matches current input .
tag
&'b str