Skip to content

Commit a85ad0c

Browse files
committed
Merge pull request #195 from elixir-lang/highlight-structs-modules
highlighting of capitalized modules when used as structs
2 parents c8e70d2 + 3c67deb commit a85ad0c

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

elixir-mode.el

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ for the Elixir programming language."
235235
;; Finally, like other identifiers, it can be terminated with either `?'
236236
;; or `!'.
237237
(module-names . ,(rx symbol-start
238+
(optional "%")
238239
(one-or-more (any "A-Z"))
239240
(zero-or-more (any "A-Z" "a-z" "_" "0-9"))
240241
(zero-or-more

test/elixir-mode-font-test.el

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ buffer."
4444
(elixir-test-with-temp-buffer
4545
"defmodule Application.Behavior do
4646
use Application.Behaviour
47-
Stand.Alone.call"
47+
Stand.Alone.call
48+
%RuntimeError{message: msg}"
4849
(should (eq (elixir-test-face-at 1) 'font-lock-keyword-face))
4950
(should (eq (elixir-test-face-at 11) 'font-lock-type-face))
5051
(should (eq (elixir-test-face-at 22) 'font-lock-type-face))
@@ -57,7 +58,10 @@ buffer."
5758
(should (eq (elixir-test-face-at 68) 'font-lock-type-face))
5859
(should (eq (elixir-test-face-at 72) 'font-lock-type-face))
5960
;; no face for function call
60-
(should (eq (elixir-test-face-at 79) nil))))
61+
(should (eq (elixir-test-face-at 79) nil))
62+
(should (eq (elixir-test-face-at 84) 'font-lock-type-face))
63+
;; no face for curly braces
64+
(should (eq (elixir-test-face-at 97) nil))))
6165

6266
(ert-deftest elixir-mode-syntax-table/fontify-regex-with-quote ()
6367
"https://github.com/elixir-lang/emacs-elixir/issues/23"

0 commit comments

Comments
 (0)