def blank

ezx@1.11.0.0 · src/pkg/pkg.bend:59

import ezx@1.11.0.0/src/pkg/pkg.bend as Pkg
import Base

59# a character bend's loader reads as white space in an import line. The
60# loader trims each line of a file's header and splits an import on `\s+`,
61# JavaScript's white space: tab, line feed, vertical tab, form feed, carriage
62# return and space, the no-break space, and the Unicode space separators, the
63# line and paragraph separators and the byte order mark. A zero-width space
64# or a next-line character is not one, and bend refuses an import it holds.
65def blank(+ch: Char) -> Bool:
66  match ch:
67    case Chr{+x}:
68      Bool.or(Bool.or(U32.is_eq(x, 32), Bool.and(U32.is_ge(x, 9), U32.is_le(x, 13))),
69        Bool.or(Bool.or(U32.is_eq(x, 160), U32.is_eq(x, 5760)),
70          Bool.or(Bool.and(U32.is_ge(x, 8192), U32.is_le(x, 8202)),
71            Bool.or(Bool.or(U32.is_eq(x, 8232), U32.is_eq(x, 8233)),
72              Bool.or(Bool.or(U32.is_eq(x, 8239), U32.is_eq(x, 8287)),
73                Bool.or(U32.is_eq(x, 12288), U32.is_eq(x, 65279)))))))

Uses (7)

Used by (3)