remove dead code
This commit is contained in:
parent
56f3524c69
commit
8014116e5f
@ -25,13 +25,6 @@ fn cast(syntax: &SyntaxNode) -> Option<&Self>
|
||||
fn syntax(&self) -> &SyntaxNode;
|
||||
}
|
||||
|
||||
pub trait AstToken: AstNode {
|
||||
fn text(&self) -> &SmolStr {
|
||||
// self.syntax().leaf_text().unwrap()
|
||||
unimplemented!()
|
||||
}
|
||||
}
|
||||
|
||||
pub trait TypeAscriptionOwner: AstNode {
|
||||
fn ascribed_type(&self) -> Option<&TypeRef> {
|
||||
child_opt(self)
|
||||
|
@ -4367,32 +4367,3 @@ pub fn condition(&self) -> Option<&Condition> {
|
||||
}
|
||||
}
|
||||
|
||||
// Whitespace
|
||||
#[derive(Debug, PartialEq, Eq, Hash)]
|
||||
#[repr(transparent)]
|
||||
pub struct Whitespace {
|
||||
pub(crate) syntax: SyntaxNode,
|
||||
}
|
||||
unsafe impl TransparentNewType for Whitespace {
|
||||
type Repr = rowan::SyntaxNode<RaTypes>;
|
||||
}
|
||||
|
||||
impl AstNode for Whitespace {
|
||||
fn cast(syntax: &SyntaxNode) -> Option<&Self> {
|
||||
match syntax.kind() {
|
||||
WHITESPACE => Some(Whitespace::from_repr(syntax.into_repr())),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
fn syntax(&self) -> &SyntaxNode { &self.syntax }
|
||||
}
|
||||
|
||||
impl ToOwned for Whitespace {
|
||||
type Owned = TreeArc<Whitespace>;
|
||||
fn to_owned(&self) -> TreeArc<Whitespace> { TreeArc::cast(self.syntax.to_owned()) }
|
||||
}
|
||||
|
||||
|
||||
impl ast::AstToken for Whitespace {}
|
||||
impl Whitespace {}
|
||||
|
||||
|
@ -663,6 +663,5 @@ Grammar(
|
||||
"TypeArg": (options: ["TypeRef"]),
|
||||
"AssocTypeArg": (options: ["NameRef", "TypeRef"]),
|
||||
"LifetimeArg": (),
|
||||
"Whitespace": ( traits: ["AstToken"] ),
|
||||
},
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user