Css.css.match: def of gralha-css-style@0.1.0.1 Import: import gralha-css-style@0.1.0.1/css.bend as Css Lines 215-224 of gralha-css-style@0.1.0.1/css.bend: https://jend.leeeet.dev/read.txt?path=gralha-css-style@0.1.0.1/css.bend&start_line=215&end_line=224 import Base import gralha-text-scan@0.1.0.1/scan.bend as U def css.match(+steps: List<&2, CSSStep>, +contexts: List<&2, CSSContext>, +one: Bool) -> Bool: match steps contexts: case Nil{} _: True{} case Con{step, rest} Nil{}: False{} case Con{CSSStep{compound, relation}, rest} Con{CSSContext{node, parents, previous, index, count}, others}: +rel = relation (css.simple(128n, compound, CSSContext{node, parents, previous, index, count}) && U.branch(Bool, U32.is_eq(rel, 0), _ => True{}, _ => css.match(rest, U.choose(List<&2, CSSContext>, U32.is_le(rel, 2), parents, previous), U32.is_eq(rel, 2) || U32.is_eq(rel, 3)))) || U.branch(Bool, one, _ => False{}, _ => css.match(steps, others, False{})) Uses (11): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.or https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_eq https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_le https://jend.leeeet.dev/definition.txt?path=gralha-css-style@0.1.0.1/css.bend&name=CSSContext https://jend.leeeet.dev/definition.txt?path=gralha-css-style@0.1.0.1/css.bend&name=CSSStep https://jend.leeeet.dev/definition.txt?path=gralha-css-style@0.1.0.1/css.bend&name=css.simple https://jend.leeeet.dev/definition.txt?path=gralha-text-scan@0.1.0.1/scan.bend&name=branch https://jend.leeeet.dev/definition.txt?path=gralha-text-scan@0.1.0.1/scan.bend&name=choose