Commit fdae4c23 authored by Robert Bradshaw's avatar Robert Bradshaw

Fix agreement of cpdef functions and pxd files

parent d3abf408
......@@ -351,7 +351,7 @@ class CFuncDeclaratorNode(CDeclaratorNode):
return_type, func_type_args, self.has_varargs,
exception_value = exc_val, exception_check = exc_check,
calling_convention = self.base.calling_convention,
nogil = self.nogil, with_gil = self.with_gil)
nogil = self.nogil, with_gil = self.with_gil, is_overridable = self.overridable)
return self.base.analyse(func_type, env)
......
......@@ -1300,7 +1300,7 @@ def p_statement(s, level, cdef_flag = 0, visibility = 'private', api = 0):
if level not in ('module', 'module_pxd'):
s.error("ctypedef statement not allowed here")
if api:
error(s.pos, "'api' not allowed with 'ctypedef'")
error(s.position(), "'api' not allowed with 'ctypedef'")
return p_ctypedef_statement(s, level, visibility, api)
elif s.sy == 'DEF':
return p_DEF_statement(s)
......@@ -1859,6 +1859,7 @@ def p_c_func_or_var_declaration(s, level, pos, visibility = 'private', api = 0,
modifiers = p_c_modifiers(s)
base_type = p_c_base_type(s)
declarator = p_c_declarator(s, cmethod_flag = cmethod_flag, assignable = 1, nonempty = 1)
declarator.overridable = overridable
if s.sy == ':':
if level not in ('module', 'c_class'):
s.error("C function definition not allowed here")
......@@ -1888,7 +1889,8 @@ def p_c_func_or_var_declaration(s, level, pos, visibility = 'private', api = 0,
base_type = base_type,
declarators = declarators,
in_pxd = level == 'module_pxd',
api = api)
api = api,
overridable = overridable)
return result
def p_ctypedef_statement(s, level, visibility = 'private', api = 0):
......
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