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