aboutsummaryrefslogtreecommitdiff
path: root/src/ast_render.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-08-05 03:09:17 -0400
committerAndrew Kelley <andrew@ziglang.org>2019-08-05 03:09:17 -0400
commitdfe8c5a2e9b1778c1911e987c9286d05db307fe7 (patch)
treeedc23db0fb6afaa52e2ae9fff3ce0321d0ffe447 /src/ast_render.cpp
parenta7763c06f9941bdeccc0679abf863b21f7cc33a3 (diff)
downloadzig-dfe8c5a2e9b1778c1911e987c9286d05db307fe7.tar.gz
zig-dfe8c5a2e9b1778c1911e987c9286d05db307fe7.zip
add a src() method to AstNode to aid debugging
Diffstat (limited to 'src/ast_render.cpp')
-rw-r--r--src/ast_render.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ast_render.cpp b/src/ast_render.cpp
index e54bd58676..dd4d9cf646 100644
--- a/src/ast_render.cpp
+++ b/src/ast_render.cpp
@@ -1186,3 +1186,9 @@ void ast_render(FILE *f, AstNode *node, int indent_size) {
render_node_grouped(&ar, node);
}
+
+void AstNode::src() {
+ fprintf(stderr, "%s:%" ZIG_PRI_usize ":%" ZIG_PRI_usize "\n",
+ buf_ptr(this->owner->data.structure.root_struct->path),
+ this->line + 1, this->column + 1);
+}