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

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

[elpa] master 87893df 32/79: Support comma splicing.


From: Jackson Ray Hamilton
Subject: [elpa] master 87893df 32/79: Support comma splicing.
Date: Sun, 14 Jun 2015 00:05:29 +0000

branch: master
commit 87893df80ab8fcbb31ecd88f0a3ad978eb63d910
Author: Jackson Ray Hamilton <address@hidden>
Commit: Jackson Ray Hamilton <address@hidden>

    Support comma splicing.
---
 context-coloring.el           |    4 ++++
 test/context-coloring-test.el |    6 ++++++
 test/fixtures/splice.el       |    2 ++
 3 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/context-coloring.el b/context-coloring.el
index 61f5a31..61c4163 100644
--- a/context-coloring.el
+++ b/context-coloring.el
@@ -330,6 +330,7 @@ generated by `js2-mode'."
 (defconst context-coloring-APOSTROPHE-CHAR (string-to-char "'"))
 (defconst context-coloring-OPEN-PARENTHESIS-CHAR (string-to-char "("))
 (defconst context-coloring-COMMA-CHAR (string-to-char ","))
+(defconst context-coloring-AT-CHAR (string-to-char "@"))
 (defconst context-coloring-BACKTICK-CHAR (string-to-char "`"))
 
 (defvar context-coloring-elisp-scope-stack '())
@@ -608,6 +609,9 @@ generated by `js2-mode'."
         (setq char (char-after))
         (when (= char context-coloring-COMMA-CHAR)
           (forward-char)
+          (when (= (char-after) context-coloring-AT-CHAR)
+            ;; If we don't do this "@" could be interpreted as a symbol.
+            (forward-char))
           (context-coloring-forward-sws)
           (context-coloring-elisp-colorize-sexp)))))))
 
diff --git a/test/context-coloring-test.el b/test/context-coloring-test.el
index c21cb3d..c0240b5 100644
--- a/test/context-coloring-test.el
+++ b/test/context-coloring-test.el
@@ -1107,6 +1107,12 @@ ssssssssssss0"))
 
 (xxxxxx () 111111 11111)")))
 
+(context-coloring-test-deftest-emacs-lisp splice
+  (lambda ()
+    (context-coloring-test-assert-coloring "
+(xxxxxx ()
+  111111 00001 100001)")))
+
 (context-coloring-test-deftest-emacs-lisp comment
   (lambda ()
     ;; Just check that the comment isn't parsed syntactically.
diff --git a/test/fixtures/splice.el b/test/fixtures/splice.el
new file mode 100644
index 0000000..3a857a7
--- /dev/null
+++ b/test/fixtures/splice.el
@@ -0,0 +1,2 @@
+(lambda ()
+  `(,@(a free) ,free))



reply via email to

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