pub trait LexedSource<'a>: Iterator<Item = LexerResult<'a>> + Clone {
// Provided methods
fn report_errors(&self) -> impl Iterator<Item = Report> { ... }
fn dump(&self, file_path: &Path) -> Result<()> { ... }
fn process(self) -> IntoIter<LexerResult<'a>> { ... }
fn tokens(self) -> impl Iterator<Item = SpannedToken<'a>> { ... }
}Expand description
An iterator over syntactical tokens for a SystemVerilog source
Provided Methods§
Sourcefn report_errors(&self) -> impl Iterator<Item = Report>
fn report_errors(&self) -> impl Iterator<Item = Report>
Generate error reports for any errors encountered in lexing
Sourcefn dump(&self, file_path: &Path) -> Result<()>
fn dump(&self, file_path: &Path) -> Result<()>
Dump a representation of the lexed source to a file, for debugging
Sourcefn process(self) -> IntoIter<LexerResult<'a>>
fn process(self) -> IntoIter<LexerResult<'a>>
Process the lexing of the source, storing the result
While this does incur memory overhead, it avoid processing the source multiple times if cloned.
Sourcefn tokens(self) -> impl Iterator<Item = SpannedToken<'a>>
fn tokens(self) -> impl Iterator<Item = SpannedToken<'a>>
Convert lexer results into tokens, turning errors into Token::Error
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".