emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/tree-sitter c4179117af: Fix byte-compile warning for js--treesit


From: Yuan Fu
Subject: feature/tree-sitter c4179117af: Fix byte-compile warning for js--treesit-defun-type-regexp
Date: Tue, 11 Oct 2022 14:46:20 -0400 (EDT)

branch: feature/tree-sitter
commit c4179117afd37a03a7ba322e66b5bd6bae5637bd
Author: Theodor Thornhill <theo@thornhill.no>
Commit: Yuan Fu <casouri@gmail.com>

    Fix byte-compile warning for js--treesit-defun-type-regexp
    
    * lisp/progmodes/js.el (js--treesit-defun-type-regexp): Move before
    js--treesit-beginning-of-defun.
---
 lisp/progmodes/js.el | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index d831a6cf7a..1b82e204b9 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]