pub struct PythonParser { /* private fields */ }Expand description
A Python-specific tree-sitter parser.
Wraps tree-sitter::Parser for Python. Caller constructs once, reuses across files.
Implementations§
Source§impl PythonParser
impl PythonParser
Sourcepub fn new() -> Result<Self, PythonParserError>
pub fn new() -> Result<Self, PythonParserError>
Construct a new PythonParser.
Sourcepub fn parse_file(
&mut self,
path: &Path,
source: &str,
) -> Result<PythonParseResult, PythonParserError>
pub fn parse_file( &mut self, path: &Path, source: &str, ) -> Result<PythonParseResult, PythonParserError>
Parse a Python source file into PythonParseResult.
All emitted CodeNode records use Python-specific kinds and include
position metadata (start_line, end_line, start_col, end_col,
file_path, byte_offset).
Auto Trait Implementations§
impl Freeze for PythonParser
impl RefUnwindSafe for PythonParser
impl Send for PythonParser
impl Sync for PythonParser
impl Unpin for PythonParser
impl UnsafeUnpin for PythonParser
impl UnwindSafe for PythonParser
Blanket Implementations§
impl<T> Allocation for T
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