aboutsummaryrefslogtreecommitdiffstats
path: root/src/treesit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/treesit.c')
-rw-r--r--src/treesit.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/src/treesit.c b/src/treesit.c
index 2b3ab643fa7..775f823fb3e 100644
--- a/src/treesit.c
+++ b/src/treesit.c
@@ -627,7 +627,7 @@ make_ts_query (Lisp_Object query, const TSLanguage *language,
627 uint32_t *error_offset, TSQueryError *error_type) 627 uint32_t *error_offset, TSQueryError *error_type)
628{ 628{
629 if (CONSP (query)) 629 if (CONSP (query))
630 query = Ftreesit_expand_query (query); 630 query = Ftreesit_query_expand (query);
631 char *source = SSDATA (query); 631 char *source = SSDATA (query);
632 632
633 TSQuery *ts_query = ts_query_new (language, source, strlen (source), 633 TSQuery *ts_query = ts_query_new (language, source, strlen (source),
@@ -1360,11 +1360,9 @@ If any one of NODE1 and NODE2 is nil, return nil. */)
1360 1360
1361/*** Query functions */ 1361/*** Query functions */
1362 1362
1363/* If we decide to pre-load tree-sitter.el, maybe we can implement 1363DEFUN ("treesit-pattern-expand",
1364 this function in Lisp. */ 1364 Ftreesit_pattern_expand,
1365DEFUN ("treesit-expand-pattern", 1365 Streesit_pattern_expand, 1, 1, 0,
1366 Ftreesit_expand_pattern,
1367 Streesit_expand_pattern, 1, 1, 0,
1368 doc: /* Expand PATTERN to its string form. 1366 doc: /* Expand PATTERN to its string form.
1369 1367
1370PATTERN can be 1368PATTERN can be
@@ -1406,16 +1404,16 @@ explanation. */)
1406 if (VECTORP (pattern) || CONSP (pattern)) 1404 if (VECTORP (pattern) || CONSP (pattern))
1407 return concat3 (opening_delimeter, 1405 return concat3 (opening_delimeter,
1408 Fmapconcat (intern_c_string 1406 Fmapconcat (intern_c_string
1409 ("treesit-expand-pattern"), 1407 ("treesit-pattern-expand"),
1410 pattern, 1408 pattern,
1411 build_pure_c_string (" ")), 1409 build_pure_c_string (" ")),
1412 closing_delimiter); 1410 closing_delimiter);
1413 return CALLN (Fformat, build_pure_c_string("%S"), pattern); 1411 return CALLN (Fformat, build_pure_c_string("%S"), pattern);
1414} 1412}
1415 1413
1416DEFUN ("treesit-expand-query", 1414DEFUN ("treesit-query-expand",
1417 Ftreesit_expand_query, 1415 Ftreesit_query_expand,
1418 Streesit_expand_query, 1, 1, 0, 1416 Streesit_query_expand, 1, 1, 0,
1419 doc: /* Expand sexp QUERY to its string form. 1417 doc: /* Expand sexp QUERY to its string form.
1420 1418
1421A PATTERN in QUERY can be 1419A PATTERN in QUERY can be
@@ -1438,7 +1436,7 @@ Consult Info node `(elisp)Pattern Matching' form detailed
1438explanation. */) 1436explanation. */)
1439 (Lisp_Object query) 1437 (Lisp_Object query)
1440{ 1438{
1441 return Fmapconcat (intern_c_string ("treesit-expand-pattern"), 1439 return Fmapconcat (intern_c_string ("treesit-pattern-expand"),
1442 query, build_pure_c_string (" ")); 1440 query, build_pure_c_string (" "));
1443} 1441}
1444 1442
@@ -1922,8 +1920,8 @@ dynamic libraries, in that order. */);
1922 defsubr (&Streesit_node_descendant_for_range); 1920 defsubr (&Streesit_node_descendant_for_range);
1923 defsubr (&Streesit_node_eq); 1921 defsubr (&Streesit_node_eq);
1924 1922
1925 defsubr (&Streesit_expand_pattern); 1923 defsubr (&Streesit_pattern_expand);
1926 defsubr (&Streesit_expand_query); 1924 defsubr (&Streesit_query_expand);
1927 defsubr (&Streesit_query_compile); 1925 defsubr (&Streesit_query_compile);
1928 defsubr (&Streesit_query_capture); 1926 defsubr (&Streesit_query_capture);
1929} 1927}