Lines Matching defs:stmt

279         if isinstance(ast_node, (ast.expr, ast.stmt, ast.excepthandler)):
429 self.assertTrue(issubclass(ast.For, ast.stmt))
431 self.assertTrue(issubclass(ast.stmt, ast.AST))
1293 def stmt(self, stmt, msg=None):
1294 mod = ast.Module([stmt], [])
1340 self.stmt(f, "empty body on FunctionDef")
1343 self.stmt(f, "must have Load context")
1346 self.stmt(f, "must have Load context")
1349 self._check_arguments(fac, self.stmt)
1363 self.stmt(cls(bases=[ast.Name("x", ast.Store())]),
1365 self.stmt(cls(keywords=[ast.keyword("x", ast.Name("x", ast.Store()))]),
1367 self.stmt(cls(body=[]), "empty body on ClassDef")
1368 self.stmt(cls(body=[None]), "None disallowed")
1369 self.stmt(cls(decorator_list=[ast.Name("x", ast.Store())]),
1373 self.stmt(ast.Delete([]), "empty targets on Delete")
1374 self.stmt(ast.Delete([None]), "None disallowed")
1375 self.stmt(ast.Delete([ast.Name("x", ast.Load())]),
1379 self.stmt(ast.Assign([], ast.Num(3)), "empty targets on Assign")
1380 self.stmt(ast.Assign([None], ast.Num(3)), "None disallowed")
1381 self.stmt(ast.Assign([ast.Name("x", ast.Load())], ast.Num(3)),
1383 self.stmt(ast.Assign([ast.Name("x", ast.Store())],
1390 self.stmt(aug, "must have Store context")
1393 self.stmt(aug, "must have Load context")
1399 self.stmt(ast.For(x, y, [], []), "empty body on For")
1400 self.stmt(ast.For(ast.Name("x", ast.Load()), y, [p], []),
1402 self.stmt(ast.For(x, ast.Name("y", ast.Store()), [p], []),
1405 self.stmt(ast.For(x, y, [e], []), "must have Load context")
1406 self.stmt(ast.For(x, y, [p], [e]), "must have Load context")
1409 self.stmt(ast.While(ast.Num(3), [], []), "empty body on While")
1410 self.stmt(ast.While(ast.Name("x", ast.Store()), [ast.Pass()], []),
1412 self.stmt(ast.While(ast.Num(3), [ast.Pass()],
1417 self.stmt(ast.If(ast.Num(3), [], []), "empty body on If")
1419 self.stmt(i, "must have Load context")
1421 self.stmt(i, "must have Load context")
1424 self.stmt(i, "must have Load context")
1428 self.stmt(ast.With([], [p]), "empty items on With")
1430 self.stmt(ast.With([i], []), "empty body on With")
1432 self.stmt(ast.With([i], [p]), "must have Load context")
1434 self.stmt(ast.With([i], [p]), "must have Store context")
1438 self.stmt(r, "Raise with cause but no exception")
1440 self.stmt(r, "must have Load context")
1442 self.stmt(r, "must have Load context")
1447 self.stmt(t, "empty body on Try")
1449 self.stmt(t, "must have Load context")
1451 self.stmt(t, "Try has neither except handlers nor finalbody")
1453 self.stmt(t, "Try has orelse but no except handlers")
1455 self.stmt(t, "empty body on ExceptHandler")
1457 self.stmt(ast.Try([p], e, [], []), "must have Load context")
1460 self.stmt(t, "must have Load context")
1462 self.stmt(t, "must have Load context")
1467 self.stmt(t, "empty body on TryStar")
1469 self.stmt(t, "must have Load context")
1471 self.stmt(t, "TryStar has neither except handlers nor finalbody")
1473 self.stmt(t, "TryStar has orelse but no except handlers")
1475 self.stmt(t, "empty body on ExceptHandler")
1477 self.stmt(ast.TryStar([p], e, [], []), "must have Load context")
1480 self.stmt(t, "must have Load context")
1482 self.stmt(t, "must have Load context")
1485 self.stmt(ast.Assert(ast.Name("x", ast.Store()), None),
1489 self.stmt(assrt, "must have Load context")
1492 self.stmt(ast.Import([]), "empty names on Import")
1496 self.stmt(imp, "Negative ImportFrom level")
1497 self.stmt(ast.ImportFrom(None, [], 0), "empty names on ImportFrom")
1500 self.stmt(ast.Global([]), "empty names on Global")
1503 self.stmt(ast.Nonlocal([]), "empty names on Nonlocal")
1507 self.stmt(e, "must have Load context")
1661 self.stmt(assign, "must have Store context")