Re.run: def of yaml-for-bend@0.1.1.0 Import: import yaml-for-bend@0.1.1.0/re.bend as Re Lines 79-106 of yaml-for-bend@0.1.1.0/re.bend: https://jend.leeeet.dev/read.txt?path=yaml-for-bend@0.1.1.0/re.bend&start_line=79&end_line=106 import Base def run(fuel: Nat, ps: List<&2, Pat>, +s: String) -> Bool: match fuel: case 0n: False{} case 1n+(+k): match ps: case Nil{}: String.is_empty(s) case Con{p, +rest}: match p: case One{cls}: match s: case SNil{}: False{} case SCon{+c, t}: and.then(test(cls, c), u => run(k, rest, t)) case Opt{+q}: or.else(run(k, q <> rest, s), u => run(k, rest, s)) case Star{+q}: or.else(run(k, q <> Star{q} <> rest, s), u => run(k, rest, s)) case Plus{+q}: run(k, q <> Star{q} <> rest, s) case Alt{alts}: match alts: case Nil{}: False{} case Con{a, others}: or.else(run(k, List.append(&2, Pat, a, rest), s), u => run(k, Alt{others} <> rest, s)) Uses (10): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.append https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.is_empty https://jend.leeeet.dev/definition.txt?path=yaml-for-bend@0.1.1.0/re.bend&name=Pat https://jend.leeeet.dev/definition.txt?path=yaml-for-bend@0.1.1.0/re.bend&name=and.then https://jend.leeeet.dev/definition.txt?path=yaml-for-bend@0.1.1.0/re.bend&name=or.else https://jend.leeeet.dev/definition.txt?path=yaml-for-bend@0.1.1.0/re.bend&name=test