diff options
author | yui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-13 00:14:33 +0000 |
---|---|---|
committer | yui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-13 00:14:33 +0000 |
commit | 1ef7b0cd5a5717a1f6e18d41b85124fba312010f (patch) | |
tree | 273d5fc2c2fd83b96875021359b7afff214a97a5 /node.c | |
parent | a82aaea71902bd18b87179698d88ca4f9fa0359b (diff) | |
download | ruby-1ef7b0cd5a5717a1f6e18d41b85124fba312010f.tar.gz |
Store last location of a node on RNode
* node.c (rb_node_init): Initialize last location with 0.
* node.h (struct rb_code_range_struct): Define a structure
which contains first location and last location of a node.
* node.h (struct RNode): Use rb_code_range_t to store last
location of a node.
* node.h (nd_column, nd_set_column, nd_lineno, nd_set_lineno):
Follow-up the change of struct RNode.
* node.h (nd_last_column, nd_set_last_column, nd_last_lineno, nd_set_last_lineno):
Define getter/setter macros for last location of RNode.
* parse.y : Set last location of tokens.
Thanks to Yusuke Endoh (mame) for design of data structures.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'node.c')
-rw-r--r-- | node.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -1069,8 +1069,10 @@ rb_node_init(NODE *n, enum node_type type, VALUE a0, VALUE a1, VALUE a2) n->u1.value = a0; n->u2.value = a1; n->u3.value = a2; - n->nd_first_loc.lineno = 0; - n->nd_first_loc.column = 0; + n->nd_loc.first_loc.lineno = 0; + n->nd_loc.first_loc.column = 0; + n->nd_loc.last_loc.lineno = 0; + n->nd_loc.last_loc.column = 0; } typedef struct node_buffer_elem_struct { |