Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 1 addition & 15 deletions elixir-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
;; Finally, like other identifiers, it can be terminated with either `?'
;; or `!'.
(module-names . ,(rx symbol-start
(optional "%")
(optional (or "%" "&"))
(one-or-more (any "A-Z"))
(zero-or-more (any "A-Z" "a-z" "_" "0-9"))
(zero-or-more
Expand All @@ -184,24 +184,10 @@
(zero-or-more (any "A-Z" "a-z" "_" "0-9"))))
(optional (or "!" "?"))
symbol-end))
(operators1 . ,(rx symbol-start
(or "<" ">" "+" "-" "*" "/" "!" "^" "&")
symbol-end))
(operators2 . ,(rx symbol-start
(or
"==" "!=" "<=" ">=" "&&" "||" "<>" "++" "--" "|>" "=~"
"->" "<-" "|" "." "=")
symbol-end))
(operators3 . ,(rx symbol-start
(or "<<<" ">>>" "|||" "&&&" "^^^" "~~~" "===" "!==")
symbol-end))
(pseudo-var . ,(rx symbol-start
(or "_" "__MODULE__" "__DIR__" "__ENV__" "__CALLER__"
"__block__" "__aliases__")
symbol-end))
(punctuation . ,(rx symbol-start
(or "\\" "<<" ">>" "=>" "(" ")" ":" ";" "" "[" "]")
symbol-end))
(sigils . ,(rx "~" (or "B" "C" "R" "S" "b" "c" "r" "s" "w")))))

(defmacro elixir-rx (&rest sexps)
Expand Down
5 changes: 4 additions & 1 deletion test/elixir-mode-font-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ match=~r/foo/"
"defmodule Application.Behavior do
use Application.Behaviour
Stand.Alone.call
%RuntimeError{message: msg}"
%RuntimeError{message: msg}
&Enum"
(should (eq (elixir-test-face-at 1) 'font-lock-keyword-face))
(should (eq (elixir-test-face-at 11) 'font-lock-type-face))
(should (eq (elixir-test-face-at 22) 'font-lock-type-face))
Expand All @@ -61,6 +62,8 @@ match=~r/foo/"
(should (eq (elixir-test-face-at 53) 'font-lock-type-face))
(should (eq (elixir-test-face-at 68) 'font-lock-type-face))
(should (eq (elixir-test-face-at 72) 'font-lock-type-face))
(should (eq (elixir-test-face-at 114) 'font-lock-type-face))
(should (eq (elixir-test-face-at 117) 'font-lock-type-face))
;; no face for function call
(should (eq (elixir-test-face-at 79) nil))
(should (eq (elixir-test-face-at 84) 'font-lock-type-face))
Expand Down