Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/mbe/src/expander/transcriber.rs')
| -rw-r--r-- | crates/mbe/src/expander/transcriber.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/crates/mbe/src/expander/transcriber.rs b/crates/mbe/src/expander/transcriber.rs index f3f9f2990c..e2340b44a8 100644 --- a/crates/mbe/src/expander/transcriber.rs +++ b/crates/mbe/src/expander/transcriber.rs @@ -210,8 +210,11 @@ fn expand_subtree( } Op::Ignore { name, id } => { // Expand the variable, but ignore the result. This registers the repetition count. - // FIXME: Any emitted errors are dropped. - let _ = ctx.bindings.get_fragment(name, *id, &mut ctx.nesting, marker); + let e = ctx.bindings.get_fragment(name, *id, &mut ctx.nesting, marker).err(); + // FIXME: The error gets dropped if there were any previous errors. + // This should be reworked in a way where the errors can be combined + // and reported rather than storing the first error encountered. + err = err.or(e); } Op::Index { depth } => { let index = @@ -239,9 +242,7 @@ fn expand_subtree( let mut binding = match ctx.bindings.get(name, ctx.call_site) { Ok(b) => b, Err(e) => { - if err.is_none() { - err = Some(e); - } + err = err.or(Some(e)); continue; } }; |