type Plan
import cswap-bend-cli@0.1.0.0/json.bend as Jsonimport Base
import cswap-bend-cli@0.1.0.0/json/lex.bend as Lex
82# What one parser step decides, before it recurses: a finished result, a
83# bracketed body, two parts to parse (array item and rest, object field and
84# rest), or one more step in another mode. Splitting "decide" from "recurse"
85# keeps `val` a single self-recursive def (Bend has no mutual recursion) with
86# few arms.
87type Plan is Data:
88 PRes{r: Result<&2, &2, String, Json>}
89 PArr{t: List<&2, Lex.Tok>}
90 PObj{t: List<&2, Lex.Tok>}
91 PItems{first: List<&2, Lex.Tok>, rest: List<&2, Lex.Tok>}
92 PFields{k: String, vt: List<&2, Lex.Tok>, rest: List<&2, Lex.Tok>}
93 PNext{mode: Mode, t: List<&2, Lex.Tok>}