From 114fc2201c660347b19c13df937bc3f46cc03434 Mon Sep 17 00:00:00 2001 From: yui-knk Date: Fri, 17 Nov 2017 07:39:15 +0000 Subject: [PATCH] Fix location of assignable nodes * parse.y (node_assign_gen): NODE_ATTRASGN is created before rhs is created. It is needed to set location after rhs is created to rhs range be included to the location of NODE_ATTRASGN. e.g. The locations of NODE_ATTRASGN is fixed: ``` a[1] = 2 ``` * Before ``` NODE_ATTRASGN (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 4) ``` * After ``` NODE_ATTRASGN (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 8) ``` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60821 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- parse.y | 1 + 1 file changed, 1 insertion(+) diff --git a/parse.y b/parse.y index 87085542bb..4b4c7dd4c0 100644 --- a/parse.y +++ b/parse.y @@ -10125,6 +10125,7 @@ node_assign_gen(struct parser_params *parser, NODE *lhs, NODE *rhs, const YYLTYP case NODE_ATTRASGN: case NODE_CALL: lhs->nd_args = arg_append(lhs->nd_args, rhs, location); + lhs->nd_loc = *location; break; default: