mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-18 17:40:29 +00:00
Kill RAW_ literals
Syntactically, they are indistinguishable from non-raw versions, so it doesn't make sense to separate then *at the syntax* level.
This commit is contained in:
parent
6725dcf847
commit
5ba4f949c2
53 changed files with 142 additions and 165 deletions
|
@ -320,6 +320,13 @@ impl ast::Literal {
|
|||
ast::IntNumber::cast(self.token())
|
||||
}
|
||||
|
||||
pub fn as_string(&self) -> Option<ast::String> {
|
||||
ast::String::cast(self.token())
|
||||
}
|
||||
pub fn as_byte_string(&self) -> Option<ast::ByteString> {
|
||||
ast::ByteString::cast(self.token())
|
||||
}
|
||||
|
||||
fn find_suffix(text: &str, possible_suffixes: &[&str]) -> Option<SmolStr> {
|
||||
possible_suffixes
|
||||
.iter()
|
||||
|
@ -351,10 +358,10 @@ impl ast::Literal {
|
|||
suffix: Self::find_suffix(&text, &ast::FloatNumber::SUFFIXES),
|
||||
}
|
||||
}
|
||||
STRING | RAW_STRING => LiteralKind::String,
|
||||
STRING => LiteralKind::String,
|
||||
T![true] => LiteralKind::Bool(true),
|
||||
T![false] => LiteralKind::Bool(false),
|
||||
BYTE_STRING | RAW_BYTE_STRING => LiteralKind::ByteString,
|
||||
BYTE_STRING => LiteralKind::ByteString,
|
||||
CHAR => LiteralKind::Char,
|
||||
BYTE => LiteralKind::Byte,
|
||||
_ => unreachable!(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue