Exemple #1
0
 def test_assignment_statement(self):
     i = Identifier('x')
     lhs = IdentifierExpr(i)
     rhs = BooleanLiteralExpr(True)
     a = AssignmentStatement(lhs, rhs)
     self.assertIsNotNone(a)
     self.assertEqual(str(a), 'x = true;')
     self.assertEqual(a.children(), [lhs, rhs])
     self.assertDictEqual(a.names, {})
     self.assertIsNone(a.parent)
Exemple #2
0
 def visitAssignmentStatement(self, ast: AssignmentStatement):
     self.visit_child_expressions(ast, ast.children())