def css.simple

gralha-css-style@0.1.0.1 · css.bend:200

import gralha-css-style@0.1.0.1/css.bend as Css
import Base
import gralha-text-scan@0.1.0.1/scan.bend as U

200def css.simple(+fuel: Nat, +s: String, +context: CSSContext) -> Bool:
201  match fuel s:
202    case 0n _: False{}
203    case 1n+d SNil{}: True{}
204    case 1n+d SCon{Chr{c}, t}:
205      U.branch(Bool, U32.is_eq(c, 42), _ => css.simple(d, t, context),
206        _ => U.branch(Bool, U32.is_eq(c, 35) || U32.is_eq(c, 46),
207          _ => css.simple.scan(css.ident(t, ""), context, c, rest => css.simple(d, rest, context)),
208          _ => U.branch(Bool, U32.is_eq(c, 91),
209            _ => css.simple.attr(css.scan(t, 93), context, rest => css.simple(d, rest, context)),
210            _ => U.branch(Bool, U32.is_eq(c, 58),
211              _ => css.simple.pseudo(css.ident(t, ""), context, rest => css.simple(d, rest, context), arg => css.simple(d, arg, context)),
212              _ => css.simple.scan(css.ident(s, ""), context, 0, rest => css.simple(d, rest, context))))))
213
214@unsafe

Uses (13)

Used by (1)