Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/tt/src/iter.rs')
-rw-r--r--crates/tt/src/iter.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/crates/tt/src/iter.rs b/crates/tt/src/iter.rs
index e96bed0319..587b903aa9 100644
--- a/crates/tt/src/iter.rs
+++ b/crates/tt/src/iter.rs
@@ -57,6 +57,13 @@ impl<'a, S: Copy> TtIter<'a, S> {
}
}
+ pub fn expect_comma(&mut self) -> Result<(), ()> {
+ match self.expect_leaf()? {
+ Leaf::Punct(Punct { char: ',', .. }) => Ok(()),
+ _ => Err(()),
+ }
+ }
+
pub fn expect_ident(&mut self) -> Result<&'a Ident<S>, ()> {
match self.expect_leaf()? {
Leaf::Ident(it) if it.sym != sym::underscore => Ok(it),