summaryrefslogtreecommitdiff
path: root/src/alloc.c
diff options
context:
space:
mode:
authorYuan Fu <casouri@gmail.com>2022-06-13 23:01:04 -0700
committerYuan Fu <casouri@gmail.com>2022-06-14 11:44:04 -0700
commit8f3b872e30cc1055b1c5d35acfcf1ef7d483b01e (patch)
tree429020abb7617471efffd8f61143f7729eee3b21 /src/alloc.c
parenta73f2b9990465820d80c58ed25208b72731d410d (diff)
downloademacs-8f3b872e30cc1055b1c5d35acfcf1ef7d483b01e.tar.gz
emacs-8f3b872e30cc1055b1c5d35acfcf1ef7d483b01e.tar.bz2
emacs-8f3b872e30cc1055b1c5d35acfcf1ef7d483b01e.zip
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.
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c7
1 files changed, 7 insertions, 0 deletions
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))