Skip to content

Commit

Permalink
feat(header): export __hyper__tm! macro so test modules work with hea…
Browse files Browse the repository at this point in the history
…der!
  • Loading branch information
seanmonstar committed May 12, 2015
1 parent 085d7b0 commit f64fb10
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/header/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ macro_rules! deref(
}
);

macro_rules! tm {
#[macro_export]
macro_rules! __hyper__tm {
($id:ident, $tm:ident{$($tf:item)*}) => {
#[allow(unused_imports)]
mod $tm{
Expand Down Expand Up @@ -285,31 +286,31 @@ macro_rules! header {
($id, $n) => ($item)*
}

tm! { $id, $tm { $($tf)* }}
__hyper__tm! { $id, $tm { $($tf)* }}
};
($(#[$a:meta])*($id:ident, $n:expr) => ($item:ty)+ $tm:ident{$($tf:item)*}) => {
header! {
$(#[$a])*
($id, $n) => ($item)+
}

tm! { $id, $tm { $($tf)* }}
__hyper__tm! { $id, $tm { $($tf)* }}
};
($(#[$a:meta])*($id:ident, $n:expr) => [$item:ty] $tm:ident{$($tf:item)*}) => {
header! {
$(#[$a])*
($id, $n) => [$item]
}

tm! { $id, $tm { $($tf)* }}
__hyper__tm! { $id, $tm { $($tf)* }}
};
($(#[$a:meta])*($id:ident, $n:expr) => {Any / ($item:ty)+} $tm:ident{$($tf:item)*}) => {
header! {
$(#[$a])*
($id, $n) => {Any / ($item)+}
}

tm! { $id, $tm { $($tf)* }}
__hyper__tm! { $id, $tm { $($tf)* }}
};
}

Expand Down

0 comments on commit f64fb10

Please sign in to comment.