Add mbe stmt matcher

This commit is contained in:
Edwin Cheng 2019-04-17 12:34:43 +08:00
parent 546d9be2a7
commit 57e4122b89
7 changed files with 136 additions and 89 deletions

View file

@ -42,6 +42,10 @@ impl<'a> Parser<'a> {
self.parse(ra_parser::parse_pat)
}
pub fn parse_stmt(self) -> Option<tt::TokenTree> {
self.parse(|src, sink| ra_parser::parse_stmt(src, sink, false))
}
fn parse<F>(self, f: F) -> Option<tt::TokenTree>
where
F: FnOnce(&dyn TokenSource, &mut dyn TreeSink),