pub struct PythonParser { /* private fields */ }Expand description
Python language parser implementing the CodeParser trait
Implementations§
Source§impl PythonParser
impl PythonParser
Sourcepub fn with_config(config: ParserConfig) -> Self
pub fn with_config(config: ParserConfig) -> Self
Create a new Python parser with custom configuration
Trait Implementations§
Source§impl CodeParser for PythonParser
impl CodeParser for PythonParser
Source§fn language(&self) -> &str
fn language(&self) -> &str
Returns the language identifier (lowercase, e.g., “python”, “rust”)
Source§fn file_extensions(&self) -> &[&str]
fn file_extensions(&self) -> &[&str]
Returns supported file extensions (e.g., [“.py”, “.pyw”])
Source§fn parse_file(
&self,
path: &Path,
graph: &mut CodeGraph,
) -> Result<FileInfo, ParserError>
fn parse_file( &self, path: &Path, graph: &mut CodeGraph, ) -> Result<FileInfo, ParserError>
Parse a single file and insert entities/relationships into the graph Read more
Source§fn parse_source(
&self,
source: &str,
file_path: &Path,
graph: &mut CodeGraph,
) -> Result<FileInfo, ParserError>
fn parse_source( &self, source: &str, file_path: &Path, graph: &mut CodeGraph, ) -> Result<FileInfo, ParserError>
Parse source code string and insert into graph Read more
Source§fn config(&self) -> &ParserConfig
fn config(&self) -> &ParserConfig
Get parser configuration
Source§fn metrics(&self) -> ParserMetrics
fn metrics(&self) -> ParserMetrics
Get accumulated metrics Read more
Source§fn reset_metrics(&mut self)
fn reset_metrics(&mut self)
Reset metrics Read more
Source§fn parse_files(
&self,
paths: &[PathBuf],
graph: &mut CodeGraph,
) -> Result<ProjectInfo, ParserError>
fn parse_files( &self, paths: &[PathBuf], graph: &mut CodeGraph, ) -> Result<ProjectInfo, ParserError>
Parse multiple files (can be overridden for parallel parsing) Read more
Source§fn parse_directory(
&self,
dir: &Path,
graph: &mut CodeGraph,
) -> Result<ProjectInfo, ParserError>
fn parse_directory( &self, dir: &Path, graph: &mut CodeGraph, ) -> Result<ProjectInfo, ParserError>
Parse a directory recursively Read more
Source§fn discover_files(&self, dir: &Path) -> Result<Vec<PathBuf>, ParserError>
fn discover_files(&self, dir: &Path) -> Result<Vec<PathBuf>, ParserError>
Discover parseable files in a directory Read more
Auto Trait Implementations§
impl !Freeze for PythonParser
impl RefUnwindSafe for PythonParser
impl Send for PythonParser
impl Sync for PythonParser
impl Unpin for PythonParser
impl UnwindSafe for PythonParser
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more