env.allocate_vtable_names(self.entry)
def analyse_expressions(self, env):
+ scope = self.entry.type.scope
if self.body:
- self.body.analyse_expressions(env)
+ self.body.analyse_expressions(scope)
def generate_function_definitions(self, env, code):
if self.body:
if level in ('c_class', 'c_class_pxd'):
if s.sy == 'pass':
return p_pass_statement(s, with_newline = 1)
- else:
- s.error("Executable statement not allowed here")
if s.sy == 'if':
return p_if_statement(s)
elif s.sy == 'while':
if name in ('__eq__', '__ne__', '__lt__', '__gt__', '__le__', '__ge__'):
error(pos, "Special method %s must be implemented via __richcmp__"
% name)
- entry = self.declare(name, name, py_object_type, pos)
+ entry = self.declare_var(name, py_object_type, pos)
special_sig = get_special_method_signature(name)
if special_sig:
# Special methods get put in the method table with a particular