From 575993d74386157a9554e2b4f9f350d673be9613 Mon Sep 17 00:00:00 2001 From: yui-knk Date: Thu, 16 Nov 2017 01:56:54 +0000 Subject: parse.y: Fix location of asgn node * parse.y (new_op_assign_gen): Fix location of asgn node. Assignable node (e.g. NODE_LASGN) is generated before rhs is generated, so we reset the location when nd_value of asgn is fixed. e.g. : ``` a -= 10 ``` * Before ``` NODE_DASGN_CURR (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 1) ``` * After ``` NODE_DASGN_CURR (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 7) ``` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- parse.y | 1 + 1 file changed, 1 insertion(+) (limited to 'parse.y') diff --git a/parse.y b/parse.y index 857b62bfe7..120b935d39 100644 --- a/parse.y +++ b/parse.y @@ -10865,6 +10865,7 @@ new_op_assign_gen(struct parser_params *parser, NODE *lhs, ID op, NODE *rhs, con else { asgn = lhs; asgn->nd_value = new_call(gettable(vid, location), op, new_list(rhs, location), location); + asgn->nd_loc = *location; } } else { -- cgit v1.2.3