aboutsummaryrefslogtreecommitdiffstats
path: root/proc.c
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2019-07-14 15:42:55 +0900
committerKoichi Sasada <ko1@atdot.net>2019-07-14 15:46:07 +0900
commit47b04557b01dc109ccafc33db8e80148f07457a9 (patch)
tree8c11cbfd7f1982ef7284c2a10a3ddf2fbee35c1d /proc.c
parent4ce935cd5dde69b39bb98b8948d41e3afba81e33 (diff)
downloadruby-47b04557b01dc109ccafc33db8e80148f07457a9.tar.gz
Method#inspect with source location.
Method#inspect shows with source location. [Feature #14145]
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/proc.c b/proc.c
index 7f4f2d46b6..217d228a8a 100644
--- a/proc.c
+++ b/proc.c
@@ -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;