diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-04-18 13:00:16 +0100 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-04-18 13:00:16 +0100 |
commit | 403cd78baee7e9c2410d04ca0304575e7bbab16d (patch) | |
tree | 9e7ff9215e3490169c63c12e03c2eb03ca59ba20 /crates/ra_mbe/src/tt_cursor.rs | |
parent | 112fd0ec7d65b5f23865410fd3e188e761d97110 (diff) | |
parent | e944fd059de93f305d6a8c40cfac5ebe84548771 (diff) |
Merge #1161
1161: Add mbe 'item' matcher r=matklad a=edwin0cheng
Add `item` matcher in `ra_mbe` , and added corresponding `item()` parser in `ra_syntax`.
This PR also help PR #1148 for `Items` parsing.
And hopefully fix #1149 ?!
Co-authored-by: Edwin Cheng <[email protected]>
Diffstat (limited to 'crates/ra_mbe/src/tt_cursor.rs')
-rw-r--r-- | crates/ra_mbe/src/tt_cursor.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/crates/ra_mbe/src/tt_cursor.rs b/crates/ra_mbe/src/tt_cursor.rs index adfe5520d..484437b0e 100644 --- a/crates/ra_mbe/src/tt_cursor.rs +++ b/crates/ra_mbe/src/tt_cursor.rs | |||
@@ -104,6 +104,11 @@ impl<'a> TtCursor<'a> { | |||
104 | parser.parse_stmt() | 104 | parser.parse_stmt() |
105 | } | 105 | } |
106 | 106 | ||
107 | pub(crate) fn eat_item(&mut self) -> Option<tt::TokenTree> { | ||
108 | let parser = Parser::new(&mut self.pos, self.subtree); | ||
109 | parser.parse_item() | ||
110 | } | ||
111 | |||
107 | pub(crate) fn expect_char(&mut self, char: char) -> Result<(), ParseError> { | 112 | pub(crate) fn expect_char(&mut self, char: char) -> Result<(), ParseError> { |
108 | if self.at_char(char) { | 113 | if self.at_char(char) { |
109 | self.bump(); | 114 | self.bump(); |