src/rep.bend checks
raw source on the hub · import bend-toon-codec@0.1.0.0/src/rep.bend as Rep
1 import
import Base
Types
type Ln source · line 9 · raw
Data
Ln@d:U32 -> @t:String -> Ln
type Rep source · line 12 · raw
Data
RPrim@t:String -> Rep
A primitive: its text.
RLines@ls:List<&2, Ln> -> Rep
An object (field lines) or a chain of list items: lines at relative depth 0.
RArr@h:String -> @ks:List<&2, Ln> -> Rep
A non-empty array: the text after the key (
[2]: a,b,[2]{a,b}:,[2]:) and the lines beneath the header, already at depth 1 and deeper.REmptyRep
An empty array.
Definitions
def shift source · line 23 · raw
@+ls:List<&2, Ln> -> List<&2, Ln>
def lines.of source · line 30 · raw
@+r:Rep -> List<&2, Ln>
def cat source · line 37 · raw
@+a:List<&2, Ln> -> @+b:List<&2, Ln> -> List<&2, Ln>
def one source · line 44 · raw
@+d:U32 -> @+t:String -> List<&2, Ln>
def field source · line 48 · raw
@+k:String -> @+r:Rep -> List<&2, Ln>
Lines of key: value for any value rep.
def item.obj source · line 61 · raw
@+ls:List<&2, Ln> -> List<&2, Ln>
The first line of an object item rides on the hyphen line; the rest sit one level under it.
def item source · line 69 · raw
@+r:Rep -> List<&2, Ln>
Lines of - value for any value rep.
def root source · line 81 · raw
@+r:Rep -> List<&2, Ln>
Lines of a whole document.
def indent.of source · line 92 · raw
@+size:U32 -> @+d:U32 -> String
def render.line source · line 95 · raw
@+size:U32 -> @+l:Ln -> String
def render.tail source · line 100 · raw
@+size:U32 -> @+ls:List<&2, Ln> -> String
def render source · line 108 · raw
@+size:U32 -> @+ls:List<&2, Ln> -> String
Join lines with LF; no trailing newline.