Collect the entries of a block starting at ``start_idx``. Returns the entry lines as raw strings (each looks like ``X ( ... )`` or ``XVEC ( ... )``). Stops at the first non-entry, non-empty line.
(lines: List[str], start_idx: int)
| 127 | |
| 128 | |
| 129 | def _parse_block_body(lines: List[str], start_idx: int) -> List[str]: |
| 130 | """Collect the entries of a block starting at ``start_idx``. Returns |
| 131 | the entry lines as raw strings (each looks like ``X ( ... )`` or |
| 132 | ``XVEC ( ... )``). Stops at the first non-entry, non-empty line.""" |
| 133 | out: List[str] = [] |
| 134 | i = start_idx |
| 135 | while i < len(lines): |
| 136 | line = lines[i] |
| 137 | stripped = line.strip() |
| 138 | if not stripped: |
| 139 | break |
| 140 | if _BODY_ENTRY_RE.match(stripped): |
| 141 | out.append(stripped.rstrip("\\").rstrip()) |
| 142 | i += 1 |
| 143 | continue |
| 144 | break |
| 145 | return out |
| 146 | |
| 147 | |
| 148 | def _split_csv(tup: str) -> List[str]: |
no outgoing calls