Skip to main content

Module lookahead

Module lookahead 

Source
Expand description

Support for “peeking” into the token stream to decide how to parse.

Re-exports§

use std::fmt; 🔒
use rustc_span::Symbol; 🔒
use rustc_span::edition::Edition; 🔒
use crate::ParseCtxt; 🔒
use crate::ParseError; 🔒
use crate::ParseResult; 🔒
use crate::surface::BinOp; 🔒
use crate::symbols; 🔒
use crate::token::IdentKind; 🔒
use crate::token::Token; 🔒
use crate::token::TokenKind; 🔒

Structs§

AnyLit 🔒
A struct that can be used to match any literal
AnyOf 🔒
A rule that matches if any of the rules in a list matches
LAngle 🔒
This is the same as RAngle but for opening angle brackets.
Lookahead1 🔒
Support for checking the next token in a stream to decide how to parse.
NonReserved 🔒
A struct that can be used to match a non-reserved identifier
RAngle 🔒
There are some lexing ambiguities with >> because it can represet both a right shift or two closing angle brackets (e.g., Vec<Option<i32>>). We solve the ambiguity by giving > a special token if it’s immediately followed by another >, i.e., >> is tokenized as TokenKind::GtFollowedByGt followed by TokenKind::Gt.

Enums§

Expected
See PeekExpected

Traits§

Peek 🔒
A trait for testing whether a token matches a rule.
PeekExpected 🔒
A subtrait of Peek for rules that have an expected description.