Skip to main content

StructuralFrontend

Trait StructuralFrontend 

Source
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§

Source

fn language(&self) -> Language

The language this frontend parses.

Source

fn frontend_version(&self) -> &'static str

The frontend’s version tag, used as a fingerprint input.

Source

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".

Implementors§