def depth.pick
bend-toon-codec@0.1.0.0 · src/dline.bend:44
import bend-toon-codec@0.1.0.0/src/dline.bend as Dline
import Base
44
45
46
47def depth.pick(+bad_tab: Bool, +bad_mult: Bool, +no: U32, +depth: U32, +text: String) -> Result<&2, &2, String, DL>:
48 match bad_tab bad_mult:
49 case True{} _:
50 Fail{at(no, "tabs are not allowed in indentation")}
51 case False{} True{}:
52 Fail{at(no, "indentation is not a multiple of the indent size")}
53 case False{} False{}:
54 Done{DL{no, depth, text, False{}}}