From d6ec174e0c7c6068f9e20d95b146bf95f0bc2790 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Tue, 13 Jan 2026 10:20:47 +0100 Subject: [PATCH] Rust: Remove `MacroBlockExpr` class --- rust/ast-generator/src/main.rs | 2 -- rust/schema/annotations.py | 22 ---------------------- 2 files changed, 24 deletions(-) diff --git a/rust/ast-generator/src/main.rs b/rust/ast-generator/src/main.rs index ddacc0d913e..b1de337f3ac 100644 --- a/rust/ast-generator/src/main.rs +++ b/rust/ast-generator/src/main.rs @@ -22,7 +22,6 @@ fn class_name(type_name: &str) -> String { "Literal" => "LiteralExpr".to_owned(), "ArrayExpr" => "ArrayExprInternal".to_owned(), "AsmOptions" => "AsmOptionsList".to_owned(), - "MacroStmts" => "MacroBlockExpr".to_owned(), _ if type_name.starts_with("Record") => type_name.replacen("Record", "Struct", 1), _ if type_name.ends_with("Type") => format!("{type_name}Repr"), _ => type_name.to_owned(), @@ -36,7 +35,6 @@ fn property_name(type_name: &str, field_name: &str) -> String { ("MatchExpr", "expr") => "scrutinee", ("Variant", "expr") => "discriminant", ("FieldExpr", "expr") => "container", - ("MacroBlockExpr", "expr") => "tail_expr", (_, "name_ref") => "identifier", (_, "then_branch") => "then", (_, "else_branch") => "else_", diff --git a/rust/schema/annotations.py b/rust/schema/annotations.py index 8896e5809f2..6fb45ae05b9 100644 --- a/rust/schema/annotations.py +++ b/rust/schema/annotations.py @@ -1440,28 +1440,6 @@ class _: """ -class MacroBlockExpr(Expr): - """ - A sequence of statements generated by a `MacroCall`. For example: - ```rust - macro_rules! my_macro { - () => { - let mut x = 40; - x += 2; - x - }; - } - - my_macro!(); // this macro expands to a sequence of statements (and an expression) - ``` - """ - - __cfg__ = True - - statements: list[Stmt] | child - tail_expr: optional[Expr] | child - - @annotate(MacroTypeRepr) class _: """