]> code.delx.au - gnu-emacs-elpa/commitdiff
Don't color function calls as level 0.
authorJackson Ray Hamilton <jackson@jacksonrayhamilton.com>
Sat, 16 May 2015 23:37:14 +0000 (16:37 -0700)
committerJackson Ray Hamilton <jackson@jacksonrayhamilton.com>
Sat, 16 May 2015 23:37:14 +0000 (16:37 -0700)
context-coloring.el
test/context-coloring-test.el

index 3a57b3f1d5de5f0087a646b024bf47ba3898e053..0f65b571fe32e5be1272ce9b791033dc997a54b7 100644 (file)
@@ -376,7 +376,6 @@ generated by `js2-mode'."
              in-defun-p
              in-lambda-p
              in-let*-p
-             function-call-p
              defun-arglist
              defun-arg
              let-varlist
@@ -472,10 +471,7 @@ generated by `js2-mode'."
                ((string-match-p "\\`lambda\\'" child-0-string)
                 (setq in-lambda-p t))
                ((string-match-p "\\`let\\*\\'" child-0-string)
-                (setq in-let*-p t))
-               ;; Assume a global function call
-               (t
-                (setq function-call-p t)))))
+                (setq in-let*-p t)))))
             (when (or in-defun-p
                       in-lambda-p
                       in-let*-p)
@@ -489,9 +485,6 @@ generated by `js2-mode'."
                                               (scan-sexps token-pos 1)
                                               (context-coloring-scope-get-level
                                                (car scope-stack)))
-            (when function-call-p
-              (context-coloring-colorize-region child-0-pos child-0-end 0)
-              (setq function-call-p nil))
             (cond
              ((or in-defun-p
                   in-lambda-p)
index 148ddac7ca1c5f0c4a7fb6f988c4fc1ce612c73a..c8a3532607a2cf11151929d63728b9a0d4e6126c 100644 (file)
@@ -1090,7 +1090,7 @@ see that function."
   (lambda ()
     (context-coloring-test-assert-coloring "
 111111 000 1111 111 111111111 1111
-  10 111 111 111 000011
+  11 111 111 111 000011
 
 0000 0 0 00
 
@@ -1101,16 +1101,16 @@ see that function."
   (lambda ()
     (context-coloring-test-assert-coloring "
 00000000 1111111 1111
-           10000000 11 2222222 2222
-                         200 22 12 2221 111 0 00")))
+           11111111 11 2222222 2222
+                         222 22 12 2221 111 0 00")))
 
 (context-coloring-test-deftest-emacs-lisp-mode quote
   (lambda ()
     (context-coloring-test-assert-coloring "
 (xxxxx x (x)
   (xx (xx x 111
-      100000 1 111 111
-      100000 1 1111000000 11 111 1 110 1 00001 10000 11 00001 1 100001111")))
+      111111 1 111 111
+      111111 1 1111111111 11 111 1 111 1 00001 10000 11 00001 1 100001111")))
 
 (context-coloring-test-deftest-emacs-lisp-mode comment
   (lambda ()
@@ -1118,7 +1118,7 @@ see that function."
     (context-coloring-test-assert-coloring "
 (xxxxx x ()
   (xx (x xxxxx-xxxx xx)   ;;;;;;;;;;
-      (0 xxxxx-xxxx xx))) ;;;;;;;;;;"))
+      11 00000-0000 11))) ;;;;;;;;;;"))
   :setup (lambda ()
            (setq context-coloring-syntactic-comments t)))
 
@@ -1134,7 +1134,7 @@ see that function."
   (lambda ()
     (context-coloring-test-assert-coloring "
 (xxxxx x ()
-  (0 0 1 11 11 111 11 1 111))")))
+  (x x 1 11 11 111 11 1 111))")))
 
 (context-coloring-test-deftest-emacs-lisp-mode let*
   (lambda ()