From 706ac8256d878626126756969b48b262d2e187b5 Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Sat, 30 Jan 2021 00:21:43 +0800 Subject: Simplify mbe match error. Handle parse error in rule parsing instead of match in mbe --- crates/mbe/src/expander.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'crates/mbe/src/expander.rs') 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( ) -> ExpandResult { let mut match_: Option<(matcher::Match, &crate::Rule)> = None; for rule in rules { - let new_match = match matcher::match_(&rule.lhs, input) { - Ok(m) => m, - Err(_e) => { - // error in pattern parsing - continue; - } - }; + let new_match = matcher::match_(&rule.lhs, input); + if new_match.err.is_none() { // If we find a rule that applies without errors, we're done. // Unconditionally returning the transcription here makes the -- cgit v1.2.3