diff options
author | Edwin Cheng <[email protected]> | 2021-01-29 16:21:43 +0000 |
---|---|---|
committer | Edwin Cheng <[email protected]> | 2021-01-29 16:21:43 +0000 |
commit | 706ac8256d878626126756969b48b262d2e187b5 (patch) | |
tree | 8adb77484d4563ad61fc76ed9796d38a42a161e8 /crates/mbe/src/expander.rs | |
parent | 3ecd5112bbc2cc1a45f423e0256230507f159162 (diff) |
Simplify mbe match error.
Handle parse error in rule parsing instead of match in mbe
Diffstat (limited to 'crates/mbe/src/expander.rs')
-rw-r--r-- | crates/mbe/src/expander.rs | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/crates/mbe/src/expander.rs b/crates/mbe/src/expander.rs index 802c8fb0f..e7e14b3cc 100644 --- a/crates/mbe/src/expander.rs +++ b/crates/mbe/src/expander.rs | |||
@@ -16,13 +16,8 @@ pub(crate) fn expand_rules( | |||
16 | ) -> ExpandResult<tt::Subtree> { | 16 | ) -> ExpandResult<tt::Subtree> { |
17 | let mut match_: Option<(matcher::Match, &crate::Rule)> = None; | 17 | let mut match_: Option<(matcher::Match, &crate::Rule)> = None; |
18 | for rule in rules { | 18 | for rule in rules { |
19 | let new_match = match matcher::match_(&rule.lhs, input) { | 19 | let new_match = matcher::match_(&rule.lhs, input); |
20 | Ok(m) => m, | 20 | |
21 | Err(_e) => { | ||
22 | // error in pattern parsing | ||
23 | continue; | ||
24 | } | ||
25 | }; | ||
26 | if new_match.err.is_none() { | 21 | if new_match.err.is_none() { |
27 | // If we find a rule that applies without errors, we're done. | 22 | // If we find a rule that applies without errors, we're done. |
28 | // Unconditionally returning the transcription here makes the | 23 | // Unconditionally returning the transcription here makes the |