Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/mbe/src/tt_iter.rs')
-rw-r--r--crates/mbe/src/tt_iter.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/crates/mbe/src/tt_iter.rs b/crates/mbe/src/tt_iter.rs
index 40e8a2385f..97b37b24ad 100644
--- a/crates/mbe/src/tt_iter.rs
+++ b/crates/mbe/src/tt_iter.rs
@@ -51,6 +51,13 @@ impl<'a, S: Span> TtIter<'a, S> {
}
}
+ pub(crate) fn expect_dollar(&mut self) -> Result<(), ()> {
+ match self.expect_leaf()? {
+ tt::Leaf::Punct(tt::Punct { char: '$', .. }) => Ok(()),
+ _ => Err(()),
+ }
+ }
+
pub(crate) fn expect_ident(&mut self) -> Result<&'a tt::Ident<S>, ()> {
match self.expect_leaf()? {
tt::Leaf::Ident(it) if it.text != "_" => Ok(it),