1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-02-11 10:20:33 -08:00

Add Ftreesit_parser_tag

* lisp/treesit.el (treesit-parser-tag): Add.
* src/treesit.c (Ftreesit_parser_tag): Add.
This commit is contained in:
Yuan Fu 2023-09-06 22:15:21 -07:00
parent 8aa9dc1c0c
commit a9a096ff8b
No known key found for this signature in database
GPG key ID: 56E19BC57664A442
2 changed files with 12 additions and 0 deletions

View file

@ -56,6 +56,7 @@
(declare-function treesit-parser-list "treesit.c")
(declare-function treesit-parser-buffer "treesit.c")
(declare-function treesit-parser-language "treesit.c")
(declare-function treesit-parser-tag "treesit.c")
(declare-function treesit-parser-root-node "treesit.c")

View file

@ -1543,6 +1543,16 @@ This symbol is the one used to create the parser. */)
return XTS_PARSER (parser)->language_symbol;
}
DEFUN ("treesit-parser-tag",
Ftreesit_parser_tag, Streesit_parser_tag,
1, 1, 0,
doc: /* Return PARSER's tag. */)
(Lisp_Object parser)
{
treesit_check_parser (parser);
return XTS_PARSER (parser)->tag;
}
/* Return true if PARSER is not deleted and its buffer is live. */
static bool
treesit_parser_live_p (Lisp_Object parser)
@ -4110,6 +4120,7 @@ the symbol of that THING. For example, (or sexp sentence). */);
defsubr (&Streesit_parser_list);
defsubr (&Streesit_parser_buffer);
defsubr (&Streesit_parser_language);
defsubr (&Streesit_parser_tag);
defsubr (&Streesit_parser_root_node);
/* defsubr (&Streesit_parse_string); */