def attach.top

bend-toon-codec@0.1.0.0 · src/frame.bend:139

import bend-toon-codec@0.1.0.0/src/frame.bend as Frame
import Base
import bend-toon-codec@0.1.0.0/src/json.bend as J

139# Attach a finished value to the frame beneath, or make it the root.
140def attach.top(+top: Fr, +att: Att, +v: J.Json, +rest: List<&2, Fr>, +root: Maybe<&2, J.Json>, +strict: Bool, +bmin: U32) -> Result<&2, &2, String, St>:
141  match top att:
142    case FObj{d, a, fs} AKey{k}:
143      put.field(strict, d, a, fs, k, v, rest, root, bmin)
144    case FLst{d, a, n, c, xs} AItem{}:
145      Done{St{Con{FLst{d, a, n, c, J.JCons{v, xs}}, rest}, root, bmin}}
146    case _ _:
147      Fail{"misplaced value"}

Uses (11)

Used by (1)