Commit 8649fe6a authored by Robert Bradshaw's avatar Robert Bradshaw

Fix bug in cdef locals

parent 10849f5c
...@@ -772,10 +772,13 @@ class CVarDefNode(StatNode): ...@@ -772,10 +772,13 @@ class CVarDefNode(StatNode):
# api boolean # api boolean
# need_properties [entry] # need_properties [entry]
# decorators [cython.locals(...)] or None
# directive_locals { string : NameNode } locals defined by cython.locals(...) # directive_locals { string : NameNode } locals defined by cython.locals(...)
child_attrs = ["base_type", "declarators"] child_attrs = ["base_type", "declarators"]
need_properties = () need_properties = ()
decorators = None
directive_locals = {} directive_locals = {}
def analyse_declarations(self, env, dest_scope = None): def analyse_declarations(self, env, dest_scope = None):
......
...@@ -1479,7 +1479,7 @@ def p_IF_statement(s, ctx): ...@@ -1479,7 +1479,7 @@ def p_IF_statement(s, ctx):
def p_statement(s, ctx, first_statement = 0): def p_statement(s, ctx, first_statement = 0):
cdef_flag = ctx.cdef_flag cdef_flag = ctx.cdef_flag
decorators = [] decorators = None
if s.sy == 'ctypedef': if s.sy == 'ctypedef':
if ctx.level not in ('module', 'module_pxd'): if ctx.level not in ('module', 'module_pxd'):
s.error("ctypedef statement not allowed here") s.error("ctypedef statement not allowed here")
......
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