summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/eval/ops.rs2
-rw-r--r--src/syntax/expr.rs2
-rw-r--r--tests/typ/code/ops-invalid.typ2
-rw-r--r--tests/typ/code/ops.typ10
4 files changed, 8 insertions, 8 deletions
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<Value> {
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,
}
diff --git a/tests/typ/code/ops-invalid.typ b/tests/typ/code/ops-invalid.typ
index e1662ddd..5d371e91 100644
--- a/tests/typ/code/ops-invalid.typ
+++ b/tests/typ/code/ops-invalid.typ
@@ -53,7 +53,7 @@
---
{
let x = 2
- for _ in 0..60 {
+ for _ in 0..61 {
x *= 2
}
// Error: 4-18 cannot repeat this string 4611686018427387904 times
diff --git a/tests/typ/code/ops.typ b/tests/typ/code/ops.typ
index ca328e75..d77c7503 100644
--- a/tests/typ/code/ops.typ
+++ b/tests/typ/code/ops.typ
@@ -163,12 +163,12 @@
// Test range operator.
#let array = (1, 2, 3)
-#test(1..3, array)
-#test(1.. 3, array)
-#test(1 ..3, array)
-#test(1 .. 3, array)
+#test(1..4, array)
+#test(1.. 4, array)
+#test(1 ..4, array)
+#test(1 .. 4, array)
-#test(-4..2, (-4, -3, -2, -1, 0, 1, 2))
+#test(-4..2, (-4, -3, -2, -1, 0, 1))
#test(10..5, ())
---