Css.css.select.scan: def of gralha-css-style@0.1.0.1 Import: import gralha-css-style@0.1.0.1/css.bend as Css Lines 262-271 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=262&end_line=271 import Base import gralha-text-scan@0.1.0.1/scan.bend as U def css.select.scan(scan: U.Scan, +context: CSSContext, +best: CSSMatch, next: String -> CSSMatch -> CSSMatch) -> CSSMatch: U.Scan{h, t} = scan CSSMatch{found, score} = best +sel = U.trim.both(h) +parts = css.parts(sel, 0, Nil{}) +hit = Bool.not(U.string.equal(sel, "")) && css.match(parts, Con{context, Nil{}}, True{}) +weight = css.specificity(parts) next(U.drop(t, ","))(CSSMatch{found || hit, U.choose(U32, hit && U32.is_gt(weight, score), weight, score)}) @unsafe 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=List 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.is_gt 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=CSSMatch https://jend.leeeet.dev/definition.txt?path=gralha-css-style@0.1.0.1/css.bend&name=css.match https://jend.leeeet.dev/definition.txt?path=gralha-css-style@0.1.0.1/css.bend&name=css.parts https://jend.leeeet.dev/definition.txt?path=gralha-css-style@0.1.0.1/css.bend&name=css.specificity 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=choose https://jend.leeeet.dev/definition.txt?path=gralha-text-scan@0.1.0.1/scan.bend&name=drop https://jend.leeeet.dev/definition.txt?path=gralha-text-scan@0.1.0.1/scan.bend&name=string.equal https://jend.leeeet.dev/definition.txt?path=gralha-text-scan@0.1.0.1/scan.bend&name=trim.both