def tag_err

bend-schema-lib@0.4.1.0 · core.bend:825

import bend-schema-lib@0.4.1.0/core.bend as Core
import Base

825# At the end of a tagged chain no case matched: the value is not an object,
826# or its tag is missing, or it names no case.
827def tag_err(+k: String, r: Raw) -> Maybe<&2, Err>:
828  match r:
829    case REnd{}:
830      Some{Err{AtKey{k} <> Nil{}, Missing{}}}
831    case RKey{j, v, o}:
832      Some{Err{AtKey{k} <> Nil{}, missing_or(lookup(k, RKey{j, v, o}), NotOneOf{})}}
833    case x:
834      here(missing_or(x, NotObject{}))

Uses (10)

Used by (1)