def plan.obj_first

cswap-bend-cli@0.1.0.0 · json.bend:149

import cswap-bend-cli@0.1.0.0/json.bend as Json
import Base
import cswap-bend-cli@0.1.0.0/json/lex.bend as Lex

149def plan.obj_first(+toks: List<&2, Lex.Tok>) -> Plan:
150  match toks:
151    case Nil{}:
152      PRes{Done{JNil{}}}
153    case Con{Lex.TStr{k}, Con{Lex.TColon{}, +t}}:
154      plan.field(k, t)
155    case _:
156      PRes{Fail{"expected a string key and :"}}

Uses (6)

Used by (1)