def Scan.text

bend-trace-context@0.2.0.0 · trace_context.bend:2220

import bend-trace-context@0.2.0.0/trace_context.bend as TraceContext
import Base

2220# Read a text one character at a time, stopping at the first problem. This is
2221# a loop (a tail call), so its depth does not grow with the text.
2222def Scan.text(text: String, scan: Scan) -> Scan:
2223  match text scan:
2224    case _ Stopped{error}:
2225      Stopped{error}
2226    case SNil{} Scanning{member, room, current, entries}:
2227      Scanning{member, room, current, entries}
2228    case SCon{char, tail} Scanning{member, room, current, entries}:
2229      Scan.text(tail, Scan.char(char, Scanning{member, room, current, entries}))

Uses (3)

Used by (2)