aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_mbe/src/tt_cursor.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_mbe/src/tt_cursor.rs')
-rw-r--r--crates/ra_mbe/src/tt_cursor.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/crates/ra_mbe/src/tt_cursor.rs b/crates/ra_mbe/src/tt_cursor.rs
index 3128cb9ae..d29faa77c 100644
--- a/crates/ra_mbe/src/tt_cursor.rs
+++ b/crates/ra_mbe/src/tt_cursor.rs
@@ -1,4 +1,5 @@
1use crate::ParseError; 1use crate::ParseError;
2use crate::subtree_parser::Parser;
2 3
3#[derive(Clone)] 4#[derive(Clone)]
4pub(crate) struct TtCursor<'a> { 5pub(crate) struct TtCursor<'a> {
@@ -78,6 +79,11 @@ impl<'a> TtCursor<'a> {
78 }) 79 })
79 } 80 }
80 81
82 pub(crate) fn eat_path(&mut self) -> Option<tt::TokenTree> {
83 let parser = Parser::new(&mut self.pos, self.subtree);
84 parser.parse_path()
85 }
86
81 pub(crate) fn expect_char(&mut self, char: char) -> Result<(), ParseError> { 87 pub(crate) fn expect_char(&mut self, char: char) -> Result<(), ParseError> {
82 if self.at_char(char) { 88 if self.at_char(char) {
83 self.bump(); 89 self.bump();