mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
Add tests for float access macro call inputs
This commit is contained in:
parent
f6539b139e
commit
e59487de38
5 changed files with 58 additions and 37 deletions
|
@ -7,7 +7,12 @@ use crate::{Leaf, Subtree, TokenTree};
|
|||
struct EntryId(usize);
|
||||
|
||||
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
|
||||
struct EntryPtr(EntryId, usize);
|
||||
struct EntryPtr(
|
||||
/// The index of the buffer containing the entry.
|
||||
EntryId,
|
||||
/// The index of the entry within the buffer.
|
||||
usize,
|
||||
);
|
||||
|
||||
/// Internal type which is used instead of `TokenTree` to represent a token tree
|
||||
/// within a `TokenBuffer`.
|
||||
|
@ -229,7 +234,11 @@ impl<'a, Span> Cursor<'a, Span> {
|
|||
Some(&Entry::Subtree(_, _, entry_id)) => {
|
||||
Cursor::create(self.buffer, EntryPtr(entry_id, 0))
|
||||
}
|
||||
_ => self.bump(),
|
||||
Some(Entry::End(exit)) => match exit {
|
||||
Some(exit) => Cursor::create(self.buffer, *exit),
|
||||
None => self,
|
||||
},
|
||||
_ => Cursor::create(self.buffer, EntryPtr(self.ptr.0, self.ptr.1 + 1)),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue