summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-06-13 11:00:28 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-06-13 11:00:28 +0000
commit606d6b34706c590fe0449b0c160281e729be0484 (patch)
tree7e95a9e7da6913fde1d89a51a31a38c5e5297f4b /parse.y
parent4f4ed3e9eaea5c90c23c1bbfb7c1ff08331ad18a (diff)
Revert "range.c: prohibit `(1..nil)`"
This reverts commit a44c010764a16ae09aaed49d76eec055ca0057c8. Refs #14845. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y12
1 files changed, 10 insertions, 2 deletions
diff --git a/parse.y b/parse.y
index 53ad745ec9..b1ddc1bf1c 100644
--- a/parse.y
+++ b/parse.y
@@ -1916,16 +1916,24 @@ arg : lhs '=' arg_rhs
| arg tDOT2
{
/*%%%*/
+ YYLTYPE loc;
+ loc.beg_pos = @2.end_pos;
+ loc.end_pos = @2.end_pos;
+
value_expr($1);
- $$ = NEW_DOT2($1, 0, &@$);
+ $$ = NEW_DOT2($1, new_nil(&loc), &@$);
/*% %*/
/*% ripper: dot2!($1, Qnil) %*/
}
| arg tDOT3
{
/*%%%*/
+ YYLTYPE loc;
+ loc.beg_pos = @2.end_pos;
+ loc.end_pos = @2.end_pos;
+
value_expr($1);
- $$ = NEW_DOT3($1, 0, &@$);
+ $$ = NEW_DOT3($1, new_nil(&loc), &@$);
/*% %*/
/*% ripper: dot3!($1, Qnil) %*/
}