mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-28 10:39:45 +00:00
Cleanup string handling in syntax highlighting
This commit is contained in:
parent
9200f77068
commit
8f319240b4
4 changed files with 27 additions and 58 deletions
|
|
@ -147,9 +147,6 @@ pub enum SyntaxKind {
|
|||
C_STRING,
|
||||
FLOAT_NUMBER,
|
||||
INT_NUMBER,
|
||||
RAW_BYTE_STRING,
|
||||
RAW_C_STRING,
|
||||
RAW_STRING,
|
||||
STRING,
|
||||
COMMENT,
|
||||
ERROR,
|
||||
|
|
@ -343,9 +340,6 @@ impl SyntaxKind {
|
|||
| C_STRING
|
||||
| FLOAT_NUMBER
|
||||
| INT_NUMBER
|
||||
| RAW_BYTE_STRING
|
||||
| RAW_C_STRING
|
||||
| RAW_STRING
|
||||
| STRING
|
||||
| ABI
|
||||
| ADT
|
||||
|
|
@ -898,18 +892,7 @@ impl SyntaxKind {
|
|||
)
|
||||
}
|
||||
pub fn is_literal(self) -> bool {
|
||||
matches!(
|
||||
self,
|
||||
BYTE | BYTE_STRING
|
||||
| CHAR
|
||||
| C_STRING
|
||||
| FLOAT_NUMBER
|
||||
| INT_NUMBER
|
||||
| RAW_BYTE_STRING
|
||||
| RAW_C_STRING
|
||||
| RAW_STRING
|
||||
| STRING
|
||||
)
|
||||
matches!(self, BYTE | BYTE_STRING | CHAR | C_STRING | FLOAT_NUMBER | INT_NUMBER | STRING)
|
||||
}
|
||||
pub fn from_keyword(ident: &str, edition: Edition) -> Option<SyntaxKind> {
|
||||
let kw = match ident {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue