mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 15:15:24 +00:00
Implement ignore
and index
metavar expression
This commit is contained in:
parent
f7bb9327ad
commit
df66eb74ab
7 changed files with 108 additions and 5 deletions
|
@ -73,6 +73,13 @@ impl<'a> TtIter<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
pub(crate) fn expect_u32_literal(&mut self) -> Result<u32, ()> {
|
||||
match self.expect_literal()? {
|
||||
tt::Leaf::Literal(lit) => lit.text.parse().map_err(drop),
|
||||
_ => Err(()),
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn expect_punct(&mut self) -> Result<&'a tt::Punct, ()> {
|
||||
match self.expect_leaf()? {
|
||||
tt::Leaf::Punct(it) => Ok(it),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue