Rust: fix duplicate asm! expressions

This commit is contained in:
Paolo Tranquilli
2025-08-19 14:01:25 +02:00
parent d38459a50a
commit 49bf48eda1
30 changed files with 163 additions and 140 deletions

View File

@@ -1404,17 +1404,25 @@ class _:
"""
@annotate(MacroBlockExpr, replace_bases={AstNode: Expr}, cfg=True)
@rust.doc_test_signature(None)
class _:
class MacroBlockExpr(Expr):
"""
A sequence of statements generated by a `MacroCall`. For example:
```rust
fn main() {
println!("Hello, world!"); // This macro expands into a list of statements
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)