diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-21 06:40:28 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-21 06:40:28 +0000 |
commit | e9a184ed63e7bdc121b482b7c08bcca670343821 (patch) | |
tree | b573ba255db5625b70eefaca27dd9f5cc2d05a79 /iseq.c | |
parent | 05d1d29d1f4a87620371463d8c7942e170be031f (diff) |
add experimental API.
* iseq.c (rb_iseq_code_range): added to access iseq's code range.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'iseq.c')
-rw-r--r-- | iseq.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -771,6 +771,15 @@ rb_iseq_method_name(const rb_iseq_t *iseq) } } +void +rb_iseq_code_range(const rb_iseq_t *iseq, int *first_lineno, int *first_column, int *last_lineno, int *last_column) +{ + if (first_lineno) *first_lineno = iseq->body->location.code_range.first_loc.lineno; + if (first_column) *first_column = iseq->body->location.code_range.first_loc.column; + if (last_lineno) *last_lineno = iseq->body->location.code_range.last_loc.lineno;; + if (last_column) *last_column = iseq->body->location.code_range.last_loc.column; +} + VALUE rb_iseq_coverage(const rb_iseq_t *iseq) { |