~/bend-docscommunity

src/frame.bend checks

raw source on the hub · import bend-toon-codec@0.1.0.0/src/frame.bend as Frame

4 imports
import Base
import ./json.bend as J
import ./split.bend as S
import ./head.bend as Hd

Types

type Att source · line 13 · raw

Data

type Fr source · line 18 · raw

Data

type St source · line 25 · raw

Data

The stack (top first), the finished root once there is one, and the shallowest array that had a blank line inside it since the last content line.

Definitions

def stk.of source · line 28 · raw

@+st:St -> List<&2, Fr>

def bmin.of source · line 33 · raw

@+st:St -> U32

def fr.depth source · line 38 · raw

@+f:Fr -> U32

def fr.att source · line 47 · raw

@+f:Fr -> Att

def rev.items source · line 58 · raw

@+xs:0x12996a27cbeef5e5ba1e8cd909be0e05/src/json.Json -> @+acc:0x12996a27cbeef5e5ba1e8cd909be0e05/src/json.Json -> 0x12996a27cbeef5e5ba1e8cd909be0e05/src/json.Json

def rev.fields source · line 65 · raw

@+fs:0x12996a27cbeef5e5ba1e8cd909be0e05/src/json.Json -> @+acc:0x12996a27cbeef5e5ba1e8cd909be0e05/src/json.Json -> 0x12996a27cbeef5e5ba1e8cd909be0e05/src/json.Json

def has_key source · line 72 · raw

@+k:String -> @+fs:0x12996a27cbeef5e5ba1e8cd909be0e05/src/json.Json -> Bool

def set.pick source · line 79 · raw

@+hit:Bool -> @+k:String -> @+v:0x12996a27cbeef5e5ba1e8cd909be0e05/src/json.Json -> @+old:0x12996a27cbeef5e5ba1e8cd909be0e05/src/json.Json -> @+rest:0x12996a27cbeef5e5ba1e8cd909be0e05/src/json.Json -> @+t:0x12996a27cbeef5e5ba1e8cd909be0e05/src/json.Json -> 0x12996a27cbeef5e5ba1e8cd909be0e05/src/json.Json

def set source · line 87 · raw

@+k:String -> @+v:0x12996a27cbeef5e5ba1e8cd909be0e05/src/json.Json -> @+fs:0x12996a27cbeef5e5ba1e8cd909be0e05/src/json.Json -> 0x12996a27cbeef5e5ba1e8cd909be0e05/src/json.Json

Replace the value under k, keeping its place.

def add.if source · line 94 · raw

@+dup:Bool -> @+strict:Bool -> @+k:String -> @+v:0x12996a27cbeef5e5ba1e8cd909be0e05/src/json.Json -> @+fs:0x12996a27cbeef5e5ba1e8cd909be0e05/src/json.Json -> Result<&2, &2, String, 0x12996a27cbeef5e5ba1e8cd909be0e05/src/json.Json>

def add_field source · line 105 · raw

@+strict:Bool -> @+fs:0x12996a27cbeef5e5ba1e8cd909be0e05/src/json.Json -> @+k:String -> @+v:0x12996a27cbeef5e5ba1e8cd909be0e05/src/json.Json -> Result<&2, &2, String, 0x12996a27cbeef5e5ba1e8cd909be0e05/src/json.Json>

Add a field to a reversed field chain. A repeated key is an error in strict mode; otherwise the later value replaces the earlier (section 14.4).

def count.ok source · line 110 · raw

@+strict:Bool -> @+n:U32 -> @+c:U32 -> Bool

def fin.arr source · line 113 · raw

@+ok:Bool -> @+xs:0x12996a27cbeef5e5ba1e8cd909be0e05/src/json.Json -> Result<&2, &2, String, 0x12996a27cbeef5e5ba1e8cd909be0e05/src/json.Json>

def finish source · line 120 · raw

