mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
Revert "Auto merge of #12149 - jonas-schievink:literally-just-a-literal, r=jonas-schievink"
This reverts commitcc9ae2b89e
, reversing changes made to7dfd1cb572
.
This commit is contained in:
parent
2287ae22c6
commit
9bd11459ba
36 changed files with 121 additions and 502 deletions
|
@ -1085,26 +1085,6 @@ impl UnderscoreExpr {
|
|||
pub fn underscore_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![_]) }
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||
pub struct FloatLiteral {
|
||||
pub(crate) syntax: SyntaxNode,
|
||||
}
|
||||
impl FloatLiteral {
|
||||
pub fn float_number_start_0_token(&self) -> Option<SyntaxToken> {
|
||||
support::token(&self.syntax, T![float_number_start_0])
|
||||
}
|
||||
pub fn float_number_start_1_token(&self) -> Option<SyntaxToken> {
|
||||
support::token(&self.syntax, T![float_number_start_1])
|
||||
}
|
||||
pub fn float_number_start_2_token(&self) -> Option<SyntaxToken> {
|
||||
support::token(&self.syntax, T![float_number_start_2])
|
||||
}
|
||||
pub fn dot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![.]) }
|
||||
pub fn float_number_part_token(&self) -> Option<SyntaxToken> {
|
||||
support::token(&self.syntax, T![float_number_part])
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||
pub struct StmtList {
|
||||
pub(crate) syntax: SyntaxNode,
|
||||
|
@ -2739,17 +2719,6 @@ impl AstNode for UnderscoreExpr {
|
|||
}
|
||||
fn syntax(&self) -> &SyntaxNode { &self.syntax }
|
||||
}
|
||||
impl AstNode for FloatLiteral {
|
||||
fn can_cast(kind: SyntaxKind) -> bool { kind == FLOAT_LITERAL }
|
||||
fn cast(syntax: SyntaxNode) -> Option<Self> {
|
||||
if Self::can_cast(syntax.kind()) {
|
||||
Some(Self { syntax })
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
fn syntax(&self) -> &SyntaxNode { &self.syntax }
|
||||
}
|
||||
impl AstNode for StmtList {
|
||||
fn can_cast(kind: SyntaxKind) -> bool { kind == STMT_LIST }
|
||||
fn cast(syntax: SyntaxNode) -> Option<Self> {
|
||||
|
@ -4639,11 +4608,6 @@ impl std::fmt::Display for UnderscoreExpr {
|
|||
std::fmt::Display::fmt(self.syntax(), f)
|
||||
}
|
||||
}
|
||||
impl std::fmt::Display for FloatLiteral {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
std::fmt::Display::fmt(self.syntax(), f)
|
||||
}
|
||||
}
|
||||
impl std::fmt::Display for StmtList {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
std::fmt::Display::fmt(self.syntax(), f)
|
||||
|
|
|
@ -112,16 +112,16 @@ impl AstToken for IntNumber {
|
|||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||
pub struct FloatNumberPart {
|
||||
pub struct FloatNumber {
|
||||
pub(crate) syntax: SyntaxToken,
|
||||
}
|
||||
impl std::fmt::Display for FloatNumberPart {
|
||||
impl std::fmt::Display for FloatNumber {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
std::fmt::Display::fmt(&self.syntax, f)
|
||||
}
|
||||
}
|
||||
impl AstToken for FloatNumberPart {
|
||||
fn can_cast(kind: SyntaxKind) -> bool { kind == FLOAT_NUMBER_PART }
|
||||
impl AstToken for FloatNumber {
|
||||
fn can_cast(kind: SyntaxKind) -> bool { kind == FLOAT_NUMBER }
|
||||
fn cast(syntax: SyntaxToken) -> Option<Self> {
|
||||
if Self::can_cast(syntax.kind()) {
|
||||
Some(Self { syntax })
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue