pub struct PythonParser { /* private fields */ }Implementations§
Source§impl PythonParser
impl PythonParser
pub fn new() -> Self
Sourcepub fn parse_file(&mut self, path: &Path) -> Result<PythonModule>
pub fn parse_file(&mut self, path: &Path) -> Result<PythonModule>
Parse a Python source file.
§Errors
Returns PlisskenError::FileRead if the file cannot be read,
PlisskenError::Parse if the Python syntax is invalid.
Trait Implementations§
Source§impl Default for PythonParser
impl Default for PythonParser
Source§impl Parser for PythonParser
impl Parser for PythonParser
Source§fn parse_file(&mut self, path: &Path) -> Result<Module>
fn parse_file(&mut self, path: &Path) -> Result<Module>
Parse a source file and return its module representation. Read more
Source§fn parse_str(&mut self, content: &str, virtual_path: &Path) -> Result<Module>
fn parse_str(&mut self, content: &str, virtual_path: &Path) -> Result<Module>
Parse source code from a string. Read more
Source§fn language(&self) -> ParserLanguage
fn language(&self) -> ParserLanguage
The language this parser handles.
Source§fn extensions(&self) -> &'static [&'static str]
fn extensions(&self) -> &'static [&'static str]
File extensions this parser handles.
Source§fn can_parse_extension(&self, ext: &str) -> bool
fn can_parse_extension(&self, ext: &str) -> bool
Check if this parser can handle the given file extension.
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§
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