mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
Make mbe compile with parser changes
This commit is contained in:
parent
6fa6efe90f
commit
9053bcc65c
3 changed files with 14 additions and 7 deletions
|
@ -16,8 +16,8 @@ enum Entry<'t, Span> {
|
|||
// Mimicking types from proc-macro.
|
||||
Subtree(Option<&'t TokenTree<Span>>, &'t Subtree<Span>, EntryId),
|
||||
Leaf(&'t TokenTree<Span>),
|
||||
// End entries contain a pointer to the entry from the containing
|
||||
// token tree, or None if this is the outermost level.
|
||||
/// End entries contain a pointer to the entry from the containing
|
||||
/// token tree, or [`None`] if this is the outermost level.
|
||||
End(Option<EntryPtr>),
|
||||
}
|
||||
|
||||
|
@ -226,7 +226,9 @@ impl<'a, Span> Cursor<'a, Span> {
|
|||
/// a cursor into that subtree
|
||||
pub fn bump_subtree(self) -> Cursor<'a, Span> {
|
||||
match self.entry() {
|
||||
Some(Entry::Subtree(_, _, _)) => self.subtree().unwrap(),
|
||||
Some(&Entry::Subtree(_, _, entry_id)) => {
|
||||
Cursor::create(self.buffer, EntryPtr(entry_id, 0))
|
||||
}
|
||||
_ => self.bump(),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue