| Crates.io | aranya-policy-ast |
| lib.rs | aranya-policy-ast |
| version | 0.12.0 |
| created_at | 2024-10-16 18:18:19.793563+00 |
| updated_at | 2026-01-23 18:37:59.112656+00 |
| description | The Aranya Policy Language AST |
| homepage | |
| repository | https://github.com/aranya-project/aranya-core |
| max_upload_size | |
| id | 1412127 |
| size | 78,406 |
The Abstract Syntax Tree (AST) for the Aranya Policy Language.
This crate provides the data structures that represent the parsed form of Aranya Policy Language source code. It defines the AST nodes for all language constructs including policies, facts, actions, effects, expressions, statements, and type definitions.
The AST is the intermediate representation used by the Aranya Policy Language compiler and other tools that need to analyze or transform policy code.
use aranya_policy_ast::Version;
use aranya_policy_lang::lang::parse_policy_str;
use aranya_policy_compiler::Compiler;
// Create a new policy AST
let policy = parse_policy_str("policy code", Version::V2)?;
// Compile AST into module
let module = Compiler::new(&policy).compile()?;
std - Enable standard library support (default: disabled)proptest - Enable property testing support for AST nodes (default: disabled)All AST types support serialization through:
This crate supports no_std environments by default, using alloc for dynamic allocations. Enable the std feature for full standard library support.