def Value.restore.go
import bend-trace-context@0.2.0.0/trace_context.bend as TraceContextimport Base
2099# The restoring loop: one character at a time, with the state (whether a
2100# character was kept yet, the value so far).
2101def Value.restore.go(text: String, state: Bool & String) -> String:
2102 match text:
2103 case SNil{}:
2104 (kept, value) = state
2105 value
2106 case SCon{+char, tail}:
2107 (kept, value) = state
2108 Value.restore.go(tail, Value.restore.step(kept, StateChar.is_ows(char), char, value))