@@ -328,56 +328,6 @@ def add_implicit_module_attrs(self, file_node: MypyFile) -> None:
328
328
self .add_symbol (name , PlaceholderNode (self .qualified_name (name ), file_node ), None )
329
329
self .defer ()
330
330
331
- def visit_file (self , file_node : MypyFile , fnam : str , options : Options ,
332
- patches : List [Tuple [int , Callable [[], None ]]]) -> None :
333
- """Run semantic analysis phase 2 over a file.
334
-
335
- Add (priority, callback) pairs by mutating the 'patches' list argument. They
336
- will be called after all semantic analysis phases but before type checking,
337
- lowest priority values first.
338
- """
339
- self .recurse_into_functions = True
340
- self .options = options
341
- self .errors .set_file (fnam , file_node .fullname (), scope = self .scope )
342
- self .cur_mod_node = file_node
343
- self .cur_mod_id = file_node .fullname ()
344
- self .is_stub_file = fnam .lower ().endswith ('.pyi' )
345
- self ._is_typeshed_stub_file = self .errors .is_typeshed_file (file_node .path )
346
- self .globals = file_node .names
347
- self .patches = patches
348
- self .named_tuple_analyzer = NamedTupleAnalyzer (options , self )
349
- self .typed_dict_analyzer = TypedDictAnalyzer (options , self , self .msg )
350
- self .enum_call_analyzer = EnumCallAnalyzer (options , self )
351
- self .newtype_analyzer = NewTypeAnalyzer (options , self , self .msg )
352
-
353
- with state .strict_optional_set (options .strict_optional ):
354
- if 'builtins' in self .modules :
355
- self .globals ['__builtins__' ] = SymbolTableNode (GDEF ,
356
- self .modules ['builtins' ])
357
-
358
- defs = file_node .defs
359
- self .scope .enter_file (file_node .fullname ())
360
- for d in defs :
361
- self .accept (d )
362
- self .scope .leave ()
363
-
364
- if self .cur_mod_id == 'builtins' :
365
- remove_imported_names_from_symtable (self .globals , 'builtins' )
366
- for alias_name in type_aliases :
367
- self .globals .pop (alias_name .split ('.' )[- 1 ], None )
368
-
369
- if '__all__' in self .globals :
370
- for name , g in self .globals .items ():
371
- if name not in self .all_exports :
372
- g .module_public = False
373
-
374
- self .export_map [self .cur_mod_id ] = self .all_exports
375
- self .all_exports = []
376
- del self .options
377
- del self .patches
378
- del self .cur_mod_node
379
- del self .globals
380
-
381
331
def prepare_file (self , file_node : MypyFile ) -> None :
382
332
"""Prepare a freshly parsed file for semantic analysis."""
383
333
if 'builtins' in self .modules :
0 commit comments