| 103 | # Top-level structures |
| 104 | |
| 105 | def visit_mypy_file(self, o: mypy.nodes.MypyFile) -> str: |
| 106 | # Skip implicit definitions. |
| 107 | a: list[Any] = [o.defs] |
| 108 | if o.is_bom: |
| 109 | a.insert(0, "BOM") |
| 110 | # Omit path to special file with name "main". This is used to simplify |
| 111 | # test case descriptions; the file "main" is used by default in many |
| 112 | # test cases. |
| 113 | if o.path != "main": |
| 114 | # Insert path. Normalize directory separators to / to unify test |
| 115 | # case# output in all platforms. |
| 116 | a.insert(0, o.path.replace(os.getcwd() + os.sep, "").replace(os.sep, "/")) |
| 117 | if o.ignored_lines: |
| 118 | a.append("IgnoredLines(%s)" % ", ".join(str(line) for line in sorted(o.ignored_lines))) |
| 119 | return self.dump(a, o) |
| 120 | |
| 121 | def visit_import(self, o: mypy.nodes.Import) -> str: |
| 122 | a = [] |