From 1cbf0a84dc9d12d4c15379537a51ad75fcb1bdcf Mon Sep 17 00:00:00 2001 From: "Felix S. Klock II" Date: Mon, 6 May 2013 19:05:36 +0200 Subject: Step one for 'proper' pub condition: support pub keyword in form. --- src/libsyntax/ext/expand.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/libsyntax/ext') 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>) { } -- cgit 1.4.1-3-g733a5