]> git.proxmox.com Git - rustc.git/blobdiff - src/librustc_ast/token.rs
New upstream version 1.44.1+dfsg1
[rustc.git] / src / librustc_ast / token.rs
index 92382c7e30d578ac368647b5ef7cdaf14b7abed1..be5d322ba1677dd4d984367ff430601babe40ec5 100644 (file)
@@ -544,6 +544,16 @@ impl Token {
         false
     }
 
+    // Is the token an interpolated block (`$b:block`)?
+    pub fn is_whole_block(&self) -> bool {
+        if let Interpolated(ref nt) = self.kind {
+            if let NtBlock(..) = **nt {
+                return true;
+            }
+        }
+        false
+    }
+
     /// Returns `true` if the token is either the `mut` or `const` keyword.
     pub fn is_mutability(&self) -> bool {
         self.is_keyword(kw::Mut) || self.is_keyword(kw::Const)