Skip to content

Ruby 2.6: Add endless range#5540

Merged
enebo merged 3 commits intojruby:ruby-2.6from
nomadium:ruby-2.6-add-endless-range
Dec 26, 2018
Merged

Ruby 2.6: Add endless range#5540
enebo merged 3 commits intojruby:ruby-2.6from
nomadium:ruby-2.6-add-endless-range

Conversation

@nomadium
Copy link
Contributor

Hi folks,

This PR implements another Ruby 2.6 language feature: Introduce endless ranges.

For more information, please see feature #12912. [1]

All its related tests are passing. [2] .. [19]

For reference, I include a link to the commit introducing the functionality in MRI. [20]

Thanks in advance for any feedback.

Note: Other methods in the Range class require changes to support or raise errors on endless ranges (e.g. #last, #max, #size and #to_a). I'll address that in subsequent commits or in a different PR. This PR is already long enough and I wanted to gather feedback to check if I'm going in the right direction.

  1. https://bugs.ruby-lang.org/issues/12912
  2. https://github.com/ruby/ruby/blob/v2_6_0/test/ruby/test_array.rb#L29-L55
  3. https://github.com/ruby/ruby/blob/v2_6_0/test/ruby/test_array.rb#L186-L209
  4. https://github.com/ruby/ruby/blob/v2_6_0/test/ruby/test_array.rb#L342-L385
  5. https://github.com/ruby/ruby/blob/v2_6_0/test/ruby/test_array.rb#L387-L484
  6. https://github.com/ruby/ruby/blob/v2_6_0/test/ruby/test_array.rb#L1428-L1469
  7. https://github.com/ruby/ruby/blob/v2_6_0/test/ruby/test_range.rb#L9-L24
  8. https://github.com/ruby/ruby/blob/v2_6_0/test/ruby/test_range.rb#L32-L39
  9. https://github.com/ruby/ruby/blob/v2_6_0/test/ruby/test_range.rb#L41-L50
  10. https://github.com/ruby/ruby/blob/v2_6_0/test/ruby/test_range.rb#L137-L146
  11. https://github.com/ruby/ruby/blob/v2_6_0/test/ruby/test_range.rb#L152-L157
  12. https://github.com/ruby/ruby/blob/v2_6_0/test/ruby/test_range.rb#L159-L178
  13. https://github.com/ruby/ruby/blob/v2_6_0/test/ruby/test_range.rb#L180-L198
  14. https://github.com/ruby/ruby/blob/v2_6_0/test/ruby/test_range.rb#L200-L206
  15. https://github.com/ruby/ruby/blob/v2_6_0/test/ruby/test_range.rb#L208-L323
  16. https://github.com/ruby/ruby/blob/v2_6_0/test/ruby/test_range.rb#L343-L405
  17. https://github.com/ruby/ruby/blob/v2_6_0/test/ruby/test_range.rb#L407-L414
  18. https://github.com/ruby/ruby/blob/v2_6_0/test/ruby/test_range.rb#L440-L450
  19. https://github.com/ruby/ruby/blob/v2_6_0/test/ruby/test_range.rb#L452-L462
  20. ruby/ruby@7f95eed

For more information, please see feature #12912.
For more information, please see feature #12912.
@enebo enebo added this to the JRuby 9.3.0.0 milestone Dec 26, 2018
@enebo enebo merged commit 355887f into jruby:ruby-2.6 Dec 26, 2018
@enebo
Copy link
Member

enebo commented Dec 26, 2018

@nomadium awesome JAY GENERATION!! :) Thanks for updating this. I am on xmas break and was bothered this syntax was not added before I went on it.

@nomadium nomadium deleted the ruby-2.6-add-endless-range branch December 26, 2018 21:03
@nomadium
Copy link
Contributor Author

@enebo No problem, I'm glad to be able to contribute! I found that feature interesting since it's the first time I implement a change in jruby that required me to make changes to the syntax. So, it's really cool to get it right.

On a different topic, for some reason the spec:fast test suite is failing in ruby-2.6 branch so I'll take a closer look to that so see what's wrong.

Enjoy your break!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants