Commit 9e0bcda8 authored by gsamain's avatar gsamain

Cypclass Cyobject base added after type analysis

parent ec9d4af3
...@@ -1485,15 +1485,6 @@ class CppClassNode(CStructOrUnionDefNode, BlockNode): ...@@ -1485,15 +1485,6 @@ class CppClassNode(CStructOrUnionDefNode, BlockNode):
base_classes=[], visibility=self.visibility, templates=template_types, cypclass=self.cypclass) base_classes=[], visibility=self.visibility, templates=template_types, cypclass=self.cypclass)
def analyse_declarations(self, env): def analyse_declarations(self, env):
if self.cypclass:
cyobject_class = CSimpleBaseTypeNode(self.pos,
name = "cyobject", module_path = [],
is_basic_c_type = 0, signed = 0,
complex = 0, longness = 0,
is_self_arg = 0, templates = None
)
self.base_classes.append(cyobject_class)
if self.templates is None: if self.templates is None:
template_types = template_names = None template_types = template_names = None
else: else:
...@@ -1508,7 +1499,21 @@ class CppClassNode(CStructOrUnionDefNode, BlockNode): ...@@ -1508,7 +1499,21 @@ class CppClassNode(CStructOrUnionDefNode, BlockNode):
return True return True
else: else:
error(self.pos, "Base class '%s' not a struct or class." % base_class) error(self.pos, "Base class '%s' not a struct or class." % base_class)
base_class_types = filter(base_ok, [b.analyse(scope or env) for b in self.base_classes]) base_types_list = [b.analyse(scope or env) for b in self.base_classes]
if self.cypclass:
cyobject_base = False
for base_type in base_types_list:
cyobject_base = cyobject_base or base_type is cy_object_type or base_type.is_cyp_class
if not cyobject_base:
cyobject_class = CSimpleBaseTypeNode(self.pos,
name = "cyobject", module_path = [],
is_basic_c_type = 0, signed = 0,
complex = 0, longness = 0,
is_self_arg = 0, templates = None
)
self.base_classes.append(cyobject_class)
base_types_list.append(cyobject_class.analyse(scope or env))
base_class_types = filter(base_ok, base_types_list)
self.entry = env.declare_cpp_class( self.entry = env.declare_cpp_class(
self.name, scope, self.pos, self.name, scope, self.pos,
self.cname, base_class_types, visibility=self.visibility, templates=template_types, cypclass=self.cypclass) self.cname, base_class_types, visibility=self.visibility, templates=template_types, cypclass=self.cypclass)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment