Lines Matching refs:Entry
16 enum Entry {
33 entries: Box<[Entry]>,
37 fn recursive_new(entries: &mut Vec<Entry>, stream: TokenStream) {
40 TokenTree::Ident(ident) => entries.push(Entry::Ident(ident)),
41 TokenTree::Punct(punct) => entries.push(Entry::Punct(punct)),
42 TokenTree::Literal(literal) => entries.push(Entry::Literal(literal)),
45 entries.push(Entry::End(0)); // we replace this below
48 entries.push(Entry::End(-(group_end_index as isize)));
50 entries[group_start_index] = Entry::Group(group, group_end_offset);
69 entries.push(Entry::End(-(entries.len() as isize)));
93 ptr: *const Entry,
94 // This is the only `Entry::End` object which this cursor is allowed to
96 scope: *const Entry,
99 marker: PhantomData<&'a Entry>,
105 // It's safe in this situation for us to put an `Entry` object in global
112 struct UnsafeSyncEntry(Entry);
114 static EMPTY_ENTRY: UnsafeSyncEntry = UnsafeSyncEntry(Entry::End(0));
126 unsafe fn create(mut ptr: *const Entry, scope: *const Entry) -> Self {
131 while let Entry::End(_) = unsafe { &*ptr } {
146 fn entry(self) -> &'a Entry {
152 /// `Entry::End`.
154 /// If the cursor is looking at an `Entry::Group`, the bumped cursor will
166 while let Entry::Group(group, _) = self.entry() {
192 if let Entry::Group(group, end_offset) = self.entry() {
206 if let Entry::Group(group, end_offset) = self.entry() {
219 if let Entry::Group(group, end_offset) = self.entry() {
233 Entry::Ident(ident) => Some((ident.clone(), unsafe { self.bump_ignore_group() })),
243 Entry::Punct(punct) if punct.as_char() != '\'' => {
255 Entry::Literal(literal) => Some((literal.clone(), unsafe { self.bump_ignore_group() })),
265 Entry::Punct(punct) if punct.as_char() == '\'' && punct.spacing() == Spacing::Joint => {
299 Entry::Group(group, end_offset) => (group.clone().into(), *end_offset),
300 Entry::Literal(literal) => (literal.clone().into(), 1),
301 Entry::Ident(ident) => (ident.clone().into(), 1),
302 Entry::Punct(punct) => (punct.clone().into(), 1),
303 Entry::End(_) => return None,
314 Entry::Group(group, _) => group.span(),
315 Entry::Literal(literal) => literal.span(),
316 Entry::Ident(ident) => ident.span(),
317 Entry::Punct(punct) => punct.span(),
318 Entry::End(_) => Span::call_site(),
328 if let Entry::End(_) = self.entry() {
334 Entry::Group(group, _) => {
340 Entry::End(_) => depth += 1,
341 Entry::Literal(_) | Entry::Ident(_) | Entry::Punct(_) => {}
355 Entry::End(_) => return None,
358 Entry::Punct(punct) if punct.as_char() == '\'' && punct.spacing() == Spacing::Joint => {
360 Entry::Ident(_) => 2,
365 Entry::Group(_, end_offset) => *end_offset,
407 fn start_of_buffer(cursor: Cursor) -> *const Entry {
410 Entry::End(offset) => cursor.scope.offset(*offset),
422 Entry::Group(group, _) => group.span_open(),
429 Entry::Group(group, _) => group.span_close(),