summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authoryui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-05-10 06:34:20 +0000
committeryui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-05-10 06:34:20 +0000
commit5afa84b028ceed0669c0a52bd00e24f72509aabb (patch)
tree58409258d899362dbb7e37151a25fa47876161c1 /parse.y
parent18b2cee2069d57d80c67faee84d9c0c906cbb1b7 (diff)
parse.y: Fix locations of NODE_NIL in endless ranges.
* parse.y: Fix to start with the end of dots. e.g. The locations of the NODE_NIL is fixed: ``` 1.. ``` * Before ``` NODE_NIL (line: 1, location: (1,0)-(1,3)) ``` * After ``` NODE_NIL (line: 1, location: (1,3)-(1,3)) ``` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63391 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 f134e15270..72ee78e7fa 100644
--- a/parse.y
+++ b/parse.y
@@ -1906,16 +1906,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, new_nil(&@$), &@$);
+ $$ = 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, new_nil(&@$), &@$);
+ $$ = NEW_DOT3($1, new_nil(&loc), &@$);
/*% %*/
/*% ripper: dot3!($1, Qnil) %*/
}