From 8f3b872e30cc1055b1c5d35acfcf1ef7d483b01e Mon Sep 17 00:00:00 2001 From: Yuan Fu Date: Mon, 13 Jun 2022 23:01:04 -0700 Subject: Add new type treesit-compiled-query No intergration/interaction with the new type, just adding it. * lisp/emacs-lisp/cl-preloaded.el (cl--typeof-types): Add new type. * src/alloc.c (cleanup_vector): Add gc for the new type. * src/data.c (Ftype_of): Add switch case for the new type. (syms_of_data): Add symbols for the new type. * src/lisp.h (DEFINE_GDB_SYMBOL_BEGIN): Add new type. * src/treesit.c (Ftreesit_compiled_query_p): New function. (syms_of_treesit): Add symbol for the new type. * src/treesit.h (struct Lisp_TS_Query): New struct. (TS_COMPILED_QUERY_P, XTS_COMPILED_QUERY, CHECK_TS_COMPILED_QUERY): New macros. * src/print.c (print_vectorlike): Add printing for the new type. --- src/alloc.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/alloc.c') diff --git a/src/alloc.c b/src/alloc.c index 40a3e235eab..3c622d05ff1 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -3174,6 +3174,13 @@ cleanup_vector (struct Lisp_Vector *vector) ts_tree_delete(lisp_parser->tree); ts_parser_delete(lisp_parser->parser); } + else if (PSEUDOVECTOR_TYPEP (&vector->header, PVEC_TS_COMPILED_QUERY)) + { + struct Lisp_TS_Query *lisp_query + = PSEUDOVEC_STRUCT (vector, Lisp_TS_Query); + ts_query_delete (lisp_query->query); + ts_query_cursor_delete (lisp_query->cursor); + } #endif #ifdef HAVE_MODULES else if (PSEUDOVECTOR_TYPEP (&vector->header, PVEC_MODULE_FUNCTION)) -- cgit v1.2.3