Files
Decodal/doc/manual/source/language/expression/match.md
T

509 B

Match Expression

A match expression compares a target value against patterns from top to bottom and selects the first matching arm.

foo = match inputs.a.hoge {
    >= 20: {
        value = 200;
    };
    >= 10: {
        value = 100;
    };
    _: {
        value = 300;
    };
};

_ is the fallback pattern.

Ordering

Arms are ordered; Decodal does not automatically select the most specific pattern. If a broad condition appears first, narrower conditions after it are unreachable.