mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
Add classify_literal and undo expose next_token
This commit is contained in:
parent
1ab78d6056
commit
1ea0238e53
5 changed files with 15 additions and 8 deletions
|
@ -343,16 +343,14 @@ SOURCE_FILE@[0; 40)
|
|||
if let tt::TokenTree::Subtree(subtree) = tt {
|
||||
return &subtree;
|
||||
}
|
||||
assert!(false, "It is not a subtree");
|
||||
unreachable!();
|
||||
unreachable!("It is not a subtree");
|
||||
}
|
||||
|
||||
fn to_literal(tt: &tt::TokenTree) -> &tt::Literal {
|
||||
if let tt::TokenTree::Leaf(tt::Leaf::Literal(lit)) = tt {
|
||||
return lit;
|
||||
}
|
||||
assert!(false, "It is not a literal");
|
||||
unreachable!();
|
||||
unreachable!("It is not a literal");
|
||||
}
|
||||
|
||||
let rules = create_rules(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue