def array.root
import bend-toon-codec@0.1.0.0/src/decode.bend as Decodeimport Base
import bend-toon-codec@0.1.0.0/src/frame.bend as F
import bend-toon-codec@0.1.0.0/src/step.bend as T
74# The root is an array: its header started a value or an open frame.
75def array.root(+r: Result<&2, &2, String, T.Start>) -> Result<&2, &2, String, F.St>:
76 match r:
77 case Fail{e}:
78 Fail{e}
79 case Done{T.SVal{v}}:
80 init(Nil{}, Some{v})
81 case Done{T.SOpen{fr}}:
82 init(Con{fr, Nil{}}, None{})