def close

cswap-bend-cli@0.1.0.0 · fmt/csv.bend:160

import cswap-bend-cli@0.1.0.0/fmt/csv.bend as Csv
import Base

160# The input ended: close the record in progress.
161def close(m: Mode, +st: St) -> St:
162  match m:
163    case MStart{}:
164      blank.pick(row_empty(st), st)
165    case MQuoted{}:
166      fail(st, "unterminated quoted field")
167    case MPlain{}:
168      end_both(st)
169    case MClosed{}:
170      end_both(st)

Uses (6)

Used by (1)