Re-exports§
pub use ast::*;
pub use codegen::*;
pub use isidentifier::*;
pub use scope::*;
pub use symbols::*;
pub use parser::*;
pub use result::*;
pub use datamodel::*;
pub use traits::*;
pub use parser_utils::*;
Modules§
- ast
- python-ast-rs
- codegen
- Code generation for Python ASTs.
- datamodel
- Module representing the Python Data Model in Rust form. See: here.
- isidentifier
- This module uses Python to determine if a given string is a valid Python identifier or not. See here
- macros
- parser
- parser_
utils - pytypes
- result
- scope
- symbols
- Implements a Python-compatilble symbol table for Rust.
- traits
Macros§
- create_
parse_ test - Macro for generating test functions for AST parsing. Reduces duplication in test code.
- extract_
py_ attr - Macro for extracting PyAny attributes with consistent error handling.
- extract_
py_ type_ name - Macro for extracting PyAny type names with error handling.
- extract_
with_ context - Macro for generating PyAny attribute extraction with error context.
- impl_
binary_ op_ from_ py - Macro for generating binary operator FromPyObject implementations. This handles the common pattern of extracting left, right, and op from Python binary operators.
- impl_
codegen_ with_ custom - Macro for implementing CodeGen with custom code generation logic.
- impl_
from_ py_ object_ for_ op_ enum - Macros for reducing code duplication in the python-ast library. Macro for generating FromPyObject implementations for operator enums. This reduces the boilerplate for extracting Python operator objects.
- impl_
node_ with_ positions - Macro for generating Node trait implementations with optional position fields. This macro automatically implements the Node trait for types that have position fields.
- impl_
standard_ codegen - Macro for generating standard CodeGen trait implementations. This reduces boilerplate for the common pattern of CodeGen implementations.
- operator_
match_ arms - Generates repetitive match arms for operator conversions.
- symbol_
table_ test - Macro for generating symbol table tests with consistent patterns.
Type Aliases§
- PyResult
- Represents the result of a Python call.