@+f:Fr -> @+strict:Bool -> Result<&2, &2, String, 0x12996a27cbeef5e5ba1e8cd909be0e05/src/json.Json>

def put.field.done source · line 129 · raw

@+r:Result<&2, &2, String, 0x12996a27cbeef5e5ba1e8cd909be0e05/src/json.Json> -> @+d:U32 -> @+a:Att -> @+rest:List<&2, Fr> -> @+root:Maybe<&2, 0x12996a27cbeef5e5ba1e8cd909be0e05/src/json.Json> -> @+bmin:U32 -> Result<&2, &2, String, St>

def put.field source · line 136 · raw

@+strict:Bool -> @+d:U32 -> @+a:Att -> @+fs:0x12996a27cbeef5e5ba1e8cd909be0e05/src/json.Json -> @+k:String -> @+v:0x12996a27cbeef5e5ba1e8cd909be0e05/src/json.Json -> @+rest:List<&2, Fr> -> @+root:Maybe<&2, 0x12996a27cbeef5e5ba1e8cd909be0e05/src/json.Json> -> @+bmin:U32 -> Result<&2, &2, String, St>

def attach.top source · line 140 · raw

@+top:Fr -> @+att:Att -> @+v:0x12996a27cbeef5e5ba1e8cd909be0e05/src/json.Json -> @+rest:List<&2, Fr> -> @+root:Maybe<&2, 0x12996a27cbeef5e5ba1e8cd909be0e05/src/json.Json> -> @+strict:Bool -> @+bmin:U32 -> Result<&2, &2, String, St>

Attach a finished value to the frame beneath, or make it the root.

def attach source · line 149 · raw

@+att:Att -> @+v:0x12996a27cbeef5e5ba1e8cd909be0e05/src/json.Json -> @+stk:List<&2, Fr> -> @+root:Maybe<&2, 0x12996a27cbeef5e5ba1e8cd909be0e05/src/json.Json> -> @+strict:Bool -> @+bmin:U32 -> Result<&2, &2, String, St>

def close.go source · line 156 · raw

@+r:Result<&2, &2, String, 0x12996a27cbeef5e5ba1e8cd909be0e05/src/json.Json> -> @+att:Att -> @+rest:List<&2, Fr> -> @+root:Maybe<&2, 0x12996a27cbeef5e5ba1e8cd909be0e05/src/json.Json> -> @+strict:Bool -> @+bmin:U32 -> Result<&2, &2, String, St>

def close source · line 164 · raw

@+st:St -> @+strict:Bool -> Result<&2, &2, String, St>

Close the top frame into the one beneath it.

def close.if source · line 171 · raw

@+b:Bool -> @+st:St -> @+strict:Bool -> Result<&2, &2, String, St>

def should_pop source · line 179 · raw

@+stk:List<&2, Fr> -> @+t:U32 -> Bool

Is the top frame at or below depth t?

def pop source · line 188 · raw

@+fuel:Nat -> @+sr:Result<&2, &2, String, St> -> @+t:U32 -> @+strict:Bool -> Result<&2, &2, String, St>

Close every frame whose child depth is at least t. fuel is the stack height, enough for every frame to close.

def arr.depth.if source · line 199 · raw

@+empty:Bool -> @+d:U32 -> U32

def arr.depth source · line 206 · raw

@+f:Fr -> U32

def arr.min source · line 216 · raw

@+stk:List<&2, Fr> -> U32

Shallowest array frame that already has an item or row.

def blank.note source · line 224 · raw

@+st:St -> St

A blank line: remember the shallowest array it falls inside.

def blank.if source · line 229 · raw

@+bad:Bool -> @+st:St -> Result<&2, &2, String, St>

def blank.check source · line 240 · raw

@+st:St -> @+d:U32 -> @+strict:Bool -> Result<&2, &2, String, St>

A content line at depth d after a blank: it is inside the array when the array's child depth is at most d.