@@ -402,7 +402,6 @@ match tuple {
402
402
> ** <sup >Syntax</sup >** \
403
403
> _ RangePattern_ :\
404
404
>   ;  ; _ RangePatternBound_ ` ..= ` _ RangePatternBound_
405
- > _ RangeFromPattern_ :\
406
405
>   ;  ; _ RangePatternBound_ ` .. `
407
406
>
408
407
> _ ObsoleteRangePattern_ :\
@@ -416,10 +415,16 @@ match tuple {
416
415
>   ;  ; | [ _ PathInExpression_ ] \
417
416
>   ;  ; | [ _ QualifiedPathInExpression_ ]
418
417
419
- Range patterns match values that are within a range defined by its lower and upper bounds (if any).
420
- For example, a pattern ` 'm'..='p' ` will match only the values ` 'm' ` , ` 'n' ` , ` 'o' ` , and ` 'p' ` . A
421
- pattern ` 1.. ` will match values equal to or greater than 1, but not 0 (or negative numbers, for
422
- signed integers). The bounds can be literals or paths that point to constant values.
418
+ Range patterns match values within the range defined by their bounds. A range pattern may be
419
+ closed or half-open. A range pattern is closed if it has both a lower and an upper bound, and
420
+ it matches all the values between and including both of its bounds. A range pattern that is
421
+ half-open is written with a lower bound but not an upper bound, and matches any value equal to
422
+ or greater than the specified lower bound.
423
+
424
+ For example, a pattern ` 'm'..='p' ` will match only the values ` 'm' ` , ` 'n' ` , ` 'o' ` , and ` 'p' ` . The
425
+ pattern ` 1.. ` will match 9, or 9001, or 9007199254740991 (if it is of an appropriate size), but
426
+ not 0 or negative numbers for signed integers. The bounds can be literals or paths that point
427
+ to constant values.
423
428
424
429
A pattern a ` ..= ` b must always have a &le ; b. It is an error to have a range pattern
425
430
` 10..=0 ` , for example.
0 commit comments