Skip to main content

Module condition

Module condition 

Source
Expand description

Condition evaluation shared by if-else, loop break conditions and list-operator filters.

Semantics:

  • A missing variable is treated as Value::Null. exists, null and empty therefore work on absent variables, and nothing errors on null.
  • Positive operators on Null are false; negated operators (not contains, is not, ≠, not in, not empty…) are the exact negation of their positive counterpart.
  • Numeric comparisons use f64 without truncation (3 = "3.9" is false).
  • Expected values that are strings may contain {{#ns.name#}} placeholders; they are resolved against the pool before comparison.
  • For array[file] with a sub-condition group, the outer operator decides how per-file results combine: contains = any file matches, not contains = no file matches, all of = every file matches (and the list is non-empty).

Structs§

Condition
A condition on one variable.
ConditionError
Error evaluating a condition (operator not applicable to the value types).
ConditionTrace
Evaluation record of one condition, for observability.
KeyCondition
Condition on an attribute (key) of an item: a file attribute, an object path (dotted), or empty for the item itself.
SubConditionGroup
Attribute conditions applied to each file.

Enums§

LogicalOperator
How conditions in a group combine.
Operator
Comparison operator. Wire names follow the established workflow format; ASCII aliases are accepted.

Functions§

evaluate
Evaluate one condition against the pool.
evaluate_group
Evaluate a group of conditions with short-circuiting. An empty group is false for and/or alike (no condition means “no match”).
evaluate_traced
Evaluate one condition and return its trace.