diff options
author | Aleksey Kladov <[email protected]> | 2019-01-31 10:49:57 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-01-31 20:23:30 +0000 |
commit | 09a8d753512ac878224455a148ad66d0f14a20da (patch) | |
tree | f38784e9410f19c4c12f7a9df2779292750cc9eb /crates/ra_macros | |
parent | 2d88207853a38fa3f73c03ef1f9d5a1b8ce9924a (diff) |
expand boilerplate
Diffstat (limited to 'crates/ra_macros')
-rw-r--r-- | crates/ra_macros/src/lib.rs | 1 | ||||
-rw-r--r-- | crates/ra_macros/src/mbe.rs | 5 | ||||
-rw-r--r-- | crates/ra_macros/src/mbe_expander.rs | 5 |
3 files changed, 10 insertions, 1 deletions
diff --git a/crates/ra_macros/src/lib.rs b/crates/ra_macros/src/lib.rs index 8c284fa71..9485b1c3d 100644 --- a/crates/ra_macros/src/lib.rs +++ b/crates/ra_macros/src/lib.rs | |||
@@ -13,3 +13,4 @@ macro_rules! impl_froms { | |||
13 | pub mod tt; | 13 | pub mod tt; |
14 | pub mod mbe; | 14 | pub mod mbe; |
15 | mod mbe_parser; | 15 | mod mbe_parser; |
16 | mod mbe_expander; | ||
diff --git a/crates/ra_macros/src/mbe.rs b/crates/ra_macros/src/mbe.rs index 72d6707aa..ec811c5f0 100644 --- a/crates/ra_macros/src/mbe.rs +++ b/crates/ra_macros/src/mbe.rs | |||
@@ -2,7 +2,10 @@ use smol_str::SmolStr; | |||
2 | 2 | ||
3 | use crate::tt::{self, Delimiter}; | 3 | use crate::tt::{self, Delimiter}; |
4 | 4 | ||
5 | pub use crate::mbe_parser::parse; | 5 | pub use crate::{ |
6 | mbe_parser::parse, | ||
7 | mbe_expander::exapnd, | ||
8 | }; | ||
6 | 9 | ||
7 | #[derive(Debug)] | 10 | #[derive(Debug)] |
8 | pub struct MacroRules { | 11 | pub struct MacroRules { |
diff --git a/crates/ra_macros/src/mbe_expander.rs b/crates/ra_macros/src/mbe_expander.rs new file mode 100644 index 000000000..426229659 --- /dev/null +++ b/crates/ra_macros/src/mbe_expander.rs | |||
@@ -0,0 +1,5 @@ | |||
1 | use crate::{mbe, tt}; | ||
2 | |||
3 | pub fn exapnd(rules: &mbe::MacroRules, input: tt::Subtree) -> Option<tt::Subtree> { | ||
4 | Some(input) | ||
5 | } | ||