Permalink
Browse files

Merge pull request #381 from rranelli/fontify-time-and-datetime-sigils

Fontify `~N` & `~T` sigils
  • Loading branch information...
2 parents 83a187d + b5430c6 commit 384d8daf8ad563ebf2cb3437c71d30241adbe099 @mattdeboard mattdeboard committed on GitHub Jan 2, 2017
Showing with 9 additions and 3 deletions.
  1. +1 −1 elixir-mode.el
  2. +8 −2 test/elixir-mode-font-test.el
View
@@ -167,7 +167,7 @@
(or "_" "__MODULE__" "__DIR__" "__ENV__" "__CALLER__"
"__block__" "__aliases__")
symbol-end))
- (sigils . ,(rx "~" (or "B" "C" "D" "R" "S" "b" "c" "r" "s" "w")))))
+ (sigils . ,(rx "~" (or "B" "C" "D" "N" "R" "S" "T" "b" "c" "r" "s" "w")))))
(defmacro elixir-rx (&rest sexps)
(let ((rx-constituents (append elixir-rx-constituents rx-constituents)))
@@ -367,7 +367,9 @@ end"
~s\"\"\"
foo
\"\"\"
-~D(\")"
+~D(\")
+~N(\")
+~T(\")"
(should-not (eq (elixir-test-face-at 5) 'font-lock-string-face)) ; ~s//
(should-not (eq (elixir-test-face-at 7) 'font-lock-string-face)) ; ~r||
@@ -403,7 +405,11 @@ foo
(should (eq (elixir-test-face-at 53) 'font-lock-string-face))
(should (eq (elixir-test-face-at 55) 'font-lock-string-face))
- (should (eq (elixir-test-face-at 66) 'font-lock-string-face)))) ; ~D()
+ (should (eq (elixir-test-face-at 66) 'font-lock-string-face)) ; ~D()
+
+ (should (eq (elixir-test-face-at 72) 'font-lock-string-face)) ; ~N()
+
+ (should (eq (elixir-test-face-at 78) 'font-lock-string-face)))) ; ~T()
(ert-deftest elixir-mode-syntax-table/hashmark-in-sigils ()
"Don't treat hashmark in sigils as comment"

0 comments on commit 384d8da

Please sign in to comment.