Ejemplo n.º 1
0
 def test_funccall_specifies_target(self):
     h = HaxeTransformer()
     node = [
         Tree("getattr", ['super', Token("NAME", 'update')]), ['elapsed']
     ]
     output = h.funccall(node)
     self.assertEqual("super.update(elapsed)", output)
Ejemplo n.º 2
0
 def test_funccall_removes_args_in_constructor_call_to_super(self):
     h = HaxeTransformer()
     data = ['super', ['Sprite', 'self']]
     output = h.funccall(data)
     self.assertEqual("super()", output)
Ejemplo n.º 3
0
 def test_funccall_adds_new_to_constructor(self):
     h = HaxeTransformer()
     node = ['FlxGame', [0, 0, 'PlayState']]
     output = h.funccall(node)
     self.assertEqual("new FlxGame(0, 0, PlayState)", output)
Ejemplo n.º 4
0
 def test_funccall_generates_with_parameters(self):
     h = HaxeTransformer()
     output = h.funccall(
         ['copyInstance',
          Tree("arguments", ['Sprite', 'self'])])
     self.assertEqual("copyInstance(Sprite, self)", output)
Ejemplo n.º 5
0
 def test_funccall_has_brackets_when_no_parameters(self):
     h = HaxeTransformer()
     output = h.funccall(['super', Tree("arguments", [])])
     self.assertEqual("super()", output)