Exemplo n.º 1
0
    def typing(self, source, t="Void"):
        from copperhead.compiler import rewrites as Front

        ast = parseS(source)
        ast = Front.closure_conversion(ast, G1)
        ast = Front.single_assignment_conversion(ast)
        ast = Front.lambda_lift(ast)
        result = infer(ast, context=self.tycon)
        self.assertEqual(str(result), t)
Exemplo n.º 2
0
    def typing(self, source, t="Void"):
        from copperhead.compiler import rewrites as Front

        ast = parseS(source)
        ast = Front.closure_conversion(ast, G1)
        ast = Front.single_assignment_conversion(ast)
        ast = Front.lambda_lift(ast)
        result = infer(ast, context=self.tycon)
        self.assertEqual(str(result), t)
Exemplo n.º 3
0
 def typing(self, source, t="Void"):
     from copperhead.compiler.rewrites import closure_conversion
     ast = parseS(source)
     ast = closure_conversion(ast, G1)
     result = infer(ast, context=self.tycon)
     self.assertEqual(str(result), t)
Exemplo n.º 4
0
 def illegal(self, source):
     from copperhead.compiler.rewrites import closure_conversion
     ast = parseS(source)
     ast = closure_conversion(ast, G1)
     self.assertRaises(InferenceError,
             lambda: infer(ast, globals=G1))
Exemplo n.º 5
0
 def typing(self, source, t="Void"):
     from copperhead.compiler.rewrites import closure_conversion
     ast = parseS(source)
     ast = closure_conversion(ast, G1)
     result = infer(ast, context=self.tycon)
     self.assertEqual(str(result), t)
Exemplo n.º 6
0
 def illegal(self, source):
     from copperhead.compiler.rewrites import closure_conversion
     ast = parseS(source)
     ast = closure_conversion(ast, G1)
     self.assertRaises(InferenceError, lambda: infer(ast, globals=G1))