def key

yaml-for-bend@0.1.1.0 · scan.bend:1381

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

1381# "? ": an explicit key.
1382def key(+st: Sc) -> Step:
1383  when(Step, sc.in_flow(st), u => key.rest(st),
1384    u => when(Step, sc.tab(st), u => fail(st, "found a tab character that violates indentation", sc.at(st)),
1385    u => when(Step, sc.allowed(st), u => key.rest(roll(st, sc.col(st), None{}, T.BMapStart{}, sc.at(st))),
1386      u => fail(st, "mapping keys are not allowed in this context", sc.at(st)))))

Uses (13)

Used by (1)