More symbols
This commit is contained in:
@@ -180,3 +180,22 @@ impl<R: TreeRoot> AstNode<R> for Trait<R> {
|
||||
impl<R: TreeRoot> ast::NameOwner<R> for Trait<R> {}
|
||||
impl<R: TreeRoot> Trait<R> {}
|
||||
|
||||
// TypeItem
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub struct TypeItem<R: TreeRoot = Arc<SyntaxRoot>> {
|
||||
syntax: SyntaxNode<R>,
|
||||
}
|
||||
|
||||
impl<R: TreeRoot> AstNode<R> for TypeItem<R> {
|
||||
fn cast(syntax: SyntaxNode<R>) -> Option<Self> {
|
||||
match syntax.kind() {
|
||||
TYPE_ITEM => Some(TypeItem { syntax }),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
fn syntax(&self) -> &SyntaxNode<R> { &self.syntax }
|
||||
}
|
||||
|
||||
impl<R: TreeRoot> ast::NameOwner<R> for TypeItem<R> {}
|
||||
impl<R: TreeRoot> TypeItem<R> {}
|
||||
|
||||
|
||||
@@ -219,27 +219,14 @@ Grammar(
|
||||
["functions", "Function"]
|
||||
]
|
||||
),
|
||||
"Function": (
|
||||
traits: ["NameOwner"]
|
||||
),
|
||||
"Struct": (
|
||||
traits: ["NameOwner"]
|
||||
),
|
||||
"Enum": (
|
||||
traits: ["NameOwner"]
|
||||
),
|
||||
"Trait": (
|
||||
traits: ["NameOwner"]
|
||||
),
|
||||
"Module": (
|
||||
traits: ["NameOwner"]
|
||||
),
|
||||
"ConstItem": (
|
||||
traits: ["NameOwner"]
|
||||
),
|
||||
"StaticItem": (
|
||||
traits: ["NameOwner"]
|
||||
),
|
||||
"Function": ( traits: ["NameOwner"] ),
|
||||
"Struct": ( traits: ["NameOwner"] ),
|
||||
"Enum": ( traits: ["NameOwner"] ),
|
||||
"Trait": ( traits: ["NameOwner"] ),
|
||||
"Module": ( traits: ["NameOwner"] ),
|
||||
"ConstItem": ( traits: ["NameOwner"] ),
|
||||
"StaticItem": ( traits: ["NameOwner"] ),
|
||||
"TypeItem": ( traits: ["NameOwner"] ),
|
||||
"Name": (),
|
||||
},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user