Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/syntax/src/ast/node_ext.rs')
| -rw-r--r-- | crates/syntax/src/ast/node_ext.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/crates/syntax/src/ast/node_ext.rs b/crates/syntax/src/ast/node_ext.rs index 2e6544f090..98d142da3f 100644 --- a/crates/syntax/src/ast/node_ext.rs +++ b/crates/syntax/src/ast/node_ext.rs @@ -754,6 +754,15 @@ impl ast::GenericParamList { } } +impl ast::HasLoopBody for ast::ForExpr { + fn loop_body(&self) -> Option<ast::BlockExpr> { + let mut exprs = support::children(self.syntax()); + let first = exprs.next(); + let second = exprs.next(); + second.or(first) + } +} + impl ast::HasDocComments for ast::SourceFile {} impl ast::HasDocComments for ast::Fn {} impl ast::HasDocComments for ast::Struct {} |