diff options
Diffstat (limited to 'crates/ra_syntax')
-rw-r--r-- | crates/ra_syntax/src/ast/expr_extensions.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/crates/ra_syntax/src/ast/expr_extensions.rs b/crates/ra_syntax/src/ast/expr_extensions.rs index d2c19b98d..20e390209 100644 --- a/crates/ra_syntax/src/ast/expr_extensions.rs +++ b/crates/ra_syntax/src/ast/expr_extensions.rs | |||
@@ -195,6 +195,15 @@ impl ast::BinExpr { | |||
195 | } | 195 | } |
196 | } | 196 | } |
197 | 197 | ||
198 | impl ast::IndexExpr { | ||
199 | pub fn base(&self) -> Option<ast::Expr> { | ||
200 | children(self).nth(0) | ||
201 | } | ||
202 | pub fn index(&self) -> Option<ast::Expr> { | ||
203 | children(self).nth(1) | ||
204 | } | ||
205 | } | ||
206 | |||
198 | pub enum ArrayExprKind { | 207 | pub enum ArrayExprKind { |
199 | Repeat { initializer: Option<ast::Expr>, repeat: Option<ast::Expr> }, | 208 | Repeat { initializer: Option<ast::Expr>, repeat: Option<ast::Expr> }, |
200 | ElementList(AstChildren<ast::Expr>), | 209 | ElementList(AstChildren<ast::Expr>), |