def fetch.next

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

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

1481def fetch.next(+st: Sc) -> Step:
1482  +s = sc.s(st)
1483  +c = peek(s, 0n)
1484  +col0 = Nat.is_eq(sc.col(st), 0n)
1485  when(Step, String.is_empty(s), u => stream.end(st),
1486    u => when(Step, Bool.and(col0, Char.is_eq(c, '%')), u => directive(st),
1487      u => when(Step, Bool.and(col0, marker(s, '-')), u => doc.indicator(st, T.DocStart{}),
1488        u => when(Step, Bool.and(col0, marker(s, '.')), u => doc.indicator(st, T.DocEnd{}),
1489          u => fetch.char(c, peek(s, 1n), sc.in_flow(st), st)))))

Uses (18)

Used by (1)