diff options
Diffstat (limited to 'crates/ra_hir_def/src/expr.rs')
-rw-r--r-- | crates/ra_hir_def/src/expr.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/crates/ra_hir_def/src/expr.rs b/crates/ra_hir_def/src/expr.rs index 04c1d8f69..6fad80a8d 100644 --- a/crates/ra_hir_def/src/expr.rs +++ b/crates/ra_hir_def/src/expr.rs | |||
@@ -14,6 +14,7 @@ | |||
14 | 14 | ||
15 | use hir_expand::name::Name; | 15 | use hir_expand::name::Name; |
16 | use ra_arena::{impl_arena_id, RawId}; | 16 | use ra_arena::{impl_arena_id, RawId}; |
17 | use ra_syntax::ast::RangeOp; | ||
17 | 18 | ||
18 | use crate::{ | 19 | use crate::{ |
19 | builtin_type::{BuiltinFloat, BuiltinInt}, | 20 | builtin_type::{BuiltinFloat, BuiltinInt}, |
@@ -130,6 +131,11 @@ pub enum Expr { | |||
130 | rhs: ExprId, | 131 | rhs: ExprId, |
131 | op: Option<BinaryOp>, | 132 | op: Option<BinaryOp>, |
132 | }, | 133 | }, |
134 | Range { | ||
135 | lhs: Option<ExprId>, | ||
136 | rhs: Option<ExprId>, | ||
137 | range_type: RangeOp, | ||
138 | }, | ||
133 | Index { | 139 | Index { |
134 | base: ExprId, | 140 | base: ExprId, |
135 | index: ExprId, | 141 | index: ExprId, |
@@ -288,6 +294,14 @@ impl Expr { | |||
288 | f(*lhs); | 294 | f(*lhs); |
289 | f(*rhs); | 295 | f(*rhs); |
290 | } | 296 | } |
297 | Expr::Range { lhs, rhs, .. } => { | ||
298 | if let Some(lhs) = rhs { | ||
299 | f(*lhs); | ||
300 | } | ||
301 | if let Some(rhs) = lhs { | ||
302 | f(*rhs); | ||
303 | } | ||
304 | } | ||
291 | Expr::Index { base, index } => { | 305 | Expr::Index { base, index } => { |
292 | f(*base); | 306 | f(*base); |
293 | f(*index); | 307 | f(*index); |