def tag.suffix

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

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

1194def tag.suffix(t: Taken, +named: Bool, +word: String, +k: Nat, +st: Sc, +at: T.Mark) -> Step:
1195  match t:
1196    case Taken{+suffix, +n}:
1197      +handle = Bool.pick(String, named, "!" ++ word ++ "!", "!")
1198      +used = Nat.add(1n, Bool.pick(Nat, named, Nat.add(1n+k, n), n))
1199      when(Step, Bool.and(named, String.is_empty(suffix)),
1200        u => fail(st, "did not find expected tag URI while parsing a tag", at),
1201        u => when(Step, String.is_empty(suffix), u => tag.emit(st, "", "!", used, at), u => tag.emit(st, handle, suffix, used, at)))

Uses (15)

Used by (1)