diff options
Diffstat (limited to 'crates/ra_hir_def/src/expr.rs')
-rw-r--r-- | crates/ra_hir_def/src/expr.rs | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/crates/ra_hir_def/src/expr.rs b/crates/ra_hir_def/src/expr.rs index 04c1d8f69..115090218 100644 --- a/crates/ra_hir_def/src/expr.rs +++ b/crates/ra_hir_def/src/expr.rs | |||
@@ -130,6 +130,24 @@ pub enum Expr { | |||
130 | rhs: ExprId, | 130 | rhs: ExprId, |
131 | op: Option<BinaryOp>, | 131 | op: Option<BinaryOp>, |
132 | }, | 132 | }, |
133 | RangeFull, | ||
134 | RangeFrom { | ||
135 | lhs: ExprId, | ||
136 | }, | ||
137 | RangeTo { | ||
138 | rhs: ExprId, | ||
139 | }, | ||
140 | Range { | ||
141 | lhs: ExprId, | ||
142 | rhs: ExprId, | ||
143 | }, | ||
144 | RangeToInclusive { | ||
145 | rhs: ExprId, | ||
146 | }, | ||
147 | RangeInclusive { | ||
148 | lhs: ExprId, | ||
149 | rhs: ExprId, | ||
150 | }, | ||
133 | Index { | 151 | Index { |
134 | base: ExprId, | 152 | base: ExprId, |
135 | index: ExprId, | 153 | index: ExprId, |
@@ -284,7 +302,9 @@ impl Expr { | |||
284 | Expr::Lambda { body, .. } => { | 302 | Expr::Lambda { body, .. } => { |
285 | f(*body); | 303 | f(*body); |
286 | } | 304 | } |
287 | Expr::BinaryOp { lhs, rhs, .. } => { | 305 | Expr::BinaryOp { lhs, rhs, .. } |
306 | | Expr::Range { lhs, rhs } | ||
307 | | Expr::RangeInclusive { lhs, rhs } => { | ||
288 | f(*lhs); | 308 | f(*lhs); |
289 | f(*rhs); | 309 | f(*rhs); |
290 | } | 310 | } |
@@ -292,7 +312,11 @@ impl Expr { | |||
292 | f(*base); | 312 | f(*base); |
293 | f(*index); | 313 | f(*index); |
294 | } | 314 | } |
295 | Expr::Field { expr, .. } | 315 | Expr::RangeFull => {} |
316 | Expr::RangeFrom { lhs: expr } | ||
317 | | Expr::RangeTo { rhs: expr } | ||
318 | | Expr::RangeToInclusive { rhs: expr } | ||
319 | | Expr::Field { expr, .. } | ||
296 | | Expr::Await { expr } | 320 | | Expr::Await { expr } |
297 | | Expr::Try { expr } | 321 | | Expr::Try { expr } |
298 | | Expr::Cast { expr, .. } | 322 | | Expr::Cast { expr, .. } |