[−][src]Trait moore_vhdl_syntax::parser::token_stream::TokenStream
A generalized stream of tokens that accepts emission of diagnostics and tracking of the severity of issues encountered.
Required methods
fn peek(&mut self, offset: usize) -> Spanned<T>
Look ahead at a token in the stream.
fn bump(&mut self)
Consume the current token.
fn consumed(&self) -> usize
Get the number of tokens consumed. Excludes tokens skipped with skip
.
fn last_span(&self) -> Span
Get the span of the last token consumed token (bumped or skipped).
fn emit(&mut self, diag: DiagBuilder2)
Emit a diagnostic.
fn severity(&self) -> Severity
Get the severity of the worst diagnostic emitted so far.
Provided methods
fn skip(&mut self)
Skip the current token. Usually the same as bump
, but may be used to
keep skipped tokens out of the consumed tokens count by some parsers.
fn last_loc(&self) -> Location
Get the tail location of the last consumed token (bumped or skipped).
fn is_fatal(&self) -> bool
Check whether a fatal diagnostic has been emitted.
fn is_error(&self) -> bool
Check whether an error diagnostic has been emitted.
Implementors
impl<T> TokenStream<Token> for BasicParser<T> where
T: Grinder<Item = Option<u8>, Error = DiagBuilder2>,
[src]
impl<T> TokenStream<Token> for BasicParser<T> where
T: Grinder<Item = Option<u8>, Error = DiagBuilder2>,
fn peek(&mut self, offset: usize) -> Spanned<Token> | [src] |
fn bump(&mut self) | [src] |
fn consumed(&self) -> usize | [src] |
fn last_span(&self) -> Span | [src] |
fn emit(&mut self, diag: DiagBuilder2) | [src] |
fn severity(&self) -> Severity | [src] |
fn skip(&mut self) | [src] |
fn last_loc(&self) -> Location | [src] |
fn is_fatal(&self) -> bool | [src] |
fn is_error(&self) -> bool | [src] |