diff --git a/elixir-mode.el b/elixir-mode.el index a9a8e503..f10f76e3 100644 --- a/elixir-mode.el +++ b/elixir-mode.el @@ -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 @@ -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) diff --git a/test/elixir-mode-font-test.el b/test/elixir-mode-font-test.el index 49113b9e..2102d8db 100644 --- a/test/elixir-mode-font-test.el +++ b/test/elixir-mode-font-test.el @@ -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)) @@ -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))