/// Determine the earliest occurring token from a set. Useful to determine which
/// of two or more tokens appears first in a stream.
Determine the earliest occurring token from a set. Useful to determine which
of two or more tokens appears first in a stream.
Determine the earliest occurring token from a set . Useful to determine which of two or more tokens appears first in a stream .
pub fn earliest<P: Parser>(p: &mut P, tokens: &[Token]) -> Spanned<Token> {
    for i in 0.. {
        let pk = p.peek(i);
        if pk.value == Eof {
            return pk;
        }
        for t in tokens {
            if *t == pk.value {
                return pk;
            }
        }
    }
    unreachable!();
}
pub fn earliest < P : Parser > ( p : & mut P , tokens : & [ Token ] ) -> Spanned < Token > { for i in 0 .. { let pk = p . peek ( i ) ; if pk . value == Eof { return pk ; } for t in tokens { if * t == pk . value { return pk ; } } } unreachable ! ( ) ; }
Determine the earliest occurring token from a set.
Determine the earliest occurring token from a set .
p
&mut P
tokens
&[Token]