fmt/csv.bend checks
raw source on the hub · import cswap-bend-cli@0.1.0.0/fmt/csv.bend as Csv
1 import
import Base
Types
type Mode source · line 53 · raw
Data
MStartMode
MPlainMode
MQuotedMode
MClosedMode
type St source · line 60 · raw
Data
rows and row are reversed; cur is the reversed text of the field in progress.
St@rows:List<&2, List<&2, String>> -> @row:List<&2, String> -> @cur:String -> @mode:Mode -> @err:String -> St
Definitions
def special source · line 9 · raw
@+c:U32 -> Bool
def needs source · line 12 · raw
@s:String -> Bool
def dq source · line 19 · raw
@s:String -> String
def field.q source · line 26 · raw
@c:Bool -> @+s:String -> String
def field source · line 30 · raw
@+s:String -> String
One field, quoted when it must be.
def row source · line 34 · raw
@fs:List<&2, String> -> String
One record, without the line end.
def table source · line 44 · raw
@rs:List<&2, List<&2, String>> -> String
Records, each ending in LF.
def start source · line 63 · raw
St
def with_mode source · line 66 · raw
@+st:St -> @m:Mode -> St
def push source · line 71 · raw
@+c:U32 -> @+st:St -> St
def end_field source · line 77 · raw
@+st:St -> @m:Mode -> St
The field in progress ends; the next field starts in m.
def end_row source · line 82 · raw
@+st:St -> St
def end_both source · line 87 · raw
@+st:St -> St
def fail source · line 90 · raw
@+st:St -> @msg:String -> St
def row_empty source · line 95 · raw
@+st:St -> Bool
def blank.pick source · line 100 · raw
@empty:Bool -> @+st:St -> St
def sel.st source · line 107 · raw
@c:Bool -> @+a:St -> @+b:St -> St
def at_start source · line 114 · raw
@+c:U32 -> @+st:St -> St
def in_plain source · line 121 · raw
@+c:U32 -> @+st:St -> St
def in_quoted source · line 127 · raw
@+c:U32 -> @+st:St -> St
def after_quote source · line 130 · raw
@+c:U32 -> @+st:St -> St
def step source · line 137 · raw
@m:Mode -> @+c:U32 -> @+st:St -> St
def mode_of source · line 148 · raw
@+st:St -> Mode
def go source · line 153 · raw
@s:String -> @+st:St -> St
def close source · line 161 · raw
@m:Mode -> @+st:St -> St
The input ended: close the record in progress.
def result source · line 172 · raw
@+st:St -> Result<&2, &2, String, List<&2, List<&2, String>>>
def parse.fin source · line 177 · raw
@+st:St -> Result<&2, &2, String, List<&2, List<&2, String>>>
def parse source · line 181 · raw
@s:String -> Result<&2, &2, String, List<&2, List<&2, String>>>
Records of fields. Blank lines are skipped; Fail names a quoting error.