| 4606 | |
| 4607 | |
| 4608 | def _cpp_include_path(includes: dict[str, set[str]], start: str, target: str) -> list[str]: |
| 4609 | if not start or not target: |
| 4610 | return [] |
| 4611 | pending = [(start, [start])] |
| 4612 | visited = {start} |
| 4613 | for current, path in pending: |
| 4614 | if current == target: |
| 4615 | return path |
| 4616 | for following in sorted(includes.get(current, ())): |
| 4617 | if following not in visited: |
| 4618 | visited.add(following) |
| 4619 | pending.append((following, [*path, following])) |
| 4620 | return [] |
| 4621 | |
| 4622 | |
| 4623 | def _merge_cpp_forward_classes( |