Return a string of source code with any tracktion namespaces removed.
(source)
| 25 | |
| 26 | |
| 27 | def remove_tracktion_namespaces(source): |
| 28 | """Return a string of source code with any tracktion namespaces removed. |
| 29 | """ |
| 30 | namespace_regex = re.compile(r"\s+namespace\s+tracktion\s*{") |
| 31 | |
| 32 | match = namespace_regex.search(source) |
| 33 | while (match is not None): |
| 34 | source = source[:match.start()] + source[match.end():] |
| 35 | end = get_curly_brace_scope_end(source, match.start() - 1) |
| 36 | if end != -1: |
| 37 | source = source[:end] + source[end + 1:] |
| 38 | match = namespace_regex.search(source) |
| 39 | continue |
| 40 | else: |
| 41 | raise ValueError("failed to find the end of the " |
| 42 | + match.group(1) + " namespace") |
| 43 | return source |
| 44 | |
| 45 | |
| 46 | def add_doxygen_group(path, group_name): |
nothing calls this directly
no test coverage detected