def check_compile(self, source, expected): bc = compile_ast(parse(source)) self.check_bytecode(bc, expected) return bc
def compile(self, ctx): from kermit.compiler import compile_ast from kermit.objects import W_FunctionObject w = W_FunctionObject(self.name, compile_ast(self.body)) ctx.emit(bytecode.LOAD_FUNC, ctx.register_func(w))