diff options
Diffstat (limited to 'crates/libsyntax2')
-rw-r--r-- | crates/libsyntax2/src/ast/generated.rs | 4 | ||||
-rw-r--r-- | crates/libsyntax2/src/grammar.ron | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/crates/libsyntax2/src/ast/generated.rs b/crates/libsyntax2/src/ast/generated.rs index b24fd2aba..2b400b847 100644 --- a/crates/libsyntax2/src/ast/generated.rs +++ b/crates/libsyntax2/src/ast/generated.rs | |||
@@ -1441,6 +1441,10 @@ impl<'a> AstNode<'a> for Root<'a> { | |||
1441 | } | 1441 | } |
1442 | 1442 | ||
1443 | impl<'a> Root<'a> { | 1443 | impl<'a> Root<'a> { |
1444 | pub fn items(self) -> impl Iterator<Item = ModuleItem<'a>> + 'a { | ||
1445 | super::children(self) | ||
1446 | } | ||
1447 | |||
1444 | pub fn functions(self) -> impl Iterator<Item = FnDef<'a>> + 'a { | 1448 | pub fn functions(self) -> impl Iterator<Item = FnDef<'a>> + 'a { |
1445 | super::children(self) | 1449 | super::children(self) |
1446 | } | 1450 | } |
diff --git a/crates/libsyntax2/src/grammar.ron b/crates/libsyntax2/src/grammar.ron index c3a29c10c..8055a4687 100644 --- a/crates/libsyntax2/src/grammar.ron +++ b/crates/libsyntax2/src/grammar.ron | |||
@@ -238,6 +238,7 @@ Grammar( | |||
238 | ast: { | 238 | ast: { |
239 | "Root": ( | 239 | "Root": ( |
240 | collections: [ | 240 | collections: [ |
241 | ["items", "ModuleItem"], | ||
241 | ["functions", "FnDef"], | 242 | ["functions", "FnDef"], |
242 | ["modules", "Module"], | 243 | ["modules", "Module"], |
243 | ] | 244 | ] |