File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 8888 " For use with atoms & map keys."
8989 :group 'font-lock-faces )
9090
91+ (defvar elixir-number-face 'elixir-number-face )
92+ (defface elixir-number-face
93+ '((t (:inherit font-lock-builtin-face )))
94+ " For use with numbers."
95+ :group 'font-lock-faces )
96+
97+
9198(eval-when-compile
9299 (defconst elixir-rx-constituents
93100 `(
107114 (zero-or-more (any " a-z" " A-Z" " 0-9" " _" " \" " " '" " !" " @" " ?" )))
108115 (and " \" " (one-or-more (not (any " \" " ))) " \" " )
109116 (and " '" (one-or-more (not (any " '" ))) " '" ))))
117+ (numbers . ,(rx (and symbol-start
118+ (? " -" )
119+ (+ digit)
120+ (0+ (and " _" (= 3 digit)))
121+ symbol-end)))
110122 (builtin . ,(rx symbol-start
111123 (or " case" " cond" " for" " if" " quote" " raise" " receive" " send"
112124 " super" " throw" " try" " unless" " unquote" " unquote_splicing"
@@ -382,6 +394,10 @@ is used to limit the scan."
382394 (optional " =" ))
383395 1 elixir-atom-face)
384396
397+ ; ; Numbers
398+ (,(elixir-rx (group numbers))
399+ 1 elixir-number-face)
400+
385401 ; ; Gray out variables starting with "_"
386402 (,(elixir-rx symbol-start
387403 (group (and " _"
You can’t perform that action at this time.
0 commit comments