summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorFelix S. Klock II <pnkfelix@pnkfx.org>2013-05-06 19:05:36 +0200
committerFelix S. Klock II <pnkfelix@pnkfx.org>2013-05-06 19:05:36 +0200
commit1cbf0a84dc9d12d4c15379537a51ad75fcb1bdcf (patch)
tree349872cf07ad006fb56754af8a77557d2743c4d3 /src/libsyntax
parent6e6a4be19d8e6a2cedc66be6cc602db8a1e71acd (diff)
downloadrust-1cbf0a84dc9d12d4c15379537a51ad75fcb1bdcf.tar.gz
rust-1cbf0a84dc9d12d4c15379537a51ad75fcb1bdcf.zip
Step one for 'proper' pub condition: support pub keyword in form.
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ext/expand.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs
index 02721a02fbd..b1267ee7578 100644
--- a/src/libsyntax/ext/expand.rs
+++ b/src/libsyntax/ext/expand.rs
@@ -485,8 +485,23 @@ pub fn core_macros() -> ~str {
 
     macro_rules! condition (
 
+        { pub $c:ident: $in:ty -> $out:ty; } => {
+
+            pub mod $c {
+                fn key(_x: @::core::condition::Handler<$in,$out>) { }
+
+                pub static cond :
+                    ::core::condition::Condition<'static,$in,$out> =
+                    ::core::condition::Condition {
+                        name: stringify!($c),
+                        key: key
+                    };
+            }
+        };
+
         { $c:ident: $in:ty -> $out:ty; } => {
 
+            // FIXME (#6009): remove mod's `pub` below once variant above lands.
             pub mod $c {
                 fn key(_x: @::core::condition::Handler<$in,$out>) { }