pub fn sym<'a, I>(t: I) -> Parser<'a, I, I>
where
	I: Clone + PartialEq + Display,
{
	Parser::new(move |input: &'a [I], start: usize| {
		if let Some(s) = input.get(start) {
			if t == *s {
				Ok((s.clone(), start + 1))
			} else {
				Err(Error::Mismatch {
					message: format!("expect: {}, found: {}", t, s),
					position: start,
				})
			}
		} else {
			Err(Error::Incomplete)
		}
	})
}
/// Success when current input symbol equals `t`.
Success when current input symbol equals `t`.
Success when current input symbol equals ` t ` .
pub fn sym<'a, I>(t: I) -> Parser<'a, I, I>
where
	I: Clone + PartialEq + Display,
{
	Parser::new(move |input: &'a [I], start: usize| {
		if let Some(s) = input.get(start) {
			if t == *s {
				Ok((s.clone(), start + 1))
			} else {
				Err(Error::Mismatch {
					message: format!("expect: {}, found: {}", t, s),
					position: start,
				})
			}
		} else {
			Err(Error::Incomplete)
		}
	})
}
pub fn sym < ' a , I > ( t : I ) -> Parser < ' a , I , I > where I : Clone + PartialEq + Display , { Parser :: new ( move | input : & ' a [ I ] , start : usize | { if let Some ( s ) = input . get ( start ) { if t == * s { Ok ( ( s . clone ( ) , start + 1 ) ) } else { Err ( Error :: Mismatch { message : format ! ( " " t s ) , position : start , } ) } } else { Err ( Error :: Incomplete ) } } ) }
Success when current input symbol equals `t`.
Success when current input symbol equals ` t ` .
t
I