Skip to main content

evaluate_table

Function evaluate_table 

Source
pub fn evaluate_table(
    lib: &JSONEval,
    eval_key: &str,
    scope_data: &EvalData,
    token: Option<&CancellationToken>,
) -> Result<(Arc<Value>, Option<IndexSet<String>>), String>
Expand description

Zero-sandbox table evaluation

Eliminates the full EvalData clone (sandbox) by:

  1. Local row storage: rows are built into a Vec<Value> directly on the stack.
  2. Self-table scope: the evaluator’s TableScope intercepts Var/Ref/ValueAt lookups for the current table’s path, returning rows from local storage.
  3. Direct mutation: forward/backward passes index local_rows by integer — no Arc::make_mut, no JSON-pointer traversal per cell.
  4. $datas in context: evaluated variable bindings are passed as entries inside internal_context (checked first), not written to scope_data.

The caller (evaluate_internal) remains responsible for writing results back to eval_data / static_arrays / evaluated_schema.