diff options
| author | Yuan Fu | 2022-09-20 18:01:15 -0700 |
|---|---|---|
| committer | Yuan Fu | 2022-09-20 18:36:49 -0700 |
| commit | 55e01229dafad75affbe49446f2aef3fbca2f3a8 (patch) | |
| tree | 7103d58d5e9ac268d3f8f3bf07efd6432f6c8dad /src/treesit.c | |
| parent | 1d3234988a32d32570729b4dfcc00712636ec450 (diff) | |
| download | emacs-55e01229dafad75affbe49446f2aef3fbca2f3a8.tar.gz emacs-55e01229dafad75affbe49446f2aef3fbca2f3a8.zip | |
Rename treesit-expand-query/pattern
* src/treesit.c (treesit-expand-pattern): Rename to
treesit-patter-expand.
(treesit-expand-query): Rename to treesit-query-expand.
(make_ts_query): Use new name.
Diffstat (limited to 'src/treesit.c')
| -rw-r--r-- | src/treesit.c | 24 |
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 | 1363 | DEFUN ("treesit-pattern-expand", |
| 1364 | this function in Lisp. */ | 1364 | Ftreesit_pattern_expand, |
| 1365 | DEFUN ("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 | ||
| 1370 | PATTERN can be | 1368 | PATTERN 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 | ||
| 1416 | DEFUN ("treesit-expand-query", | 1414 | DEFUN ("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 | ||
| 1421 | A PATTERN in QUERY can be | 1419 | A PATTERN in QUERY can be |
| @@ -1438,7 +1436,7 @@ Consult Info node `(elisp)Pattern Matching' form detailed | |||
| 1438 | explanation. */) | 1436 | explanation. */) |
| 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 | } |