From d6ca26d6c368a86f98305589908a5ac1dcb8a713 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sat, 5 Mar 2011 22:12:44 -0500 Subject: [PATCH] Normalize WTK_declare_c_class -> declare_c_class. --- Cython/Compiler/Nodes.py | 7 ++++--- Cython/Compiler/ParseTreeTransforms.py | 6 ++++-- Cython/Compiler/Symtab.py | 13 +------------ 3 files changed, 9 insertions(+), 17 deletions(-) diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index 91fac61b..0410ceef 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -3276,7 +3276,7 @@ class CClassDefNode(ClassDefNode): binding = Binding() binding.pull(self) binding.name = self.class_name - self.entry = home_scope.WTK_declare_c_class( + self.entry = home_scope.declare_c_class( binding, objstruct_cname = self.objstruct_name, base_type = self.base_type, @@ -5284,8 +5284,9 @@ class FromCImportStatNode(StatNode): entry = module_scope.declare_struct_or_union( binding, kind = kind, scope = None, pos = pos) elif kind == 'class': - entry = module_scope.declare_c_class(name, pos = pos, - module_name = self.module_name) + binding = Binding(name = name) + entry = module_scope.declare_c_class( + binding, module_name = self.module_name, pos = pos) else: submodule_scope = env.context.find_module(name, relative_to = module_scope, pos = self.pos) if submodule_scope.parent_module is module_scope: diff --git a/Cython/Compiler/ParseTreeTransforms.py b/Cython/Compiler/ParseTreeTransforms.py index 5886c8d6..57ce935c 100644 --- a/Cython/Compiler/ParseTreeTransforms.py +++ b/Cython/Compiler/ParseTreeTransforms.py @@ -6,6 +6,7 @@ cython.declare(PyrexTypes=object, Naming=object, ExprNodes=object, Nodes=object, TemplateTransform=object, EncodedString=object, error=object, warning=object, copy=object) +from Binding import Binding import PyrexTypes import Naming import ExprNodes @@ -1485,8 +1486,9 @@ class CreateClosureClasses(CythonTransform): as_name = '%s_%s' % (target_module_scope.next_id(Naming.closure_class_prefix), node.entry.cname) - entry = target_module_scope.declare_c_class(name = as_name, - pos = node.pos, defining = True, implementing = True) + binding = Binding(name = as_name) + entry = target_module_scope.declare_c_class( + binding, defining = True, implementing = True, pos = node.pos) func_scope.scope_class = entry class_scope = entry.type.scope class_scope.is_internal = True diff --git a/Cython/Compiler/Symtab.py b/Cython/Compiler/Symtab.py index 9843dc50..8cb8dae6 100644 --- a/Cython/Compiler/Symtab.py +++ b/Cython/Compiler/Symtab.py @@ -1136,18 +1136,7 @@ class ModuleScope(Scope): if new_code is not None: self.utility_code_list.append(new_code) - def declare_c_class(self, name, pos, defining = 0, implementing = 0, - module_name = None, base_type = None, objstruct_cname = None, - typeobj_cname = None, visibility = 'private', typedef_flag = 0, api = 0, - buffer_defaults = None, shadow = 0): - binding = self._WTK_setup(name, objstruct_cname, visibility) - binding.api = api - return self.WTK_declare_c_class( - binding, objstruct_cname, None, base_type, defining, implementing, - module_name, typeobj_cname, typedef_flag, buffer_defaults, shadow, - pos) - - def WTK_declare_c_class( + def declare_c_class( self, binding, objstruct_cname = None, type=None, base_type=None, defining = 0, implementing = 0, module_name = None, typeobj_cname = None, typedef_flag = 0, buffer_defaults = None, -- 2.26.2