eval_expr

Function eval_expr 

Source
pub fn eval_expr(expr: &Expr, ctx: &Context) -> String
Expand description

Evaluates an expression within the given context and returns its result as a string.

Supports literals, variables, binary operations, and function calls. Binary operations are evaluated as integer arithmetic or comparisons. Function calls are executed with a new local context.

§Arguments

  • expr - The expression to evaluate.
  • ctx - The current execution context containing variables and functions.

§Returns

A string representing the result of the evaluated expression.