pub struct AstParser { /* private fields */ }Expand description
Multi-language AST parser
Implementations§
Source§impl AstParser
impl AstParser
Sourcepub fn new() -> CadiResult<Self>
pub fn new() -> CadiResult<Self>
Create a new AST parser with all supported languages
Sourcepub fn parse(&mut self, language: &str, source: &str) -> CadiResult<ParsedAst>
pub fn parse(&mut self, language: &str, source: &str) -> CadiResult<ParsedAst>
Parse source code into an AST
Sourcepub fn supports_language(&self, language: &str) -> bool
pub fn supports_language(&self, language: &str) -> bool
Check if a language is supported
Sourcepub fn supported_languages(&self) -> Vec<&str>
pub fn supported_languages(&self) -> Vec<&str>
Get list of supported languages
Sourcepub fn detect_language(path: &Path) -> Option<String>
pub fn detect_language(path: &Path) -> Option<String>
Detect language from file extension
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AstParser
impl RefUnwindSafe for AstParser
impl Send for AstParser
impl Sync for AstParser
impl Unpin for AstParser
impl UnwindSafe for AstParser
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