def atom_lines_go

bend-prot@0.1.0.0 · pdb.bend:43

import bend-prot@0.1.0.0/pdb.bend as Pdb
import Base

43# ATOM lines up to (excluding) the first ENDMDL. Decided by matching the
44# first six characters literally, so no computed Bool is ever matched.
45# Tail-recursive over lines for the same stack reason as tlines.
46def atom_lines_go(lines: List<&2, String>, acc: List<&2, String>) -> List<&2, String>:
47  match lines:
48    case Nil{}:
49      List.reverse(&2, String, acc)
50    case h <> t:
51      match h:
52        case SCon{'E', SCon{'N', SCon{'D', SCon{'M', SCon{'D', SCon{'L', _}}}}}}:
53          List.reverse(&2, String, acc)
54        case SCon{'A', SCon{'T', SCon{'O', SCon{'M', SCon{' ', SCon{' ', _}}}}}}:
55          atom_lines_go(t, h <> acc)
56        case _:
57          atom_lines_go(t, acc)

Uses (8)

Used by (1)