diff options
Diffstat (limited to 'crates/libsyntax2/src/ast')
-rw-r--r-- | crates/libsyntax2/src/ast/generated.rs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/crates/libsyntax2/src/ast/generated.rs b/crates/libsyntax2/src/ast/generated.rs index e8a87eba5..610b5198c 100644 --- a/crates/libsyntax2/src/ast/generated.rs +++ b/crates/libsyntax2/src/ast/generated.rs | |||
@@ -127,6 +127,12 @@ impl<'a> File<'a> { | |||
127 | .children() | 127 | .children() |
128 | .filter_map(FnDef::cast) | 128 | .filter_map(FnDef::cast) |
129 | } | 129 | } |
130 | |||
131 | pub fn modules(self) -> impl Iterator<Item = Module<'a>> + 'a { | ||
132 | self.syntax() | ||
133 | .children() | ||
134 | .filter_map(Module::cast) | ||
135 | } | ||
130 | } | 136 | } |
131 | 137 | ||
132 | // FnDef | 138 | // FnDef |
@@ -239,7 +245,13 @@ impl<'a> AstNode<'a> for Module<'a> { | |||
239 | 245 | ||
240 | impl<'a> ast::NameOwner<'a> for Module<'a> {} | 246 | impl<'a> ast::NameOwner<'a> for Module<'a> {} |
241 | impl<'a> ast::AttrsOwner<'a> for Module<'a> {} | 247 | impl<'a> ast::AttrsOwner<'a> for Module<'a> {} |
242 | impl<'a> Module<'a> {} | 248 | impl<'a> Module<'a> { |
249 | pub fn modules(self) -> impl Iterator<Item = Module<'a>> + 'a { | ||
250 | self.syntax() | ||
251 | .children() | ||
252 | .filter_map(Module::cast) | ||
253 | } | ||
254 | } | ||
243 | 255 | ||
244 | // Name | 256 | // Name |
245 | #[derive(Debug, Clone, Copy)] | 257 | #[derive(Debug, Clone, Copy)] |