summaryrefslogtreecommitdiff
path: root/debug.c
diff options
context:
space:
mode:
authoryui-knk <spiketeika@gmail.com>2024-01-05 21:30:42 +0900
committerYuichiro Kaneko <spiketeika@gmail.com>2024-01-06 09:32:45 +0900
commitda23f8fe1ac4ebf5d733b50241ddc1f0556ab40f (patch)
treec82be6148d65477858b8ba1eafd2a3ab20af1095 /debug.c
parent7f9c174102d0e2369befc7b88f2c073becaa7560 (diff)
Print node id and location by ruby_debug_print_node
Diffstat (limited to 'debug.c')
-rw-r--r--debug.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/debug.c b/debug.c
index e84e3d602a..4f2523ab89 100644
--- a/debug.c
+++ b/debug.c
@@ -147,8 +147,10 @@ NODE *
ruby_debug_print_node(int level, int debug_level, const char *header, const NODE *node)
{
if (level < debug_level) {
- fprintf(stderr, "DBG> %s: %s (%u)\n", header,
- ruby_node_name(nd_type(node)), nd_line(node));
+ fprintf(stderr, "DBG> %s: %s (id: %d, line: %d, location: (%d,%d)-(%d,%d))\n",
+ header, ruby_node_name(nd_type(node)), nd_node_id(node), nd_line(node),
+ nd_first_lineno(node), nd_first_column(node),
+ nd_last_lineno(node), nd_last_column(node));
}
return (NODE *)node;
}