From 6646d49f238bb92d55fcb4900830f19faa2994a5 Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Sat, 13 Apr 2019 18:38:31 +0800 Subject: Fix bug and add expr , pat , ty matcher --- crates/ra_mbe/src/subtree_parser.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'crates/ra_mbe/src/subtree_parser.rs') diff --git a/crates/ra_mbe/src/subtree_parser.rs b/crates/ra_mbe/src/subtree_parser.rs index 164240d92..13d5d2169 100644 --- a/crates/ra_mbe/src/subtree_parser.rs +++ b/crates/ra_mbe/src/subtree_parser.rs @@ -30,6 +30,18 @@ impl<'a> Parser<'a> { self.parse(ra_parser::parse_path) } + pub fn parse_expr(self) -> Option { + self.parse(ra_parser::parse_expr) + } + + pub fn parse_ty(self) -> Option { + self.parse(ra_parser::parse_ty) + } + + pub fn parse_pat(self) -> Option { + self.parse(ra_parser::parse_pat) + } + fn parse(self, f: F) -> Option where F: FnOnce(&dyn TokenSource, &mut dyn TreeSink), -- cgit v1.2.3