Skip to content

Commit f899bc7

Browse files
committed
Merge pull request #244 from edmz/true_false_nil
True,false, nil are highlighted as atoms
2 parents 60aeb48 + 83cd1f1 commit f899bc7

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

elixir-mode.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ is used to limit the scan."
367367
1 font-lock-type-face)
368368

369369
;; Atoms and singleton-like words like true/false/nil.
370-
(,(elixir-rx (group atoms)
370+
(,(elixir-rx (group (or atoms "true" "false" "nil"))
371371
(zero-or-more space)
372372
(optional "="))
373373
1 elixir-atom-face)

test/elixir-mode-font-test.el

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,14 +169,21 @@ end"
169169
":oriole
170170
:andale
171171
:ms2pid
172-
:CapitalizedAtom"
172+
:CapitalizedAtom
173+
true
174+
false
175+
nil
176+
"
173177
(should (eq (elixir-test-face-at 3) 'elixir-atom-face))
174178
(should (eq (elixir-test-face-at 5) 'elixir-atom-face))
175179
(should (eq (elixir-test-face-at 10) 'elixir-atom-face))
176180
(should (eq (elixir-test-face-at 13) 'elixir-atom-face))
177181
(should (eq (elixir-test-face-at 18) 'elixir-atom-face))
178182
(should (eq (elixir-test-face-at 23) 'elixir-atom-face))
179-
(should (eq (elixir-test-face-at 26) 'elixir-atom-face))))
183+
(should (eq (elixir-test-face-at 26) 'elixir-atom-face))
184+
(should (eq (elixir-test-face-at 43) 'elixir-atom-face))
185+
(should (eq (elixir-test-face-at 48) 'elixir-atom-face))
186+
(should (eq (elixir-test-face-at 54) 'elixir-atom-face))))
180187

181188
(ert-deftest elixir-mode-syntax-table/fontify-map-keys ()
182189
:tags '(fontification map syntax-table)

0 commit comments

Comments
 (0)