aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_mbe
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_mbe')
-rw-r--r--crates/ra_mbe/src/mbe_expander/matcher.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/ra_mbe/src/mbe_expander/matcher.rs b/crates/ra_mbe/src/mbe_expander/matcher.rs
index ffba03898..49c53183a 100644
--- a/crates/ra_mbe/src/mbe_expander/matcher.rs
+++ b/crates/ra_mbe/src/mbe_expander/matcher.rs
@@ -247,6 +247,7 @@ impl<'a> TtIter<'a> {
247 ra_parser::parse_fragment(&mut src, &mut sink, fragment_kind); 247 ra_parser::parse_fragment(&mut src, &mut sink, fragment_kind);
248 248
249 if !sink.cursor.is_root() || sink.error { 249 if !sink.cursor.is_root() || sink.error {
250 // FIXME better recovery in this case would help completion inside macros immensely
250 return Err(()); 251 return Err(());
251 } 252 }
252 253
@@ -375,7 +376,8 @@ fn match_meta_var(kind: &str, input: &mut TtIter) -> Result<Option<Fragment>, Ex
375 return Ok(Some(Fragment::Tokens(tt))); 376 return Ok(Some(Fragment::Tokens(tt)));
376 } 377 }
377 }; 378 };
378 let tt = input.expect_fragment(fragment).map_err(|()| err!())?; 379 let tt =
380 input.expect_fragment(fragment).map_err(|()| err!("fragment did not parse as {}", kind))?;
379 let fragment = if kind == "expr" { Fragment::Ast(tt) } else { Fragment::Tokens(tt) }; 381 let fragment = if kind == "expr" { Fragment::Ast(tt) } else { Fragment::Tokens(tt) };
380 Ok(Some(fragment)) 382 Ok(Some(fragment))
381} 383}