Enum syntax::parse::parser::LastToken [−][src]
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
This is used in TokenCursorFrame
above to track tokens that are consumed
by the parser, and then that's transitively used to record the tokens that
each parse AST item is created with.
Right now this has two states, either collecting tokens or not collecting
tokens. If we're collecting tokens we just save everything off into a local
Vec
. This should eventually though likely save tokens from the original
token stream and just use slicing of token streams to avoid creation of a
whole new vector.
The second state is where we're passively not recording tokens, but the last token is still tracked for when we want to start recording tokens. This "last token" means that when we start recording tokens we'll want to ensure that this, the first token, is included in the output.
You can find some more example usage of this in the collect_tokens
method
on the parser.
Variants
Collecting(Vec<TokenTree>)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Was(Option<TokenTree>)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?