pub trait Parser<'t>: Display {
// Required methods
fn parse(&mut self, source: &str) -> Result<(), Box<dyn Error>>;
fn insert_parse(&mut self, source: &str) -> Result<(), Box<dyn Error>>;
fn try_parse(
source: &str,
options: Scdlang<'t>,
) -> Result<Self, Box<dyn Error>>
where Self: Sized;
fn configure(&mut self) -> &mut dyn Builder<'t>;
// Provided methods
fn flush_cache<'e>(&'t self) -> Result<(), Box<dyn Error + 'e>> { ... }
fn clean_cache<'e>(&'t self) -> Result<(), Box<dyn Error + 'e>> { ... }
}
Expand description
A Trait which external parser must implement.
This trait was mean to be used outside the core. For example, to build a transpiler.
Required Methods§
Sourcefn parse(&mut self, source: &str) -> Result<(), Box<dyn Error>>
fn parse(&mut self, source: &str) -> Result<(), Box<dyn Error>>
Parse source
then replace the results.
Sourcefn insert_parse(&mut self, source: &str) -> Result<(), Box<dyn Error>>
fn insert_parse(&mut self, source: &str) -> Result<(), Box<dyn Error>>
Parse source
then insert/append the results.