Module condition

Module condition 

Source
Expand description

Condition block — boolean expression evaluator.

Phase 1 supports a deliberately tiny grammar to avoid a JS sandbox:

<lhs> <op> <rhs> where op ∈ {==, !=, <, <=, >, >=}

Both sides are {{}}-resolved first. If both sides parse as numbers the comparison is numeric; otherwise it’s string. The block’s output is the boolean result, exposed as {{<this_id>.result}}.

Phase 2 adds && / || / ! and grouping; Phase 3 may swap to a real expression parser (evalexpr, etc).

Functions§

eval_simple 🔒
run
split_binop 🔒
Splits at the first occurrence of a recognized comparison operator. Multi-char operators are tried before single-char.