; * src/treesit.c: Improve sectioning.

This commit is contained in:
Po Lu 2023-02-11 09:26:11 +08:00
parent a40b1745d4
commit 13fd7667f9

View file

@ -720,6 +720,7 @@ Return nil if a grammar library for LANGUAGE is not available. */)
} }
} }
/*** Parsing functions */ /*** Parsing functions */
static void static void
@ -1113,6 +1114,7 @@ treesit_read_buffer (void *parser, uint32_t byte_index,
return beg; return beg;
} }
/*** Functions for parser and node object */ /*** Functions for parser and node object */
/* Wrap the parser in a Lisp_Object to be used in the Lisp /* Wrap the parser in a Lisp_Object to be used in the Lisp
@ -1275,6 +1277,9 @@ treesit_ensure_query_compiled (Lisp_Object query, Lisp_Object *signal_symbol,
return treesit_query; return treesit_query;
} }
/* Lisp definitions. */
DEFUN ("treesit-parser-p", DEFUN ("treesit-parser-p",
Ftreesit_parser_p, Streesit_parser_p, 1, 1, 0, Ftreesit_parser_p, Streesit_parser_p, 1, 1, 0,
doc: /* Return t if OBJECT is a tree-sitter parser. */) doc: /* Return t if OBJECT is a tree-sitter parser. */)
@ -1493,6 +1498,7 @@ treesit_parser_live_p (Lisp_Object parser)
(!NILP (Fbuffer_live_p (XTS_PARSER (parser)->buffer)))); (!NILP (Fbuffer_live_p (XTS_PARSER (parser)->buffer))));
} }
/*** Parser API */ /*** Parser API */
DEFUN ("treesit-parser-root-node", DEFUN ("treesit-parser-root-node",
@ -1739,6 +1745,7 @@ positions. PARSER is the parser issuing the notification. */)
return Qnil; return Qnil;
} }
/*** Node API */ /*** Node API */
/* Check that OBJ is a positive integer and signal an error if /* Check that OBJ is a positive integer and signal an error if
@ -2261,6 +2268,7 @@ produced by tree-sitter. */)
return same_node ? Qt : Qnil; return same_node ? Qt : Qnil;
} }
/*** Query functions */ /*** Query functions */
DEFUN ("treesit-pattern-expand", DEFUN ("treesit-pattern-expand",
@ -2835,6 +2843,7 @@ the query. */)
return Fnreverse (result); return Fnreverse (result);
} }
/*** Navigation */ /*** Navigation */
static inline void static inline void
@ -3455,7 +3464,7 @@ DEFUN ("treesit-available-p", Ftreesit_available_p,
#endif #endif
} }
/*** Initialization */ /*** Initialization */
/* Initialize the tree-sitter routines. */ /* Initialize the tree-sitter routines. */