aboutsummaryrefslogtreecommitdiff
path: root/crates/libsyntax2
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-08-11 14:20:37 +0100
committerAleksey Kladov <[email protected]>2018-08-11 14:20:37 +0100
commit56aa6e20e0279c69e0130905573b1607056cfaf9 (patch)
tree814d6201390b46f64ea0f9571c6b2fcff52fa016 /crates/libsyntax2
parentfe1fe866f3fd0a7bb542debaae782470f107b7c1 (diff)
More symbols
Diffstat (limited to 'crates/libsyntax2')
-rw-r--r--crates/libsyntax2/src/ast/generated.rs19
-rw-r--r--crates/libsyntax2/src/grammar.ron29
2 files changed, 27 insertions, 21 deletions
diff --git a/crates/libsyntax2/src/ast/generated.rs b/crates/libsyntax2/src/ast/generated.rs
index a4b116941..31f5ecc44 100644
--- a/crates/libsyntax2/src/ast/generated.rs
+++ b/crates/libsyntax2/src/ast/generated.rs
@@ -180,3 +180,22 @@ impl<R: TreeRoot> AstNode<R> for Trait<R> {
180impl<R: TreeRoot> ast::NameOwner<R> for Trait<R> {} 180impl<R: TreeRoot> ast::NameOwner<R> for Trait<R> {}
181impl<R: TreeRoot> Trait<R> {} 181impl<R: TreeRoot> Trait<R> {}
182 182
183// TypeItem
184#[derive(Debug, Clone, Copy)]
185pub struct TypeItem<R: TreeRoot = Arc<SyntaxRoot>> {
186 syntax: SyntaxNode<R>,
187}
188
189impl<R: TreeRoot> AstNode<R> for TypeItem<R> {
190 fn cast(syntax: SyntaxNode<R>) -> Option<Self> {
191 match syntax.kind() {
192 TYPE_ITEM => Some(TypeItem { syntax }),
193 _ => None,
194 }
195 }
196 fn syntax(&self) -> &SyntaxNode<R> { &self.syntax }
197}
198
199impl<R: TreeRoot> ast::NameOwner<R> for TypeItem<R> {}
200impl<R: TreeRoot> TypeItem<R> {}
201
diff --git a/crates/libsyntax2/src/grammar.ron b/crates/libsyntax2/src/grammar.ron
index 3fe8fdf0b..d4e8c53d3 100644
--- a/crates/libsyntax2/src/grammar.ron
+++ b/crates/libsyntax2/src/grammar.ron
@@ -219,27 +219,14 @@ Grammar(
219 ["functions", "Function"] 219 ["functions", "Function"]
220 ] 220 ]
221 ), 221 ),
222 "Function": ( 222 "Function": ( traits: ["NameOwner"] ),
223 traits: ["NameOwner"] 223 "Struct": ( traits: ["NameOwner"] ),
224 ), 224 "Enum": ( traits: ["NameOwner"] ),
225 "Struct": ( 225 "Trait": ( traits: ["NameOwner"] ),
226 traits: ["NameOwner"] 226 "Module": ( traits: ["NameOwner"] ),
227 ), 227 "ConstItem": ( traits: ["NameOwner"] ),
228 "Enum": ( 228 "StaticItem": ( traits: ["NameOwner"] ),
229 traits: ["NameOwner"] 229 "TypeItem": ( traits: ["NameOwner"] ),
230 ),
231 "Trait": (
232 traits: ["NameOwner"]
233 ),
234 "Module": (
235 traits: ["NameOwner"]
236 ),
237 "ConstItem": (
238 traits: ["NameOwner"]
239 ),
240 "StaticItem": (
241 traits: ["NameOwner"]
242 ),
243 "Name": (), 230 "Name": (),
244 }, 231 },
245) 232)