def generate_includes(self, env, cimported_modules, code):
includes = []
- for module in cimported_modules:
- for filename in module.include_files:
- if filename not in includes:
- includes.append(filename)
for filename in env.include_files:
- if filename not in includes:
- includes.append(filename)
- for filename in includes:
code.putln('#include "%s"' % filename)
def generate_filename_table(self, code):
if self.module is None:
self.module = ModuleScope(self.module_name, None, env.context)
self.module.has_extern_class = 1
- env.cimported_modules.append(self.module)
+ env.add_imported_module(self.module)
if self.base_class_name:
if self.base_class_module:
def add_imported_module(self, scope):
if scope not in self.cimported_modules:
self.cimported_modules.append(scope)
+ for m in scope.cimported_modules:
+ self.add_imported_module(m)
+ for filename in scope.include_files:
+ self.add_include_file(filename)
def add_imported_entry(self, name, entry, pos):
if entry not in self.entries:
else:
entry = self.declare_var(name, py_object_type, pos)
entry.as_module = scope
- self.cimported_modules.append(scope)
+ self.add_imported_module(scope)
return entry
def declare_var(self, name, type, pos,