pub trait LanguageParser {
// Required method
fn parse(
&self,
source: &str,
path: &Path,
) -> Result<ParsedFile, AstDocError>;
}Expand description
Trait for language-specific parsers.
Required Methods§
Sourcefn parse(&self, source: &str, path: &Path) -> Result<ParsedFile, AstDocError>
fn parse(&self, source: &str, path: &Path) -> Result<ParsedFile, AstDocError>
Parse the source code and produce a ParsedFile.
§Errors
Returns an error if tree-sitter parsing fails.