(self, symtab: SymbolTable)
| 114 | |
| 115 | # NOTE: This method *definitely* isn't part of the NodeVisitor API. |
| 116 | def visit_symbol_table(self, symtab: SymbolTable) -> None: |
| 117 | for key in symtab: |
| 118 | value = symtab[key] |
| 119 | cross_ref = value.cross_ref |
| 120 | # Fix up module cross-reference eagerly because it is very cheap. |
| 121 | if cross_ref is not None: |
| 122 | if cross_ref in self.modules: |
| 123 | value.cross_ref = None |
| 124 | value.unfixed = False |
| 125 | value._node = self.modules[cross_ref] |
| 126 | # TODO: this should not be needed, looks like a daemon bug. |
| 127 | elif self.allow_missing: |
| 128 | self.resolve_cross_ref(value) |
| 129 | # Look at private attribute to avoid triggering fixup eagerly. |
| 130 | elif isinstance(value._node, TypeInfo): |
| 131 | self.visit_type_info(value._node) |
| 132 | else: |
| 133 | value.stored_info = self.current_info |
| 134 | |
| 135 | def resolve_cross_ref(self, value: SymbolTableNode) -> None: |
| 136 | """Replace cross-reference with an actual referred node.""" |
no test coverage detected