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

@ -86,13 +86,6 @@ fn expand_subtree(
let start_elements = arena.len();
let mut err = None;
for op in template.iter() {
let op = match op {
Ok(op) => op,
Err(e) => {
err = Some(e.clone());
break;
}
};
match op {
Op::Leaf(tt) => arena.push(tt.clone().into()),
Op::Subtree(tt) => {