def anchor.took

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

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

1136def anchor.took(t: Taken, +st: Sc, +is_anchor: Bool, +at: T.Mark) -> Step:
1137  match t:
1138    case Taken{+name, +n}:
1139      when(Step, String.is_empty(name),
1140        u => fail(st, Bool.pick(String, is_anchor, "did not find expected alphabetic or numeric character while scanning an anchor",
1141          "did not find expected alphabetic or numeric character while scanning an alias"), at),
1142        u => Go{emit(skip(st, 1n+n), Bool.pick(T.Tok, is_anchor, T.AnchorTok{name}, T.AliasTok{name}), at)})

Uses (14)

Used by (1)