pub trait StructuralFrontend {
// Required methods
fn language(&self) -> Language;
fn frontend_version(&self) -> &'static str;
fn parse(&self, source: &str) -> SyntaxIrFile;
}Expand description
A Structural-mode parser for one language.
Like the Fast Frontend, a structural
frontend never executes, expands or resolves anything in the target code:
it parses text and maps the tree. Malformed input degrades to
Shape::Error nodes plus SyntaxIrFile::error_ranges. A frontend
that reaches its depth budget records the remaining source region in the
same way instead of continuing recursive descent.
Required Methods§
Sourcefn frontend_version(&self) -> &'static str
fn frontend_version(&self) -> &'static str
The frontend’s version tag, used as a fingerprint input.
Sourcefn parse(&self, source: &str) -> SyntaxIrFile
fn parse(&self, source: &str) -> SyntaxIrFile
Parse source into a Syntax IR file.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".