Esempio 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)
Esempio 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)
Esempio n. 3
0
 def illegal(self, source):
     P = parseE(source)
     self.assertRaises(InferenceError, lambda:infer(P, globals=G1))
Esempio n. 4
0
 def typing(self, source, t):
     P = parseE(source)
     self.assertEqual(str(infer(P, globals=G1)), t)
Esempio n. 5
0
 def typing(self, source, t="Void"):
     ast = parseS(source)
     result = infer(ast, context=self.tycon)
     self.assertEqual(str(result), t)
Esempio n. 6
0
 def illegal(self, source):
     ast = parseS(source)
     self.assertRaises(InferenceError,
             lambda: infer(ast, globals=prelude.__dict__))
Esempio n. 7
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)
Esempio n. 8
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))
Esempio n. 9
0
 def illegal(self, source):
     P = parseE(source)
     self.assertRaises(InferenceError, lambda: infer(P, globals=G1))
Esempio n. 10
0
 def typing(self, source, t):
     P = parseE(source)
     self.assertEqual(str(infer(P, globals=G1)), t)
Esempio n. 11
0
 def typing(self, source, t="Void"):
     ast = parseS(source)
     result = infer(ast, context=self.tycon)
     self.assertEqual(str(result), t)
Esempio n. 12
0
 def illegal(self, source):
     ast = parseS(source)
     self.assertRaises(InferenceError,
                       lambda: infer(ast, globals=prelude.__dict__))
Esempio n. 13
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)
Esempio n. 14
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))