diff options
| author | Po Lu | 2023-02-11 09:26:11 +0800 |
|---|---|---|
| committer | Po Lu | 2023-02-18 11:01:32 +0800 |
| commit | 13fd7667f9c7fe5a4588bcae427e2da1ce368fe0 (patch) | |
| tree | 3553b4d94b1c0ea37de466678b625c5fc01b77a1 /src | |
| parent | a40b1745d4ade399852ea15a60c07e63907eb298 (diff) | |
| download | emacs-13fd7667f9c7fe5a4588bcae427e2da1ce368fe0.tar.gz emacs-13fd7667f9c7fe5a4588bcae427e2da1ce368fe0.zip | |
; * src/treesit.c: Improve sectioning.
Diffstat (limited to 'src')
| -rw-r--r-- | src/treesit.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/treesit.c b/src/treesit.c index 08119f149b7..e1d6f1ef79f 100644 --- a/src/treesit.c +++ b/src/treesit.c | |||
| @@ -720,6 +720,7 @@ Return nil if a grammar library for LANGUAGE is not available. */) | |||
| 720 | } | 720 | } |
| 721 | } | 721 | } |
| 722 | 722 | ||
| 723 | |||
| 723 | /*** Parsing functions */ | 724 | /*** Parsing functions */ |
| 724 | 725 | ||
| 725 | static void | 726 | static void |
| @@ -1113,6 +1114,7 @@ treesit_read_buffer (void *parser, uint32_t byte_index, | |||
| 1113 | return beg; | 1114 | return beg; |
| 1114 | } | 1115 | } |
| 1115 | 1116 | ||
| 1117 | |||
| 1116 | /*** Functions for parser and node object */ | 1118 | /*** Functions for parser and node object */ |
| 1117 | 1119 | ||
| 1118 | /* Wrap the parser in a Lisp_Object to be used in the Lisp | 1120 | /* 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, | |||
| 1275 | return treesit_query; | 1277 | return treesit_query; |
| 1276 | } | 1278 | } |
| 1277 | 1279 | ||
| 1280 | |||
| 1281 | /* Lisp definitions. */ | ||
| 1282 | |||
| 1278 | DEFUN ("treesit-parser-p", | 1283 | DEFUN ("treesit-parser-p", |
| 1279 | Ftreesit_parser_p, Streesit_parser_p, 1, 1, 0, | 1284 | Ftreesit_parser_p, Streesit_parser_p, 1, 1, 0, |
| 1280 | doc: /* Return t if OBJECT is a tree-sitter parser. */) | 1285 | doc: /* Return t if OBJECT is a tree-sitter parser. */) |
| @@ -1493,6 +1498,7 @@ treesit_parser_live_p (Lisp_Object parser) | |||
| 1493 | (!NILP (Fbuffer_live_p (XTS_PARSER (parser)->buffer)))); | 1498 | (!NILP (Fbuffer_live_p (XTS_PARSER (parser)->buffer)))); |
| 1494 | } | 1499 | } |
| 1495 | 1500 | ||
| 1501 | |||
| 1496 | /*** Parser API */ | 1502 | /*** Parser API */ |
| 1497 | 1503 | ||
| 1498 | DEFUN ("treesit-parser-root-node", | 1504 | DEFUN ("treesit-parser-root-node", |
| @@ -1739,6 +1745,7 @@ positions. PARSER is the parser issuing the notification. */) | |||
| 1739 | return Qnil; | 1745 | return Qnil; |
| 1740 | } | 1746 | } |
| 1741 | 1747 | ||
| 1748 | |||
| 1742 | /*** Node API */ | 1749 | /*** Node API */ |
| 1743 | 1750 | ||
| 1744 | /* Check that OBJ is a positive integer and signal an error if | 1751 | /* Check that OBJ is a positive integer and signal an error if |
| @@ -2261,6 +2268,7 @@ produced by tree-sitter. */) | |||
| 2261 | return same_node ? Qt : Qnil; | 2268 | return same_node ? Qt : Qnil; |
| 2262 | } | 2269 | } |
| 2263 | 2270 | ||
| 2271 | |||
| 2264 | /*** Query functions */ | 2272 | /*** Query functions */ |
| 2265 | 2273 | ||
| 2266 | DEFUN ("treesit-pattern-expand", | 2274 | DEFUN ("treesit-pattern-expand", |
| @@ -2835,6 +2843,7 @@ the query. */) | |||
| 2835 | return Fnreverse (result); | 2843 | return Fnreverse (result); |
| 2836 | } | 2844 | } |
| 2837 | 2845 | ||
| 2846 | |||
| 2838 | /*** Navigation */ | 2847 | /*** Navigation */ |
| 2839 | 2848 | ||
| 2840 | static inline void | 2849 | static inline void |
| @@ -3455,7 +3464,7 @@ DEFUN ("treesit-available-p", Ftreesit_available_p, | |||
| 3455 | #endif | 3464 | #endif |
| 3456 | } | 3465 | } |
| 3457 | 3466 | ||
| 3458 | 3467 | ||
| 3459 | /*** Initialization */ | 3468 | /*** Initialization */ |
| 3460 | 3469 | ||
| 3461 | /* Initialize the tree-sitter routines. */ | 3470 | /* Initialize the tree-sitter routines. */ |