Move to upstream macro_rules! model

This commit is contained in:
Jonas Schievink 2020-12-15 15:37:37 +01:00
parent 39aae835fd
commit c1cb595382
36 changed files with 325 additions and 275 deletions

View file

@ -76,7 +76,7 @@ pub fn type_label(node: &ast::TypeAlias) -> String {
label.trim().to_owned()
}
pub fn macro_label(node: &ast::MacroCall) -> String {
pub fn macro_label(node: &ast::MacroRules) -> String {
let name = node.name().map(|name| name.syntax().text().to_string()).unwrap_or_default();
let vis = if node.has_atom_attr("macro_export") { "#[macro_export]\n" } else { "" };
format!("{}macro_rules! {}", vis, name)