def split_at_blank.flag.go

bend-kit-http@0.38.2.0 · http.bend:251

import bend-kit-http@0.38.2.0/http.bend as Http
import Base

251# split_at_blank, plus whether the head ends in the blank line.
252def split_at_blank.flag.go(+raw: String, s: String, off: Nat, w: U32, e: Bool) -> String & String & Bool:
253  match s:
254    case SNil{}:
255      (String.take(raw, off), SNil{}, e)
256    case SCon{Chr{+a}, t}:
257      match e:
258        case True{}:
259          (String.take(raw, off), SCon{Chr{a}, t}, True{})
260        case False{}:
261          +w2 = (w * 256 + a : U32)
262          +off1 = (1n + off : Nat)
263          split_at_blank.flag.go(raw, t, off1, w2, U32.is_eq(w2, 218762506))

Uses (12)

Used by (2)