bend-toon-codec
Releases (1)
-
0.1.0.0 indexed
Definitions (412)
main.bend
- type JsonJSON values.
- type DelimDelimiter of arrays and tabular rows.
- type EncodeOptsSpaces per indent level, the document delimiter, and key folding: 0 is off (the default), n of 2 or more folds chains of single-key objects into dotted keys of at most n segments (`a.b.c: 1`), 4294967295 folds whole chains.
- type DecodeOptsSpaces per indent level (used to compute line depth), strict mode (counts, indentation, blank lines, duplicate keys), and path expansion (an unquoted key `a.b.c` becomes nested objects; quoted keys stay literal).
- def encode_defaultIndent 2, comma.
- def decode_defaultIndent 2, strict.
- def to_inner
- def of_inner
- def of_inner_result
- def inner_delim
- def encodeTOON text of a value, LF line endings, no trailing newline.
- def decodeThe value of TOON text, or the first error with its line number.
- def eqJSON-model equality: numbers by value (`1.0` equals `1`), objects by ordered keys.
src/decode.bend
- type DOptsDecoder options: spaces per indent level, strict mode, and path expansion (section 13.4: unquoted dotted keys become nested objects).
- def ddefaults
- def foldApply every line in order, stopping at the first error.
- def root.value
- def fuelThe stack height: enough steps to close every frame.
- def finishClose what is still open and take the root.
- def all_blank
- def skip_blank
- def init
- def object.root
- def array.rootThe root is an array: its header started a value or an open frame.
- def run.object
- def run.array
- def single.pickA one-line document that is no entry is a primitive.
- def single.if
- def single
- def root.otherSection 5 root form discovery, after the header of a root array failed.
- def root.hdr
- def header.try.pick
- def header.try
- def start.first
- def start.skipped
- def start
- def run
- def post.pick
- def postQuoted-key markers come off; with path expansion the dotted keys unfold.
- def decodeDecode TOON text.
src/dline.bend
- type DL
- type LdLeading spaces and tabs counted, and what follows them.
- def lead.pick
- def inc
- def leadCount the leading spaces and tabs.
- def at
- def blank
- def depth.pickDepth is spaces divided by the indent size.
- def make.nonblank
- def make.pick
- def make.of
- def make
- def prep.cons
- def prep.go
- def size.of
- def prepSplit on LF and number the lines from 1.
src/encode.bend
- type Delim
- type EOptsEncoder options: spaces per indent level, the document delimiter, and key folding (section 13.4): 0 is off, n of 2 or more folds chains of single-key objects into dotted keys of at most n segments, 4294967295 folds whole chains.
- def defaults
- def codeThe delimiter as a code point.
- def symWhat a header writes inside the brackets for this delimiter.
- def delim.text
- def bool.text
- def num.text
- def is_prim
- def prim.textThe text of a primitive, quoted as `d` (a code point) requires.
- def count
- def all_prim
- def join.primsPrimitives joined by the delimiter.
- def fields.len
- def fields.prim
- def field.pick
- def field.get
- def has_key
- def keys.ofThe keys of an object.
- def has_all
- def list.len
- def row.fitsOne element fits the header's keys: an object of primitives with exactly those keys.
- def tab.ok
- def first.keysKeys of the first element when it is a non-empty object, else none.
- def tabular.keys
- def tabular
- def fields.text
- def row.cells
- def row.of
- def rows
- def head
- def tab.rep
- def arr.pick
- def arr.repAn array's rep.
- def encOne def for values, object fields and list items.
- def encodeEncode a value as TOON text.
src/entry.bend
- type Ent
- def val.done
- def val.pick
- def valThe text after the colon of `key:`.
- def hdr.done
- def quoted.pick
- def quoted.restquoted key, then what follows its closing quote
- def quoted