Split a uses list string, handling 'Foo in ''bar.pas''' syntax.
(s: str)
| 13141 | |
| 13142 | |
| 13143 | def _pascal_split_uses(s: str) -> list[str]: |
| 13144 | """Split a uses list string, handling 'Foo in ''bar.pas''' syntax.""" |
| 13145 | out = [] |
| 13146 | for chunk in s.split(","): |
| 13147 | name = re.split(r"\s+in\s+", chunk.strip(), maxsplit=1, flags=re.IGNORECASE)[0] |
| 13148 | name = name.strip().strip(";") |
| 13149 | if name and re.match(r"[A-Za-z_][\w.]*$", name): |
| 13150 | out.append(name) |
| 13151 | return out |
| 13152 | |
| 13153 | |
| 13154 | def _pascal_split_bases(s: str) -> list[str]: |
no outgoing calls
no test coverage detected