diff options
author | Aleksey Kladov <[email protected]> | 2019-01-31 10:59:39 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-01-31 20:23:30 +0000 |
commit | 2def5b4e6f05241862af30d27a547c562693f678 (patch) | |
tree | b60007aa50b8fa31c115bbc2b6f2dd022ece2c8c /crates/ra_macros/src | |
parent | d2a1e0715088d61ab40b64d0fd8ad296251ccfa1 (diff) |
more expand boilerplate
Diffstat (limited to 'crates/ra_macros/src')
-rw-r--r-- | crates/ra_macros/src/mbe_expander.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_macros/src/mbe_expander.rs b/crates/ra_macros/src/mbe_expander.rs index 9436baa28..545bd2002 100644 --- a/crates/ra_macros/src/mbe_expander.rs +++ b/crates/ra_macros/src/mbe_expander.rs | |||
@@ -8,7 +8,7 @@ pub fn exapnd(rules: &mbe::MacroRules, input: &tt::Subtree) -> Option<tt::Subtre | |||
8 | } | 8 | } |
9 | 9 | ||
10 | fn expand_rule(rule: &mbe::Rule, input: &tt::Subtree) -> Option<tt::Subtree> { | 10 | fn expand_rule(rule: &mbe::Rule, input: &tt::Subtree) -> Option<tt::Subtree> { |
11 | let bidings = match_lhs(&rule.lhs, input)?; | 11 | let bindings = match_lhs(&rule.lhs, input)?; |
12 | expand_rhs(&rule.rhs, &bindings) | 12 | expand_rhs(&rule.rhs, &bindings) |
13 | } | 13 | } |
14 | 14 | ||
@@ -17,10 +17,10 @@ struct Bindings { | |||
17 | inner: FxHashMap<SmolStr, tt::TokenTree>, | 17 | inner: FxHashMap<SmolStr, tt::TokenTree>, |
18 | } | 18 | } |
19 | 19 | ||
20 | fn match_lhs(pattern: &mbe::TokenTree, input: &tt::Subtree) -> Option<Bindings> { | 20 | fn match_lhs(pattern: &mbe::Subtree, input: &tt::Subtree) -> Option<Bindings> { |
21 | Some(Bindings::default()) | 21 | Some(Bindings::default()) |
22 | } | 22 | } |
23 | 23 | ||
24 | fn expand_rhs(template: &mbe::TokenTree, bindings: &Bindings) -> Option<tt::Subtree> { | 24 | fn expand_rhs(template: &mbe::Subtree, bindings: &Bindings) -> Option<tt::Subtree> { |
25 | None | 25 | None |
26 | } | 26 | } |