From a6a8576e877b02b83cabd0e712ecd377e7bc156b Mon Sep 17 00:00:00 2001 From: Kenta Murata Date: Wed, 21 Oct 2020 02:40:18 +0900 Subject: Feature #16812: Allow slicing arrays with ArithmeticSequence (#3241) * Support ArithmeticSequence in Array#slice * Extract rb_range_component_beg_len * Use rb_range_values to check Range object * Fix ary_make_partial_step * Fix for negative step cases * range.c: Describe the role of err argument in rb_range_component_beg_len * Raise a RangeError when an arithmetic sequence refers the outside of an array [Feature #16812] --- internal/range.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'internal') diff --git a/internal/range.h b/internal/range.h index 0b60f42298..4fe6037c89 100644 --- a/internal/range.h +++ b/internal/range.h @@ -34,4 +34,8 @@ RANGE_EXCL(VALUE r) return RSTRUCT(r)->as.ary[2]; } +VALUE +rb_range_component_beg_len(VALUE b, VALUE e, int excl, + long *begp, long *lenp, long len, int err); + #endif /* INTERNAL_RANGE_H */ -- cgit v1.2.3