summaryrefslogtreecommitdiff
path: root/src/treesit.h
diff options
context:
space:
mode:
authorYuan Fu <casouri@gmail.com>2024-08-24 14:54:57 -0700
committerYuan Fu <casouri@gmail.com>2024-08-24 15:15:23 -0700
commit4339e70a942770ce4e17d16a9708e4bdf5630514 (patch)
treee42bd75c6b86434d9c5e3a9c501bddacf5104471 /src/treesit.h
parent32afdcca8815331f1231fe9d8279ab9914197381 (diff)
downloademacs-4339e70a942770ce4e17d16a9708e4bdf5630514.tar.gz
emacs-4339e70a942770ce4e17d16a9708e4bdf5630514.tar.bz2
emacs-4339e70a942770ce4e17d16a9708e4bdf5630514.zip
Make sure treesit-parse-string gc its temp buffer (bug#71012)
* doc/lispref/parsing.texi (Using Parser): Add notice. * lisp/treesit.el (treesit-parse-string): Remove function. * src/treesit.c (make_treesit_parser): Init the new filed. (treesit_delete_parser): Collect the temp buffer. (Ftreesit_parse_string): New function. * src/treesit.h (Lisp_TS_Parser): New field.
Diffstat (limited to 'src/treesit.h')
-rw-r--r--src/treesit.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/treesit.h b/src/treesit.h
index 3da4cc155ea..cd84fa358c5 100644
--- a/src/treesit.h
+++ b/src/treesit.h
@@ -82,6 +82,10 @@ struct Lisp_TS_Parser
/* If this field is true, parser functions raises
treesit-parser-deleted signal. */
bool deleted;
+ /* If this field is true, deleting the parser should also delete the
+ associated buffer. This is for parsers created by
+ treesit-parse-string, which uses a hidden temp buffer. */
+ bool need_to_gc_buffer;
};
/* A wrapper around a tree-sitter node. */