Lines Matching refs:Cursor

77     pub fn begin(&self) -> Cursor {
79 unsafe { Cursor::create(ptr, ptr.add(self.entries.len() - 1)) }
89 /// An empty `Cursor` can be created directly, or one may create a `TokenBuffer`
91 pub struct Cursor<'a> {
92 // The current entry which the `Cursor` is pointing at.
95 // point at. All other `End` objects are skipped over in `Cursor::create`.
97 // Cursor is covariant in 'a. This field ensures that our pointers are still
102 impl<'a> Cursor<'a> {
116 Cursor {
138 Cursor {
156 unsafe fn bump_ignore_group(self) -> Cursor<'a> {
157 unsafe { Cursor::create(self.ptr.offset(1), self.scope) }
184 pub fn group(mut self, delim: Delimiter) -> Option<(Cursor<'a>, DelimSpan, Cursor<'a>)> {
196 let inside_of_group = unsafe { Cursor::create(self.ptr.add(1), end_of_group) };
197 let after_group = unsafe { Cursor::create(end_of_group, self.scope) };
205 pub(crate) fn any_group(self) -> Option<(Cursor<'a>, Delimiter, DelimSpan, Cursor<'a>)> {
210 let inside_of_group = unsafe { Cursor::create(self.ptr.add(1), end_of_group) };
211 let after_group = unsafe { Cursor::create(end_of_group, self.scope) };
218 pub(crate) fn any_group_token(self) -> Option<(Group, Cursor<'a>)> {
221 let after_group = unsafe { Cursor::create(end_of_group, self.scope) };
230 pub fn ident(mut self) -> Option<(Ident, Cursor<'a>)> {
240 pub fn punct(mut self) -> Option<(Punct, Cursor<'a>)> {
252 pub fn literal(mut self) -> Option<(Literal, Cursor<'a>)> {
262 pub fn lifetime(mut self) -> Option<(Lifetime, Cursor<'a>)> {
297 pub fn token_tree(self) -> Option<(TokenTree, Cursor<'a>)> {
306 let rest = unsafe { Cursor::create(self.ptr.add(len), self.scope) };
353 pub(crate) fn skip(self) -> Option<Cursor<'a>> {
369 Some(unsafe { Cursor::create(self.ptr.add(len), self.scope) })
373 impl<'a> Copy for Cursor<'a> {}
375 impl<'a> Clone for Cursor<'a> {
381 impl<'a> Eq for Cursor<'a> {}
383 impl<'a> PartialEq for Cursor<'a> {
389 impl<'a> PartialOrd for Cursor<'a> {
399 pub(crate) fn same_scope(a: Cursor, b: Cursor) -> bool {
403 pub(crate) fn same_buffer(a: Cursor, b: Cursor) -> bool {
407 fn start_of_buffer(cursor: Cursor) -> *const Entry {
416 pub(crate) fn cmp_assuming_same_buffer(a: Cursor, b: Cursor) -> Ordering {
420 pub(crate) fn open_span_of_group(cursor: Cursor) -> Span {
427 pub(crate) fn close_span_of_group(cursor: Cursor) -> Span {