def version.minor
yaml-for-bend@0.1.1.0 · scan.bend:1281
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
1281def version.minor(m: Taken, +st: Sc, +b: Nat, +at: T.Mark) -> Step:
1282 match m:
1283 case Taken{+major, +k}:
1284 +rest = String.drop(sc.s(st), Nat.add(b, k))
1285 +minor = digits(String.drop(rest, 1n))
1286 when(Step, Nat.is_eq(b, 0n), u => fail(st, "did not find expected whitespace while scanning a %YAML directive", at),
1287 u => when(Step, Bool.or(Nat.is_eq(k, 0n), Bool.not(Char.is_eq(peek(rest, 0n), '.'))),
1288 u => fail(st, "did not find expected digit or '.' character while scanning a %YAML directive", at),
1289 u => version.done(minor, st, major, Nat.add(b, Nat.add(k, 1n)), at)))