Function chomp::parsers::not_token
[−]
[src]
pub fn not_token<I: Copy + PartialEq>(i: Input<I>, t: I) -> SimpleResult<I, I>
Matches a single token as long as it is not equal to t
, returning the match on success.
If the buffer length is 0 this parser is considered incomplete.
use chomp::{Input, not_token}; let p1 = Input::new(b"abc"); assert_eq!(not_token(p1, b'b').unwrap(), b'a'); let p2 = Input::new(b"abc"); assert_eq!(not_token(p2, b'b').unwrap(), b'a');