CEL.Expr.Comprehension (CEL v0.2.0)

Copy Markdown View Source

CEL's loop, which comprehension macros expand to. It appears directly in the tree only for a parsed expression that has one without its macro, such as one from another CEL implementation.

It binds iter_var (and iter_var2, for two-variable forms) to each element of iter_range in turn, and accu_var to an accumulator that starts as accu_init. While loop_condition holds, loop_step computes the next accumulator; result is evaluated last.

Summary

Types

t()

@type t() :: %CEL.Expr.Comprehension{
  accu_init: CEL.Expr.t(),
  accu_var: String.t(),
  id: CEL.Checked.expr_id(),
  iter_range: CEL.Expr.t(),
  iter_var: String.t(),
  iter_var2: String.t() | nil,
  loop_condition: CEL.Expr.t(),
  loop_step: CEL.Expr.t(),
  result: CEL.Expr.t(),
  type: CEL.Expr.type()
}