traits Rust¶
Parser trait and related types for language-agnostic parsing.
This module defines the Parser trait which provides a common interface
for parsing source code from different languages.
Enums¶
enum ParserLanguage pub¶
Language identifier for parsers.
Variants¶
Rust- Rust programming languagePython- Python programming language
enum Module pub¶
A parsed module, either Rust or Python.
This enum allows parsers to return a unified type while preserving the specific module information for each language.
Variants¶
Rust- A parsed Rust modulePython- A parsed Python module
Functions¶
fn create_parser¶
pub
Create a parser for the given language.
Examples:
use plissken_core::parser::{create_parser, ParserLanguage};
let mut parser = create_parser(ParserLanguage::Python);
let module = parser.parse_file(Path::new("module.py"))?;
Source
fn parser_for_extension¶
pub
Get a parser for the given file extension.
Returns None if the extension is not recognized.
Examples: