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:
Aleksey Kladov 2020-11-06 22:21:56 +01:00
parent 6725dcf847
commit 5ba4f949c2
53 changed files with 142 additions and 165 deletions

View file

@ -70,16 +70,16 @@ impl AstToken for String {
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct RawString {
pub struct ByteString {
pub(crate) syntax: SyntaxToken,
}
impl std::fmt::Display for RawString {
impl std::fmt::Display for ByteString {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(&self.syntax, f)
}
}
impl AstToken for RawString {
fn can_cast(kind: SyntaxKind) -> bool { kind == RAW_STRING }
impl AstToken for ByteString {
fn can_cast(kind: SyntaxKind) -> bool { kind == BYTE_STRING }
fn cast(syntax: SyntaxToken) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })