Simplify mbe match error.

Handle parse error in rule parsing instead of match in mbe
This commit is contained in:
Edwin Cheng
2021-01-30 00:21:43 +08:00
parent 3ecd5112bb
commit 706ac8256d
6 changed files with 180 additions and 210 deletions

View File

@@ -16,13 +16,8 @@ pub(crate) fn expand_rules(
) -> ExpandResult<tt::Subtree> {
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