Skip to main content

Reader

Trait Reader 

Source
pub trait Reader: Send + Sync {
    // Required methods
    fn language(&self) -> &'static str;
    fn extensions(&self) -> &'static [&'static str];
    fn read(&self, source: &str) -> Result<Program, ReadError>;
}
Expand description

A reader parses source code into the surface-syntax IR.

Required Methods§

Source

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

Language identifier (e.g., “typescript”, “lua”).

Source

fn extensions(&self) -> &'static [&'static str]

File extensions this reader handles (e.g., &[“ts”, “tsx”]).

Source

fn read(&self, source: &str) -> Result<Program, ReadError>

Parse source code into the IR.

Implementors§