]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix byte-compile warning for js--treesit-defun-type-regexp
authorTheodor Thornhill <theo@thornhill.no>
Tue, 11 Oct 2022 08:03:33 +0000 (10:03 +0200)
committerYuan Fu <casouri@gmail.com>
Tue, 11 Oct 2022 18:45:50 +0000 (11:45 -0700)
* lisp/progmodes/js.el (js--treesit-defun-type-regexp): Move before
js--treesit-beginning-of-defun.

lisp/progmodes/js.el

index d831a6cf7a2330594132644629fb9c9a29631b79..1b82e204b91ff45c18fbb7b5ef4922e71b980f64 100644 (file)
@@ -3582,6 +3582,14 @@ This function can be used as a value in `which-func-functions'"
              do (setq node (treesit-node-parent node))
              finally return  (string-join name-list "."))))
 
+(defvar js--treesit-defun-type-regexp
+  (rx (or "class_declaration"
+          "method_definition"
+          "function_declaration"
+          "lexical_declaration"))
+  "Regular expression that matches type of defun nodes.
+Used in `js--treesit-beginning-of-defun' and friends.")
+
 (defun js--treesit-beginning-of-defun (&optional arg)
   "Tree-sitter `beginning-of-defun' function.
 ARG is the same as in `beginning-of-defun."
@@ -3614,14 +3622,6 @@ ARG is the same as in `end-of-defun."
                    js--treesit-defun-type-regexp 'end))
         (setq arg (1- arg))))))
 
-(defvar js--treesit-defun-type-regexp
-  (rx (or "class_declaration"
-          "method_definition"
-          "function_declaration"
-          "lexical_declaration"))
-  "Regular expression that matches type of defun nodes.
-Used in `js--treesit-beginning-of-defun' and friends.")
-
 (defun js--treesit-can-enable-p ()
   (if (and js-use-tree-sitter
            (treesit-can-enable-p)