aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_macros
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-01-31 10:49:57 +0000
committerAleksey Kladov <[email protected]>2019-01-31 20:23:30 +0000
commit09a8d753512ac878224455a148ad66d0f14a20da (patch)
treef38784e9410f19c4c12f7a9df2779292750cc9eb /crates/ra_macros
parent2d88207853a38fa3f73c03ef1f9d5a1b8ce9924a (diff)
expand boilerplate
Diffstat (limited to 'crates/ra_macros')
-rw-r--r--crates/ra_macros/src/lib.rs1
-rw-r--r--crates/ra_macros/src/mbe.rs5
-rw-r--r--crates/ra_macros/src/mbe_expander.rs5
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 {
13pub mod tt; 13pub mod tt;
14pub mod mbe; 14pub mod mbe;
15mod mbe_parser; 15mod mbe_parser;
16mod 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
3use crate::tt::{self, Delimiter}; 3use crate::tt::{self, Delimiter};
4 4
5pub use crate::mbe_parser::parse; 5pub use crate::{
6 mbe_parser::parse,
7 mbe_expander::exapnd,
8};
6 9
7#[derive(Debug)] 10#[derive(Debug)]
8pub struct MacroRules { 11pub 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 @@
1use crate::{mbe, tt};
2
3pub fn exapnd(rules: &mbe::MacroRules, input: tt::Subtree) -> Option<tt::Subtree> {
4 Some(input)
5}