From: Yuan Fu Date: Tue, 21 Mar 2023 23:13:23 +0000 (-0700) Subject: ; Minor refactor of Ftreesit_query_capture X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=455412dd89ddb1bf39b4ca8f2befc940a350f9d0;p=emacs.git ; Minor refactor of Ftreesit_query_capture * src/treesit.c (Ftreesit_query_capture): Move around some variable initialization. --- diff --git a/src/treesit.c b/src/treesit.c index e728d697c9d..cd98ff38293 100644 --- a/src/treesit.c +++ b/src/treesit.c @@ -2770,12 +2770,9 @@ the query. */) Lisp_Object lisp_node = treesit_resolve_node (node); /* Extract C values from Lisp objects. */ - TSNode treesit_node - = XTS_NODE (lisp_node)->node; - Lisp_Object lisp_parser - = XTS_NODE (lisp_node)->parser; - ptrdiff_t visible_beg - = XTS_PARSER (XTS_NODE (lisp_node)->parser)->visible_beg; + TSNode treesit_node = XTS_NODE (lisp_node)->node; + Lisp_Object lisp_parser = XTS_NODE (lisp_node)->parser; + const TSLanguage *lang = ts_parser_language (XTS_PARSER (lisp_parser)->parser); @@ -2804,6 +2801,8 @@ the query. */) /* Set query range. */ if (!NILP (beg) && !NILP (end)) { + ptrdiff_t visible_beg + = XTS_PARSER (XTS_NODE (lisp_node)->parser)->visible_beg; ptrdiff_t beg_byte = CHAR_TO_BYTE (XFIXNUM (beg)); ptrdiff_t end_byte = CHAR_TO_BYTE (XFIXNUM (end)); /* We never let tree-sitter run on buffers too large, so these