From ccb4be4da4e8aeda115b22f2a0b586a86f5e31bd Mon Sep 17 00:00:00 2001 From: Laurenz Date: Thu, 12 Aug 2021 14:54:52 +0200 Subject: Make range-end exclusive --- src/eval/ops.rs | 2 +- src/syntax/expr.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/eval/ops.rs b/src/eval/ops.rs index f79b2bf6..5bc61021 100644 --- a/src/eval/ops.rs +++ b/src/eval/ops.rs @@ -247,7 +247,7 @@ comparison!(geq, ">=", Ordering::Greater | Ordering::Equal); /// Compute the range from `lhs` to `rhs`. pub fn range(lhs: Value, rhs: Value) -> StrResult { match (lhs, rhs) { - (Int(a), Int(b)) => Ok(Array((a ..= b).map(Int).collect())), + (Int(a), Int(b)) => Ok(Array((a .. b).map(Int).collect())), (a, b) => mismatch!("cannot apply '..' to {} and {}", a, b), } } diff --git a/src/syntax/expr.rs b/src/syntax/expr.rs index 21df47c8..cf9aff4a 100644 --- a/src/syntax/expr.rs +++ b/src/syntax/expr.rs @@ -278,7 +278,7 @@ pub enum BinOp { MulAssign, /// The divide-assign operator: `/=`. DivAssign, - /// The inclusive range operator: `..`. + /// The range operator: `..`. Range, } -- cgit v1.2.3