Feature #12912 ยป endless-range.patch
parse.y | ||
---|---|---|
$$ = dispatch2(dot3, $1, $3);
|
||
%*/
|
||
}
|
||
| arg tDOT2
|
||
{
|
||
/*%%%*/
|
||
value_expr($1);
|
||
$$ = NEW_DOT2($1, NEW_LIT(INT2FIX(-1)));
|
||
/*%
|
||
$$ = dispatch2(dot2, $1, INT2FIX(-1));
|
||
%*/
|
||
}
|
||
| arg '+' arg
|
||
{
|
||
/*%%%*/
|
range.c | ||
---|---|---|
beg = RANGE_BEG(range);
|
||
end = RANGE_END(range);
|
||
if (FIXNUM_P(beg) && FIXNUM_P(end)) { /* fixnums are special */
|
||
if (FIXNUM_P(beg) && end == INT2FIX(-1)) {
|
||
long i = FIX2LONG(beg);
|
||
while (1) {
|
||
rb_yield(LONG2FIX(i++));
|
||
}
|
||
}
|
||
else if (FIXNUM_P(beg) && FIXNUM_P(end)) { /* fixnums are special */
|
||
long lim = FIX2LONG(end);
|
||
long i;
|
||