]> code.delx.au - gnu-emacs-elpa/commitdiff
Add let coloring.
authorJackson Ray Hamilton <jackson@jacksonrayhamilton.com>
Sat, 16 May 2015 23:59:57 +0000 (16:59 -0700)
committerJackson Ray Hamilton <jackson@jacksonrayhamilton.com>
Sat, 16 May 2015 23:59:57 +0000 (16:59 -0700)
context-coloring.el

index a84a1b46786a7f40e2f97e8d7739bb31efef4edf..9c3131435417357c9e215f35fa149d077a4309c6 100644 (file)
@@ -375,6 +375,7 @@ generated by `js2-mode'."
              one-word-found-p
              in-defun-p
              in-lambda-p
+             in-let-p
              in-let*-p
              defun-arglist
              defun-arg
@@ -472,10 +473,13 @@ generated by `js2-mode'."
                 (setq in-defun-p t))
                ((string-match-p "\\`lambda\\'" child-0-string)
                 (setq in-lambda-p t))
+               ((string-match-p "\\`let\\'" child-0-string)
+                (setq in-let-p t))
                ((string-match-p "\\`let\\*\\'" child-0-string)
                 (setq in-let*-p t)))))
             (when (or in-defun-p
                       in-lambda-p
+                      in-let-p
                       in-let*-p)
               (setq scope-stack (cons (context-coloring-make-scope
                                        (nth 0 ppss)
@@ -524,7 +528,8 @@ generated by `js2-mode'."
               ;; Cleanup
               (setq in-defun-p nil)
               (setq in-lambda-p nil))
-             (in-let*-p
+             ((or in-let-p
+                  in-let*-p)
               (goto-char child-0-end)
               ;; Lookahead for bindings
               (context-coloring-forward-sws)
@@ -552,6 +557,7 @@ generated by `js2-mode'."
                   (setq let-varlist (cdr let-varlist)))
                 (goto-char child-1-end))
               ;; Cleanup
+              (setq in-let-p nil)
               (setq in-let*-p nil))
              (t
               (goto-char (cond