Skip to main content

openjd_expr/
lib.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//! Open Job Description expression language.
6//!
7//! This crate implements the expression language for OpenJD templates:
8//! - Format string parsing and resolution (`{{Expr.Name}}` syntax)
9//! - EXPR extension expression evaluation (arithmetic, conditionals, functions)
10//! - Type system, runtime values, and symbol tables
11//! - Range expressions and path mapping
12//!
13//! Uses `ruff_python_parser` for EXPR extension expression parsing.
14//! See `specs/expr/parser.md` for rationale.
15
16pub mod default_library;
17pub(crate) mod edit_distance;
18pub mod error;
19pub mod eval;
20pub mod format_string;
21pub mod function_library;
22pub mod functions;
23pub mod path_mapping;
24pub mod profile;
25pub mod range_expr;
26pub mod symbol_table;
27pub mod types;
28pub mod uri_path;
29pub mod value;
30
31pub use error::{ExpressionError, ExpressionErrorKind};
32pub use eval::{
33    EvalBuilder, EvalResult, ParsedExpression, DEFAULT_MEMORY_LIMIT, DEFAULT_OPERATION_LIMIT,
34    MAX_EXPRESSION_DEPTH, MAX_PARSE_INPUT_LEN,
35};
36pub use format_string::escape_format_string;
37pub use format_string::FormatString;
38pub use format_string::FormatStringOptions;
39pub use format_string::FormatStringValidationError;
40pub use function_library::{EvalContext, FunctionLibrary};
41pub use path_mapping::{PathFormat, PathMappingRule};
42pub use profile::{ExprExtension, ExprProfile, ExprRevision, HostContext};
43pub use range_expr::{RangeExpr, RangeExprError, MAX_RANGE_EXPR_CHUNKS};
44pub use symbol_table::{
45    SerializedSymbolTable, SymbolTable, SymbolTableError, MAX_SYMBOL_TABLE_ENTRIES,
46};
47pub use types::{ExprType, TypeCode};
48pub use value::ExprValue;