From: Stefan Behnel Date: Fri, 17 Apr 2009 07:04:33 +0000 (+0200) Subject: merge X-Git-Tag: 0.12.alpha0~316 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=dae305549e895d6a34749f3ed86e6eed939a9228;p=cython.git merge --- dae305549e895d6a34749f3ed86e6eed939a9228 diff --cc Cython/Compiler/Nodes.py index 89c0b3a3,2b5cef25..927c0eb1 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@@ -883,21 -904,25 +883,22 @@@ class CEnumDefNode(StatNode) for item in self.items: item.analyse_declarations(env, self.entry) - def analyse_expressions(self, env): - if self.visibility == 'public': - self.temp = env.allocate_temp_pyobject() - env.release_temp(self.temp) - def generate_execution_code(self, code): if self.visibility == 'public': + temp = code.funcstate.allocate_temp(PyrexTypes.py_object_type, manage_ref=True) for item in self.entry.enum_values: code.putln("%s = PyInt_FromLong(%s); %s" % ( - self.temp, + temp, item.cname, - code.error_goto_if_null(self.temp, item.pos))) - code.put_gotref(self.temp) + code.error_goto_if_null(temp, item.pos))) ++ code.put_gotref(temp) code.putln('if (__Pyx_SetAttrString(%s, "%s", %s) < 0) %s' % ( Naming.module_cname, item.name, - self.temp, + temp, code.error_goto(item.pos))) - code.putln("%s = 0;" % temp) - code.put_decref_clear(self.temp, PyrexTypes.py_object_type) ++ code.put_decref_clear(temp, PyrexTypes.py_object_type) + code.funcstate.release_temp(temp) class CEnumDefItemNode(StatNode): @@@ -2705,6 -2747,11 +2704,7 @@@ class PropertyNode(StatNode) def analyse_declarations(self, env): entry = env.declare_property(self.name, self.doc, self.pos) if entry: - if self.doc and Options.docstrings: - doc_entry = env.get_string_const( - self.doc, identifier = False) - entry.doc_cname = doc_entry.cname + entry.scope.directives = env.directives self.body.analyse_declarations(entry.scope) def analyse_expressions(self, env): diff --cc Cython/Compiler/Symtab.py index 0b6bfcbb,ff6db3b1..65936204 --- a/Cython/Compiler/Symtab.py +++ b/Cython/Compiler/Symtab.py @@@ -208,8 -211,9 +208,7 @@@ class Scope(object) scope_prefix = "" in_cinclude = 0 nogil = 0 - directives = {} - temp_prefix = Naming.pyrex_prefix - def __init__(self, name, outer_scope, parent_scope): # The outer_scope is the next scope in the lookup chain. # The parent_scope is used to derive the qualified name of this scope.