pub struct ParserManager;Expand description
Stateless parser manager.
Implementations§
Source§impl ParserManager
impl ParserManager
Sourcepub fn parse_file(
&self,
lang: Language,
source: &str,
) -> Result<Vec<RawNode>, IcbError>
pub fn parse_file( &self, lang: Language, source: &str, ) -> Result<Vec<RawNode>, IcbError>
Parse a single source file using the most appropriate backend for the given language.
§Arguments
lang– the programming language of the source.source– the raw source code as a UTF‑8 string.
§Errors
Returns IcbError::Parse if the specialised parser fails.
Unknown / unsupported languages are handled by the universal
heuristic parser and never produce an error.
Sourcepub fn parse_directory(
&self,
lang: Language,
root: &Path,
) -> Result<Vec<(String, Vec<RawNode>)>, IcbError>
pub fn parse_directory( &self, lang: Language, root: &Path, ) -> Result<Vec<(String, Vec<RawNode>)>, IcbError>
Recursively discover and parse files under root for the given
language.
The language determines both the file extensions and the parser backend. Files that cannot be read as UTF‑8 or that cause a parser error are silently skipped.
§Arguments
lang– the programming language to use for parsing.root– the root directory to walk.
§Errors
Returns IcbError::Parse if directory traversal fails (e.g.
permission denied). Individual file failures are not propagated.
Trait Implementations§
Source§impl Default for ParserManager
impl Default for ParserManager
Source§fn default() -> ParserManager
fn default() -> ParserManager
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ParserManager
impl RefUnwindSafe for ParserManager
impl Send for ParserManager
impl Sync for ParserManager
impl Unpin for ParserManager
impl UnsafeUnpin for ParserManager
impl UnwindSafe for ParserManager
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