openjd_expr/eval/mod.rs
1// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2// Copyright by contributors to this project.
3// SPDX-License-Identifier: (Apache-2.0 OR MIT)
4
5//! Expression parsing and evaluation.
6//!
7//! Uses `ruff_python_parser` to parse Python expression syntax into an AST,
8//! then evaluates with a custom bounded evaluator. This mirrors the Python
9//! implementation which uses `ast.parse()` + a custom `Evaluator` class.
10
11pub(crate) mod evaluator;
12mod parse;
13
14pub(crate) use evaluator::Evaluator;
15pub use evaluator::{EvalResult, DEFAULT_MEMORY_LIMIT, DEFAULT_OPERATION_LIMIT};
16pub use parse::{EvalBuilder, ParsedExpression, MAX_EXPRESSION_DEPTH, MAX_PARSE_INPUT_LEN};