def is_printable

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

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

212# What YAML allows in a document: tab, line feed, and printable characters.
213def is_printable(c: Char) -> Bool:
214  match c:
215    case Chr{+x}:
216      Bool.or(Bool.or(U32.is_eq(x, 9), U32.is_eq(x, 10)),
217        Bool.or(between(x, 32, 126), Bool.or(U32.is_eq(x, 133), Bool.or(between(x, 160, 55295),
218          Bool.or(between(x, 57344, 65533), between(x, 65536, 1114111))))))

Uses (5)

Used by (2)