def classify.white

bolt@1.27.0.0 · src/syntax/outline.bend:74

import bolt@1.27.0.0/src/syntax/outline.bend as Outline
import Base

74# whitespace after a leading space-class char. `space` says `h` is whitespace;
75# `acc` is the whitespace before `h`, reversed; `indent` when that line opened
76# with a space
77def classify.white(tt: String, space: Bool, hh: Char, indent: Bool, acc: List<&2, Char>) -> Cls:
78  match tt space:
79    case SNil{} True{}:
80      LBlank{}
81    case SNil{} False{}:
82      classify.white.hit(indent, acc, hh, SNil{})
83    case SCon{+h2, r} True{}:
84      classify.white(r, Char.is_space(h2), h2, indent, hh <> acc)
85    case SCon{h2, r} False{}:
86      classify.white.hit(indent, acc, hh, SCon{h2, r})

Uses (7)

Used by (1)