plissken-core::parser::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¶
plissken-core::parser::traits::ParserLanguage pub¶
Language identifier for parsers.
Variants¶
Rust- Rust programming languagePython- Python programming language
plissken-core::parser::traits::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¶
plissken-core::parser::traits::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
plissken-core::parser::traits::parser_for_extension¶
pub
Get a parser for the given file extension.
Returns None if the extension is not recognized.
Examples: