pub trait Parser: ParserConfig {
type Error: Error;
fn parse<'a>(&self, input: &'a str) -> Result<Document<'a>, Self::Error>;
fn parse_name<'a>(
&self,
input: &'a str
) -> Result<(String, Vec<&'a str>), ParseError> { ... }
fn parse_line<'a>(
&self,
line_number: usize,
input: &'a str
) -> Result<Line<'a>, ParseError> { ... }
}
Expand description
A Parser
determines which lines are code and which are text, and may use its Config
to
actually handle reading the lines of code
Required Associated Types
Required Methods
Provided Methods
sourcefn parse_name<'a>(
&self,
input: &'a str
) -> Result<(String, Vec<&'a str>), ParseError>
fn parse_name<'a>(
&self,
input: &'a str
) -> Result<(String, Vec<&'a str>), ParseError>
Parses a macro name, returning the name and the extracted variables
sourcefn parse_line<'a>(
&self,
line_number: usize,
input: &'a str
) -> Result<Line<'a>, ParseError>
fn parse_line<'a>(
&self,
line_number: usize,
input: &'a str
) -> Result<Line<'a>, ParseError>
Parses a line as code, returning the parsed Line
object