*** empty log message ***

This commit is contained in:
Joe Shochet 2000-11-18 01:03:44 +00:00
parent f426cbc0a9
commit 82d52e4abc
2 changed files with 17 additions and 12 deletions

View File

@ -428,6 +428,7 @@ class MethodSpecification(FunctionSpecification):
argTypes = self.typeDescriptor.argumentTypes argTypes = self.typeDescriptor.argumentTypes
thislessArgTypes = self.typeDescriptor.thislessArgTypes() thislessArgTypes = self.typeDescriptor.thislessArgTypes()
self.outputTypeChecking(methodClass, thislessArgTypes, file, nesting+2) self.outputTypeChecking(methodClass, thislessArgTypes, file, nesting+2)
indent(file, nesting+2, 'upcastSelf = self\n')
for i in range(len(parentList)): for i in range(len(parentList)):
# Only output the upcast call if that parent class defines it # Only output the upcast call if that parent class defines it
parentClass = parentList[i] parentClass = parentList[i]
@ -435,10 +436,10 @@ class MethodSpecification(FunctionSpecification):
if (i != 0): if (i != 0):
childClass = parentList[i-1] childClass = parentList[i-1]
if childClass.hasMethodNamed(methodName): if childClass.hasMethodNamed(methodName):
indent(file, nesting+2, 'upcastSelf = self.' + methodName + '()\n') indent(file, nesting+2, 'upcastSelf = upcastSelf.' + methodName + '()\n')
else: else:
if methodClass.hasMethodNamed(methodName): if methodClass.hasMethodNamed(methodName):
indent(file, nesting+2, 'upcastSelf = self.' + methodName + '()\n') indent(file, nesting+2, 'upcastSelf = upcastSelf.' + methodName + '()\n')
indent(file, nesting+2, 'returnValue = ' + self.typeDescriptor.moduleName indent(file, nesting+2, 'returnValue = ' + self.typeDescriptor.moduleName
+ '.' + self.typeDescriptor.wrapperName + '(upcastSelf.this') + '.' + self.typeDescriptor.wrapperName + '(upcastSelf.this')
if (len(thislessArgTypes) > 0): if (len(thislessArgTypes) > 0):

View File

@ -228,6 +228,18 @@ class ClassTypeDescriptor(BaseTypeDescriptor):
""" """
return self.foreignTypeName + '-extensions.py' return self.foreignTypeName + '-extensions.py'
def getCModulesRecursively(self, parent):
# Now look at all the methods that we might inherit if we are at
# a multiple inheritance node and get their C modules
for parentType in parent.parentTypes:
for method in parentType.instanceMethods:
if (not (method.typeDescriptor.moduleName in self.CModules)):
self.CModules.append(method.typeDescriptor.moduleName)
for method in parentType.upcastMethods:
if (not (method.typeDescriptor.moduleName in self.CModules)):
self.CModules.append(method.typeDescriptor.moduleName)
self.getCModulesRecursively(parentType)
def getCModules(self): def getCModules(self):
""" """
Return a list of all the C modules this class references Return a list of all the C modules this class references
@ -244,16 +256,8 @@ class ClassTypeDescriptor(BaseTypeDescriptor):
if method: if method:
if (not (method.typeDescriptor.moduleName in self.CModules)): if (not (method.typeDescriptor.moduleName in self.CModules)):
self.CModules.append(method.typeDescriptor.moduleName) self.CModules.append(method.typeDescriptor.moduleName)
# Now look at all the methods that we might inherit if we are at self.getCModulesRecursively(self)
# a multiple inheritance node and get their C modules
if (len(self.parentTypes) >= 2):
for parentType in self.parentTypes:
for method in parentType.instanceMethods:
if (not (method.typeDescriptor.moduleName in self.CModules)):
self.CModules.append(method.typeDescriptor.moduleName)
for method in parentType.upcastMethods:
if (not (method.typeDescriptor.moduleName in self.CModules)):
self.CModules.append(method.typeDescriptor.moduleName)
return self.CModules return self.CModules