From 08a1c32d0bcaa9369a34e7f7d6d01c3885f62e21 Mon Sep 17 00:00:00 2001 From: Yuan Fu Date: Sat, 24 Sep 2022 19:19:03 -0700 Subject: [PATCH] Improve printing treesit nodes * src/print.c (print_vectorlike): Instead of position, print the type of the node. --- src/print.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/print.c b/src/print.c index 12b50874359..4f41448d861 100644 --- a/src/print.c +++ b/src/print.c @@ -2024,12 +2024,15 @@ print_vectorlike (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag, printchar ('>', printcharfun); break; case PVEC_TS_NODE: - print_c_string ("#> or + #>. */ + print_c_string ("#node); + const char *delim1 = named ? "(" : "\""; + const char *delim2 = named ? ")" : "\""; + print_c_string (delim1, printcharfun); + print_string (Ftreesit_node_type (obj), printcharfun); + print_c_string (delim2, printcharfun); print_c_string (" in ", printcharfun); print_object (XTS_PARSER (XTS_NODE (obj)->parser)->buffer, printcharfun, escapeflag); -- 2.39.5