aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-23 14:15:27 +0000
committeryui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-23 14:15:27 +0000
commitf8523d35bf3e8ec4a705b1dd45648e1b4352199a (patch)
treef9e7c6076e8cdbc54a240303740274251079b002
parentdd979f9d6959919765e20f369ac3fe3ae95958ac (diff)
downloadruby-f8523d35bf3e8ec4a705b1dd45648e1b4352199a.tar.gz
parse.y: Fix a location of serial NODE_AND/NODE_OR
* parse.y (logop_gen): Update the last location of NODE_AND/NODE_OR when NODE is appended to the last. e.g. The locations of NODE_AND is fixed: ``` a && b && c ``` * Before ``` NODE_AND (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 6) ``` * After ``` NODE_AND (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 11) ``` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60887 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--parse.y1
1 files changed, 1 insertions, 0 deletions
diff --git a/parse.y b/parse.y
index f19e612df9..1ef3a10cfa 100644
--- a/parse.y
+++ b/parse.y
@@ -10637,6 +10637,7 @@ logop_gen(struct parser_params *parser, enum node_type type, NODE *left, NODE *r
}
node->nd_2nd = NEW_NODE(type, second, right, 0);
node->nd_2nd->nd_loc = *location;
+ left->nd_loc.last_loc = location->last_loc;
return left;
}
op = NEW_NODE(type, left, right, 0);