def Text.drop_ows.go

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

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

2766# `head` followed by `tail`, without the optional whitespace at its start:
2767# `ows` says whether `head` is optional whitespace.
2768def Text.drop_ows.go(tail: String, head: Char, ows: Bool) -> String:
2769  match tail ows:
2770    case SNil{} False{}:
2771      SCon{head, SNil{}}
2772    case SCon{next, rest} False{}:
2773      SCon{head, SCon{next, rest}}
2774    case SNil{} True{}:
2775      SNil{}
2776    case SCon{+next, rest} True{}:
2777      Text.drop_ows.go(rest, next, StateChar.is_ows(next))

Uses (4)

Used by (1)