def needs_quote

bend-toon-codec@0.1.0.0 · src/text.bend:120

import bend-toon-codec@0.1.0.0/src/text.bend as Text
import Base

120# Section 7.2: must this string value be quoted? `d` is the delimiter that
121# applies (the document delimiter for field values, the active delimiter for
122# array cells), as a code point.
123def needs_quote(+s: String, +d: U32) -> Bool:
124  String.is_empty(s) || head_ws(s) || last_ws(s) || reserved(s)
125    || numeric_like(s) || starts_hyphen(s) || has_special(s, d)

Uses (11)

Used by (1)