about summary refs log tree commit diff
path: root/src/libsyntax/visit.rs
diff options
context:
space:
mode:
authorMarvin Löbel <loebel.marvin@gmail.com>2015-11-03 17:39:51 +0100
committerMarvin Löbel <loebel.marvin@gmail.com>2015-11-26 21:46:12 +0100
commit2a8f358de7ee71934b8129dff5d908730454d7b1 (patch)
tree977fde21c8fa8ce4d39aad1c6ac5c7c3b2386a93 /src/libsyntax/visit.rs
parent6ef02eff89e3d2a29eab3346bff393821df6e033 (diff)
downloadrust-2a8f358de7ee71934b8129dff5d908730454d7b1.tar.gz
rust-2a8f358de7ee71934b8129dff5d908730454d7b1.zip
Add syntax support for attributes on expressions and all syntax
nodes in statement position.

Extended #[cfg] folder to allow removal of statements, and
of expressions in optional positions like expression lists and trailing
block expressions.

Extended lint checker to recognize lint levels on expressions and
locals.
Diffstat (limited to 'src/libsyntax/visit.rs')
-rw-r--r--src/libsyntax/visit.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libsyntax/visit.rs b/src/libsyntax/visit.rs
index 5d4a462e844..2d97e2680d7 100644
--- a/src/libsyntax/visit.rs
+++ b/src/libsyntax/visit.rs
@@ -628,7 +628,12 @@ pub fn walk_stmt<'v, V: Visitor<'v>>(visitor: &mut V, statement: &'v Stmt) {
         StmtExpr(ref expression, _) | StmtSemi(ref expression, _) => {
             visitor.visit_expr(expression)
         }
-        StmtMac(ref mac, _) => visitor.visit_mac(mac),
+        StmtMac(ref mac, _, ref attrs) => {
+            visitor.visit_mac(mac);
+            for attr in attrs.as_attrs() {
+                visitor.visit_attribute(attr);
+            }
+        }
     }
 }