Rust: separate attribute macro and macro call expansions

This commit is contained in:
Paolo Tranquilli
2025-04-29 16:18:40 +02:00
parent 2d32c366d8
commit a7a887c828
90 changed files with 442 additions and 244 deletions

View File

@@ -1164,7 +1164,7 @@ class _:
"""
@annotate(Item)
@annotate(Item, add_bases=(Addressable,))
class _:
"""
A Item. For example:
@@ -1172,6 +1172,7 @@ class _:
todo!()
```
"""
attribute_macro_expansion: optional[MacroItems] | child | rust.detach
@annotate(ItemList)
@@ -1232,6 +1233,7 @@ class _:
todo!()
```
"""
macro_call_expansion: optional[AstNode] | child | rust.detach
@annotate(MacroDef)
@@ -1258,10 +1260,18 @@ class _:
@rust.doc_test_signature(None)
class _:
"""
A sequence of items generated by a `MacroCall`. For example:
A sequence of items generated by a macro. For example:
```rust
mod foo{
include!("common_definitions.rs");
#[an_attribute_macro]
fn foo() {
println!("Hello, world!");
}
#[derive(Debug)]
struct Bar;
}
```
"""
@@ -1940,8 +1950,3 @@ class FormatArgument(Locatable):
"""
parent: Format
variable: optional[FormatTemplateVariableAccess] | child
@annotate(Item, add_bases=(Addressable,))
class _:
expanded: optional[AstNode] | child | rust.detach | doc("expanded attribute or procedural macro call of this item")