mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 13:03:31 +00:00
Resolve TODO about macro 2.0 def
This commit is contained in:
parent
73c6bc4dbd
commit
2a5ab9f5dd
2 changed files with 8 additions and 14 deletions
|
@ -2537,17 +2537,15 @@ impl MetaItem {
|
||||||
pub fn attr_input(&self) -> Option<AttrInput> { support::child(&self.syntax) }
|
pub fn attr_input(&self) -> Option<AttrInput> { support::child(&self.syntax) }
|
||||||
pub fn nested_meta_items(&self) -> AstChildren<MetaItem> { support::children(&self.syntax) }
|
pub fn nested_meta_items(&self) -> AstChildren<MetaItem> { support::children(&self.syntax) }
|
||||||
}
|
}
|
||||||
/// Macro definition.
|
/// Macro 2.0 definition.
|
||||||
///
|
/// Their syntax is still WIP by rustc team...
|
||||||
/// ```
|
/// ```
|
||||||
/// ❰
|
/// ❰
|
||||||
/// macro_rules! foo {
|
/// macro foo { }
|
||||||
/// ($bar:tt) => {$bar}
|
|
||||||
/// }
|
|
||||||
/// ❱
|
/// ❱
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// [Reference](https://doc.rust-lang.org/reference/macros-by-example.html)
|
/// [RFC](https://github.com/rust-lang/rfcs/blob/master/text/1584-macros.md)
|
||||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||||
pub struct MacroDef {
|
pub struct MacroDef {
|
||||||
pub(crate) syntax: SyntaxNode,
|
pub(crate) syntax: SyntaxNode,
|
||||||
|
|
|
@ -2049,19 +2049,15 @@ pub(crate) const AST_SRC: AstSrc = AstSrc {
|
||||||
Path, T![=], AttrInput, nested_meta_items: [MetaItem]
|
Path, T![=], AttrInput, nested_meta_items: [MetaItem]
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: is this a special case of `MacroCall` where `Name` = `macro_rules`?
|
/// Macro 2.0 definition.
|
||||||
// It doesn't seem this ast node is used anywhere
|
/// Their syntax is still WIP by rustc team...
|
||||||
/// Macro definition.
|
|
||||||
///
|
|
||||||
/// ```
|
/// ```
|
||||||
/// ❰
|
/// ❰
|
||||||
/// macro_rules! foo {
|
/// macro foo { }
|
||||||
/// ($bar:tt) => {$bar}
|
|
||||||
/// }
|
|
||||||
/// ❱
|
/// ❱
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// [Reference](https://doc.rust-lang.org/reference/macros-by-example.html)
|
/// [RFC](https://github.com/rust-lang/rfcs/blob/master/text/1584-macros.md)
|
||||||
struct MacroDef {
|
struct MacroDef {
|
||||||
Name, TokenTree
|
Name, TokenTree
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue