Skip to main content

parse_expression_arena_with_context

Function parse_expression_arena_with_context 

Source
pub fn parse_expression_arena_with_context<'arena>(
    input: &str,
    arena: &'arena Bump,
    reserved_vars: Option<&[String]>,
    context_vars: Option<&[String]>,
) -> Result<AstExpr<'arena>, ExprError>
Expand description

Parse an expression with reserved variables and context variable names.

This is the most configurable parsing function that allows specifying both:

  • reserved_vars: Variables that should not be treated as functions in implicit calls
  • context_vars: Variables from the evaluation context that should be recognized

Supports all expression features, including ternary operators.

ยงParameters

  • input - The expression string to parse
  • arena - The arena to allocate AST nodes in
  • reserved_vars - Optional list of variable names that should not be treated as functions
  • context_vars - Optional list of variable names from the evaluation context