aboutsummaryrefslogtreecommitdiff
path: root/crates/mbe/src/expander.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-01-29 16:24:16 +0000
committerGitHub <[email protected]>2021-01-29 16:24:16 +0000
commite7108fb5b198d4fe416ce2408afaa86f1020c37d (patch)
tree95766e6af68b0bd0d832180ce640ef0da868a76e /crates/mbe/src/expander.rs
parentd2a73c61641d065fd70e54a37442386deee6f013 (diff)
parent706ac8256d878626126756969b48b262d2e187b5 (diff)
Merge #7491
7491: Simplify mbe match error. r=edwin0cheng a=edwin0cheng Handle parse error in rule parsing instead of matching in mbe. bors r+ Co-authored-by: Edwin Cheng <[email protected]>
Diffstat (limited to 'crates/mbe/src/expander.rs')
-rw-r--r--crates/mbe/src/expander.rs9
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