diff options
author | Koichi Sasada <ko1@atdot.net> | 2019-07-14 15:42:55 +0900 |
---|---|---|
committer | Koichi Sasada <ko1@atdot.net> | 2019-07-14 15:46:07 +0900 |
commit | 47b04557b01dc109ccafc33db8e80148f07457a9 (patch) | |
tree | 8c11cbfd7f1982ef7284c2a10a3ddf2fbee35c1d /proc.c | |
parent | 4ce935cd5dde69b39bb98b8948d41e3afba81e33 (diff) |
Method#inspect with source location.
Method#inspect shows with source location.
[Feature #14145]
Diffstat (limited to 'proc.c')
-rw-r--r-- | proc.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -2743,6 +2743,18 @@ method_inspect(VALUE method) if (data->me->def->type == VM_METHOD_TYPE_NOTIMPLEMENTED) { rb_str_buf_cat2(str, " (not-implemented)"); } + + // parameter information + // TODO + + { // source location + VALUE loc = rb_method_location(method); + if (!NIL_P(loc)) { + rb_str_catf(str, " %"PRIsVALUE":%"PRIsVALUE, + RARRAY_AREF(loc, 0), RARRAY_AREF(loc, 1)); + } + } + rb_str_buf_cat2(str, ">"); return str; |