Add box to stmt

This commit is contained in:
Charlie Marsh
2025-12-11 11:24:31 -05:00
parent c9155d5e72
commit cc850ec348
123 changed files with 2523 additions and 2786 deletions

View File

@@ -77,6 +77,10 @@ fields = [{ name = "body", type = "Box<Expr>" }]
add_suffix_to_is_methods = true
anynode_is_label = "statement"
doc = "See also [stmt](https://docs.python.org/3/library/ast.html#ast.stmt)"
# Box all variants except the smallest ones (Pass, Break, Continue, Return, Expr)
# to reduce enum size from 128 bytes to ~24 bytes
box_variants = true
unboxed_variants = ["StmtPass", "StmtBreak", "StmtContinue", "StmtReturn", "StmtExpr"]
[Stmt.nodes.StmtFunctionDef]
doc = """See also [FunctionDef](https://docs.python.org/3/library/ast.html#ast.FunctionDef)