def unprintable

yaml-for-bend@0.1.1.0 · scan.bend:1509

import yaml-for-bend@0.1.1.0/scan.bend as Scan
import Base
import yaml-for-bend@0.1.1.0/token.bend as T

1509# Where the first character YAML doesn't allow is (a control character, a
1510# surrogate), if there is one.
1511def unprintable(s: String, +at: T.Mark) -> Maybe<&2, T.Mark>:
1512  match s:
1513    case SNil{}:
1514      None{}
1515    case SCon{+c, t}:
1516      when(Maybe<&2, T.Mark>, is_printable(c), u => unprintable(t, past(at, c)), u => Some{at})

Uses (6)

Used by (1)