def key.removed
yaml-for-bend@0.1.1.0 · scan.bend:476
import yaml-for-bend@0.1.1.0/scan.bend as Scan
import Base
import yaml-for-bend@0.1.1.0/token.bend as T
476def key.removed(keys: List<&2, SKey>) -> Result<&2, &2, T.Error, List<&2, SKey>>:
477 match keys:
478 case Nil{}:
479 Done{[]}
480 case Con{k, +rest}:
481 match k:
482 case SKey{+possible, +required, number, +at, tab, low}:
483 when(Result<&2, &2, T.Error, List<&2, SKey>>, Bool.and(possible, required),
484 u => Fail{T.Error{"could not find expected ':' while scanning a simple key", at, T.Syntax{}}},
485 u => Done{SKey{False{}, required, number, at, tab, low.of(rest)} <> rest})