| author | |
| committer | |
| log | dfe8c5a2e9b1778c1911e987c9286d05db307fe7 |
| tree | edc23db0fb6afaa52e2ae9fff3ce0321d0ffe447 |
| parent | a7763c06f9941bdeccc0679abf863b21f7cc33a3 |
| signature |
2 files changed, 10 insertions(+), 0 deletions(-)
src/all_types.hpp+4| ... | @@ -1009,6 +1009,10 @@ struct AstNode { | ... | @@ -1009,6 +1009,10 @@ struct AstNode { |
| 1009 | AstNodeAnyFrameType anyframe_type; | 1009 | AstNodeAnyFrameType anyframe_type; |
| 1010 | AstNodeEnumLiteral enum_literal; | 1010 | AstNodeEnumLiteral enum_literal; |
| 1011 | } data; | 1011 | } data; |
| 1012 | |||
| 1013 | // This is a function for use in the debugger to print | ||
| 1014 | // the source location. | ||
| 1015 | void src(); | ||
| 1012 | }; | 1016 | }; |
| 1013 | 1017 | ||
| 1014 | // this struct is allocated with allocate_nonzero | 1018 | // this struct is allocated with allocate_nonzero |
src/ast_render.cpp+6| ... | @@ -1186,3 +1186,9 @@ void ast_render(FILE *f, AstNode *node, int indent_size) { | ... | @@ -1186,3 +1186,9 @@ void ast_render(FILE *f, AstNode *node, int indent_size) { |
| 1186 | 1186 | ||
| 1187 | render_node_grouped(&ar, node); | 1187 | render_node_grouped(&ar, node); |
| 1188 | } | 1188 | } |
| 1189 | |||
| 1190 | void AstNode::src() { | ||
| 1191 | fprintf(stderr, "%s:%" ZIG_PRI_usize ":%" ZIG_PRI_usize "\n", | ||
| 1192 | buf_ptr(this->owner->data.structure.root_struct->path), | ||
| 1193 | this->line + 1, this->column + 1); | ||
| 1194 | } |