pub enum Lookahead {
Eof,
Token(Token),
}
Expand description
Either a Token
, or EOF
.
Variants§
Eof
End-of-file.
Sometimes, a rule will have this as lookahead: this means that this rule may appear at the very end of the text.
For example, in Rust code:
- A
let
binding may not appear at the end of a file, and thus can never be followed byEof
. - A function may appear at the end of a file, and thus can be followed by
Eof
.
Token(Token)
A normal token: see Token
.
Trait Implementations§
source§impl Ord for Lookahead
impl Ord for Lookahead
source§impl PartialEq<Lookahead> for Lookahead
impl PartialEq<Lookahead> for Lookahead
source§impl PartialOrd<Lookahead> for Lookahead
impl PartialOrd<Lookahead> for Lookahead
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for Lookahead
impl Eq for Lookahead
impl StructuralEq for Lookahead
Auto Trait Implementations§
impl RefUnwindSafe for Lookahead
impl Send for Lookahead
impl Sync for Lookahead
impl Unpin for Lookahead
impl UnwindSafe for Lookahead
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more