diff --git a/lib/Projectrans/Phase2Translator.py b/lib/Projectrans/Phase2Translator.py index 2b5e6f2..f557709 100644 --- a/lib/Projectrans/Phase2Translator.py +++ b/lib/Projectrans/Phase2Translator.py @@ -2398,7 +2398,13 @@ class Phase2Translator: # 共享集合可能因 sig_files 过滤而缺少 include 模块的 extern 声明; # 这里从本 translator 的 sig_files 合并补全(跨模块 extern 必须裸名)。 _combined_extern: dict[str, str] = dict(self._shared_export_extern_funcs) - for _sha1_key, _sig_path in self.sig_files.items(): + _sig_paths: list[tuple[str, str]] = list(self.sig_files.items()) + _temp_vpi_dir: str = getattr(self, 'temp_dir', '') or '' + if _temp_vpi_dir and os.path.isdir(_temp_vpi_dir): + for _fn in os.listdir(_temp_vpi_dir): + if _fn.endswith('.vpi'): + _sig_paths.append((_fn[:-4], os.path.join(_temp_vpi_dir, _fn))) + for _sha1_key, _sig_path in _sig_paths: try: _, _sig_tree = parse_python_file(_sig_path) if _sig_tree is None: