def text_lines_go
near-v-framework@0.4.0.0 · domain/architecture/system/deployment/nix_darwin/setting/ops.bend:306
import near-v-framework@0.4.0.0/domain/architecture/system/deployment/nix_darwin/setting/ops.bend as Ops
import Base
306
307def text_lines_go(s: String, +cur: List<&2, Char>, +acc: List<&2, String>) -> List<&2, String>:
308 match s:
309 case SNil{}:
310 List.reverse(&2, String, String.from_list(List.reverse(&2, Char, cur)) <> acc)
311 case SCon{+h, t}:
312 +nl = Char.is_eq(h, '\n')
313 text_lines_go(t, Bool.pick(List<&2, Char>, nl, [], h <> cur), Bool.pick(List<&2, String>, nl, String.from_list(List.reverse(&2, Char, cur)) <> acc, acc))