Project

General

Profile

Bug #14824

Endless Range Support in irb

Added by jeremyevans0 (Jeremy Evans) over 2 years ago. Updated about 1 hour ago.

Status:
Assigned
Priority:
Normal
Target version:
-
ruby -v:
ruby 2.6.0preview2 (2018-05-31 trunk 63539) [x86_64-openbsd]
[ruby-core:87394]
Tags:

Description

irb currently doesn't have great support for endless ranges, forcing you to use explicit parentheses around the endless range. Without explicit parentheses, it treats the endless range as a line continuation.

irb(main):001:0> 1..
irb(main):002:0* ;
=> 1..
irb(main):003:0> (1..)
=> 1..
irb(main):004:0>

Ranges with ends do not require parentheses in irb, and endless ranges should have the same behavior.


Related issues

Related to Ruby master - Feature #14808: Last token of endless range should have EXPR_ENDRejectedActions

Also available in: Atom PDF