emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] master 52e3d07 1/9: Fix bug where empty varlists weren't parsed.


From: Jackson Ray Hamilton
Subject: [elpa] master 52e3d07 1/9: Fix bug where empty varlists weren't parsed.
Date: Fri, 13 Nov 2015 05:39:52 +0000

branch: master
commit 52e3d07376ef5e951a71cb8fc77b9f48962f7d42
Author: Jackson Ray Hamilton <address@hidden>
Commit: Jackson Ray Hamilton <address@hidden>

    Fix bug where empty varlists weren't parsed.
---
 context-coloring.el            |    6 ++++--
 test/context-coloring-test.el  |   10 ++++++++++
 test/fixtures/empty-varlist.el |    6 ++++++
 3 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/context-coloring.el b/context-coloring.el
index 8d6cacc..0fe1427 100644
--- a/context-coloring.el
+++ b/context-coloring.el
@@ -504,9 +504,11 @@ For instance, the current file could be a Node.js program."
     (context-coloring-colorize-comments-and-strings start (point))))
 
 (defsubst context-coloring-elisp-forward-sexp ()
-  "Like `forward-sexp', coloring skipped comments and strings."
+  "Skip/ignore missing sexps, coloring comments and strings."
   (let ((start (point)))
-    (forward-sexp)
+    (condition-case nil
+        (forward-sexp)
+      (scan-error (context-coloring-forward-sws)))
     (context-coloring-elisp-colorize-comments-and-strings-in-region
      start (point))))
 
diff --git a/test/context-coloring-test.el b/test/context-coloring-test.el
index f643e91..fc79f7b 100644
--- a/test/context-coloring-test.el
+++ b/test/context-coloring-test.el
@@ -749,6 +749,16 @@ ssssssssssss0"))
 1111 cc ccccccc
     1sss11")))
 
+(context-coloring-test-deftest-emacs-lisp empty-varlist
+  (lambda ()
+    (context-coloring-test-assert-coloring "
+1111111 1 11
+1111111 111
+
+1111 1cc
+      11
+1111111 111")))
+
 (context-coloring-test-deftest-emacs-lisp let*
   (lambda ()
     (context-coloring-test-assert-coloring "
diff --git a/test/fixtures/empty-varlist.el b/test/fixtures/empty-varlist.el
new file mode 100644
index 0000000..5ee6a78
--- /dev/null
+++ b/test/fixtures/empty-varlist.el
@@ -0,0 +1,6 @@
+(lambda ( ))
+(lambda ())
+
+(let (;;
+      ))
+(lambda ())



reply via email to

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