Update to latest syn-1.0.16
* fill back missing NOTICE,METADATA,*LICENSE* files
Bug: 150877376
Test: make
Test: atest --host -c --include-subdirs external/rust/crates
Change-Id: Ib5df6b8fb97764214e701a888e44fab3a4245800
diff --git a/src/buffer.rs b/src/buffer.rs
index 551a5ac..5c2dd8a 100644
--- a/src/buffer.rs
+++ b/src/buffer.rs
@@ -221,7 +221,6 @@
/// Checks whether the cursor is currently pointing at the end of its valid
/// scope.
- #[inline]
pub fn eof(self) -> bool {
// We're at eof if we're at the end of our scope.
self.ptr == self.scope
@@ -342,6 +341,26 @@
Entry::End(..) => Span::call_site(),
}
}
+
+ /// Skip over the next token without cloning it. Returns `None` if this
+ /// cursor points to eof.
+ ///
+ /// This method treats `'lifetimes` as a single token.
+ pub(crate) fn skip(self) -> Option<Cursor<'a>> {
+ match self.entry() {
+ Entry::End(..) => None,
+
+ // Treat lifetimes as a single tt for the purposes of 'skip'.
+ Entry::Punct(op) if op.as_char() == '\'' && op.spacing() == Spacing::Joint => {
+ let next = unsafe { self.bump() };
+ match next.entry() {
+ Entry::Ident(_) => Some(unsafe { next.bump() }),
+ _ => Some(next),
+ }
+ }
+ _ => Some(unsafe { self.bump() }),
+ }
+ }
}
pub(crate) fn same_scope(a: Cursor, b: Cursor) -> bool {