Css.css.cut: def of gralha-css-style@0.1.0.1 Import: import gralha-css-style@0.1.0.1/css.bend as Css Lines 36-52 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=36&end_line=52 import Base import gralha-text-scan@0.1.0.1/scan.bend as U def css.cut(+s: String, +end: U32, +depth: U32, +quote: U32, +escaped: Bool, +acc: String) -> U.Scan: match s: case SNil{}: U.Scan{U.rev(acc, ""), ""} case SCon{Chr{ch}, tail}: +c = ch +t = tail +quoted = Bool.not(U32.is_eq(quote, 0)) +opening = U32.is_eq(c, 40) || U32.is_eq(c, 91) || U32.is_eq(c, 123) +closing = U32.is_eq(c, 41) || U32.is_eq(c, 93) || U32.is_eq(c, 125) U.branch(U.Scan, Bool.not(escaped) && Bool.not(quoted) && U32.is_eq(depth, 0) && css.stop(c, end), _ => U.Scan{U.rev(acc, ""), s}, _ => U.branch(U.Scan, Bool.not(escaped) && Bool.not(quoted) && U.prefix(s, "/*"), _ => css.cut(U.through(t, "*/"), end, depth, quote, False{}, acc), _ => css.cut(t, end, U.choose(U32, quoted || escaped, depth, U.choose(U32, opening, U32.inc(depth), U.choose(U32, closing && U32.is_gt(depth, 0), (depth - 1 : U32), depth))), U.choose(U32, escaped, quote, U.choose(U32, quoted, U.choose(U32, U32.is_eq(c, quote), 0, quote), U.choose(U32, U32.is_eq(c, 34) || U32.is_eq(c, 39), c, 0))), Bool.not(escaped) && U32.is_eq(c, 92), SCon{Chr{c}, acc}))) Uses (18): 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.not https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.or https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Char https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.inc 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_gt https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.sub https://jend.leeeet.dev/definition.txt?path=gralha-css-style@0.1.0.1/css.bend&name=css.stop https://jend.leeeet.dev/definition.txt?path=gralha-text-scan@0.1.0.1/scan.bend&name=Scan 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 https://jend.leeeet.dev/definition.txt?path=gralha-text-scan@0.1.0.1/scan.bend&name=prefix https://jend.leeeet.dev/definition.txt?path=gralha-text-scan@0.1.0.1/scan.bend&name=rev https://jend.leeeet.dev/definition.txt?path=gralha-text-scan@0.1.0.1/scan.bend&name=through