mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 04:53:34 +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 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 {
|
||||
/// ($bar:tt) => {$bar}
|
||||
/// }
|
||||
/// macro foo { }
|
||||
/// ❱
|
||||
/// ```
|
||||
///
|
||||
/// [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)]
|
||||
pub struct MacroDef {
|
||||
pub(crate) syntax: SyntaxNode,
|
||||
|
|
|
@ -2049,19 +2049,15 @@ pub(crate) const AST_SRC: AstSrc = AstSrc {
|
|||
Path, T![=], AttrInput, nested_meta_items: [MetaItem]
|
||||
}
|
||||
|
||||
// TODO: is this a special case of `MacroCall` where `Name` = `macro_rules`?
|
||||
// It doesn't seem this ast node is used anywhere
|
||||
/// Macro definition.
|
||||
///
|
||||
/// Macro 2.0 definition.
|
||||
/// Their syntax is still WIP by rustc team...
|
||||
/// ```
|
||||
/// ❰
|
||||
/// macro_rules! foo {
|
||||
/// ($bar:tt) => {$bar}
|
||||
/// }
|
||||
/// macro foo { }
|
||||
/// ❱
|
||||
/// ```
|
||||
///
|
||||
/// [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 {
|
||||
Name, TokenTree
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue