Skip to main content

Crate openjd_expr

Crate openjd_expr 

Source
Expand description

Open Job Description expression language.

This crate implements the expression language for OpenJD templates:

  • Format string parsing and resolution ({{Expr.Name}} syntax)
  • EXPR extension expression evaluation (arithmetic, conditionals, functions)
  • Type system, runtime values, and symbol tables
  • Range expressions and path mapping

Uses ruff_python_parser for EXPR extension expression parsing. See specs/expr/parser.md for rationale.

Re-exports§

pub use error::ExpressionError;
pub use error::ExpressionErrorKind;
pub use eval::EvalBuilder;
pub use eval::EvalResult;
pub use eval::ParsedExpression;
pub use eval::DEFAULT_MEMORY_LIMIT;
pub use eval::DEFAULT_OPERATION_LIMIT;
pub use eval::MAX_EXPRESSION_DEPTH;
pub use eval::MAX_PARSE_INPUT_LEN;
pub use format_string::escape_format_string;
pub use format_string::FormatString;
pub use format_string::FormatStringOptions;
pub use format_string::FormatStringValidationError;
pub use function_library::EvalContext;
pub use function_library::FunctionLibrary;
pub use path_mapping::PathFormat;
pub use path_mapping::PathMappingRule;
pub use profile::ExprExtension;
pub use profile::ExprProfile;
pub use profile::ExprRevision;
pub use profile::HostContext;
pub use range_expr::RangeExpr;
pub use range_expr::RangeExprError;
pub use range_expr::MAX_RANGE_EXPR_CHUNKS;
pub use symbol_table::SerializedSymbolTable;
pub use symbol_table::SymbolTable;
pub use symbol_table::SymbolTableError;
pub use symbol_table::MAX_SYMBOL_TABLE_ENTRIES;
pub use types::ExprType;
pub use types::TypeCode;
pub use value::ExprValue;

Modules§

default_library
Default function library with all built-in signatures.
error
Expression language error types.
eval
Expression parsing and evaluation.
format_string
Format string parsing and resolution.
function_library
Function library: signature-based multiple dispatch for expression evaluation.
functions
Function implementations for the expression language.
path_mapping
Path format and mapping rules.
profile
Expression profile: the tuple of (revision, extensions, host context) that governs which functions, operators, and types are available for a given evaluation.
range_expr
Integer range expression parsing.
symbol_table
Hierarchical symbol table for expression evaluation.
types
Expression type system.
uri_path
URI-aware path operations.
value
Runtime values for expression evaluation.

Macros§

symtab
Construct a SymbolTable from key-value pairs.