def Value.restore.step
import bend-trace-context@0.2.0.0/trace_context.bend as TraceContextimport Base
2085# A value's characters arrive most recent first. Restoring them skips optional
2086# whitespace until the first other character, then keeps every character, so
2087# the value comes back in reading order without its trailing whitespace.
2088def Value.restore.step(kept: Bool, ows: Bool, char: Char, value: String) -> Bool & String:
2089 match kept:
2090 case True{}:
2091 (True{}, SCon{char, value})
2092 case False{}:
2093 match ows:
2094 case True{}:
2095 (False{}, value)
2096 case False{}:
2097 (True{}, SCon{char, value})