]> code.delx.au - gnu-emacs-elpa/commitdiff
Fix infinite loop when parsing let.
authorJackson Ray Hamilton <jackson@jacksonrayhamilton.com>
Sun, 7 Jun 2015 05:14:31 +0000 (22:14 -0700)
committerJackson Ray Hamilton <jackson@jacksonrayhamilton.com>
Sun, 7 Jun 2015 05:14:31 +0000 (22:14 -0700)
context-coloring.el
test/context-coloring-test.el
test/fixtures/let.el

index ffed467c7ef455d5aa0a453b341d8d24dc648536..753f4caeeb26949ba9579bd847ce61f611bd967d 100644 (file)
@@ -555,7 +555,10 @@ after its own initializer is parsed."
             (= syntax-code context-coloring-SYMBOL-CODE))
         (context-coloring-elisp-parse-bindable
          (lambda (var)
-           (push var varlist)))))
+           (push var varlist))))
+       (t
+        ;; Ignore artifacts.
+        (context-coloring-elisp-forward-sexp)))
       (when (eq type 'let*)
         (context-coloring-elisp-add-variable (pop varlist)))
       (context-coloring-elisp-forward-sws))
index bd37b3bc3dac4ee31885fcc01095e7bb2fd3ae52..500f57e4df950c9e0c64940908e3a50be137586f 100644 (file)
@@ -1128,15 +1128,16 @@ ssssssssssss0"))
   (lambda ()
     (context-coloring-test-assert-coloring "
 1111 11
-      cccccccccc
-      11 sss1
       11 01
       11 00001
       11 2222 22
                22 02
                22 000022
            2222 2 2 2 00002211
-  1111 1 1 1 000011")))
+  1111 1 1 1 000011
+
+1111 cc ccccccc
+    111 sss11")))
 
 (context-coloring-test-deftest-emacs-lisp let*
   (lambda ()
index ac3de2d4a377328e74c62b270a0648b0fce3bd1f..85bf90e7933434ee26918f0baa6464d5ba65fa06 100644 (file)
@@ -1,6 +1,4 @@
 (let (a
-      ;; comment
-      (s "s")
       (b a)
       (c free)
       (d (let (a
@@ -8,3 +6,6 @@
                (c free))
            (and a b c free))))
   (and a b c free))
+
+(let ;; comment
+    (_a "s"))