From edf0b4c1528407d5077220191e601ac41f790b99 Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Sat, 2 May 2020 10:16:26 +0800 Subject: Test whether it is bang macro properly --- crates/ra_syntax/src/ast/extensions.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'crates/ra_syntax/src/ast') diff --git a/crates/ra_syntax/src/ast/extensions.rs b/crates/ra_syntax/src/ast/extensions.rs index f2ea5088e..d68f1029f 100644 --- a/crates/ra_syntax/src/ast/extensions.rs +++ b/crates/ra_syntax/src/ast/extensions.rs @@ -423,6 +423,10 @@ impl ast::MacroCall { None } } + + pub fn is_bang(&self) -> bool { + self.is_macro_rules().is_none() + } } impl ast::LifetimeParam { -- cgit v1.2.3