mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 20:42:04 +00:00
Simplify mbe match error.
Handle parse error in rule parsing instead of match in mbe
This commit is contained in:
parent
3ecd5112bb
commit
706ac8256d
6 changed files with 180 additions and 210 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue