[−][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
pub fn peek(&mut self, offset: usize) -> Spanned<T>
[src]
Look ahead at a token in the stream.
pub fn bump(&mut self)
[src]
Consume the current token.
pub fn consumed(&self) -> usize
[src]
Get the number of tokens consumed. Excludes tokens skipped with skip
.
pub fn last_span(&self) -> Span
[src]
Get the span of the last token consumed token (bumped or skipped).
pub fn emit(&mut self, diag: DiagBuilder2)
[src]
Emit a diagnostic.
pub fn severity(&self) -> Severity
[src]
Get the severity of the worst diagnostic emitted so far.
Provided methods
pub fn skip(&mut self)
[src]
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.
pub fn last_loc(&self) -> Location
[src]
Get the tail location of the last consumed token (bumped or skipped).
pub fn is_fatal(&self) -> bool
[src]
Check whether a fatal diagnostic has been emitted.
pub fn is_error(&self) -> bool
[src]
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]
T: Grinder<Item = Option<u8>, Error = DiagBuilder2>,