def brk.fr

bend-kit-cbor@0.3.0.0 · cbor.bend:627

import bend-kit-cbor@0.3.0.0/cbor.bend as Cbor
import Base

627# A break closes the innermost indefinite array, or map with no key pending; anywhere else it is malformed.
628def brk.fr(fr: Frame, +i: U32, rest: List<&1, Frame>) -> St:
629  match fr:
630    case FArrI{xs}:
631      SDone{Arr{List.reverse(&1, Val, xs)}, i, rest}
632    case FMapI{kvs}:
633      SDone{Obj{List.reverse(&1, Val & Val, kvs)}, i, rest}
634    case FArr{left, xs}:
635      SFail{}
636    case FMap{left, kvs}:
637      SFail{}
638    case FKey{left, kvs, k}:
639      SFail{}
640    case FKeyI{kvs, k}:
641      SFail{}
642    case FTag{number}:
643      SFail{}

Uses (7)

Used by (1)