@@ -201,25 +201,6 @@ for the Elixir programming language."
201201 " defexception" " defstruct" " defimpl"
202202 " defcallback" )
203203 symbol-end))
204- (builtin-modules . ,(rx symbol-start
205- (or " Agent" " Application" " Atom" " Base"
206- " Behaviour" " Bitwise" " Builtin" " Code" " Dict"
207- " EEx" " Elixir" " Enum" " ExUnit" " Exception"
208- " File" " File.Stat" " File.Stream" " Float"
209- " Function" " GenEvent" " GenServer" " GenTCP"
210- " HashDict" " HashSet" " IO" " IO.ANSI"
211- " IO.Stream" " Inspect.Algebra" " Inspect.Opts"
212- " Integer" " Kernel" " Kernel.ParallelCompiler"
213- " Kernel.ParallelRequire" " Kernel.SpecialForms"
214- " Kernel.Typespec" " Keyword" " List" " Macro"
215- " Macro.Env" " Map" " Math" " Module" " Node"
216- " OptionParser" " OrdDict" " Path" " Port"
217- " Process" " Protocol" " Range" " Record" " Regex"
218- " Set" " Stream" " String" " StringIO"
219- " Supervisor" " Supervisor.Spec" " System" " Task"
220- " Task.Supervisor" " Tuple" " URI"
221- " UnboundMethod" " Version" )
222- symbol-end))
223204 (builtin-namespace . ,(rx symbol-start
224205 (or " import" " require" " use" " alias" )
225206 symbol-end))
@@ -229,8 +210,8 @@ for the Elixir programming language."
229210 anything
230211 symbol-end))
231212 (function-declaration . ,(rx symbol-start
232- (or " def" " defp" )
233- symbol-end))
213+ (or " def" " defp" )
214+ symbol-end))
234215 ; ; Match `@doc' or `@moduledoc' syntax, with or without triple quotes.
235216 (heredocs . ,(rx symbol-start
236217 (or " @doc" " @moduledoc" " ~s" )
@@ -259,7 +240,7 @@ for the Elixir programming language."
259240 (zero-or-more
260241 (and " ."
261242 (one-or-more (any " A-Z" " _" ))
262- (zero-or-more (any " A-Z" " a-z" " _" " 0-9" ))))
243+ (zero-or-more (any " A-Z" " a-z" " _" " 0-9" ))))
263244 (optional (or " !" " ?" ))
264245 symbol-end))
265246 (operators1 . ,(rx symbol-start
@@ -296,12 +277,6 @@ for the Elixir programming language."
296277 ; ; String interpolation
297278 (elixir-match-interpolation 0 font-lock-variable-name-face t )
298279
299- ; ; Module-defining & namespace builtins
300- (,(elixir-rx (or builtin-declaration builtin-namespace)
301- space
302- (group module-names))
303- 1 font-lock-type-face )
304-
305280 ; ; Module attributes
306281 (,(elixir-rx (group (or heredocs
307282 (and " @" (1+ identifiers)))))
@@ -330,6 +305,33 @@ for the Elixir programming language."
330305 (,(elixir-rx (group sigils))
331306 1 font-lock-builtin-face )
332307
308+ ; ; Sigil patterns. Elixir has support for eight different sigil delimiters.
309+ ; ; This isn't a very DRY approach here but it gets the job done.
310+ (,(elixir-rx sigils
311+ (and " /" (group (one-or-more (not (any " /" )))) " /" ))
312+ 1 font-lock-string-face )
313+ (,(elixir-rx sigils
314+ (and " [" (group (one-or-more (not (any " ]" )))) " ]" ))
315+ 1 font-lock-string-face )
316+ (,(elixir-rx sigils
317+ (and " {" (group (one-or-more (not (any " }" )))) " }" ))
318+ 1 font-lock-string-face )
319+ (,(elixir-rx sigils
320+ (and " (" (group (one-or-more (not (any " )" )))) " )" ))
321+ 1 font-lock-string-face )
322+ (,(elixir-rx sigils
323+ (and " |" (group (one-or-more (not (any " |" )))) " |" ))
324+ 1 font-lock-string-face )
325+ (,(elixir-rx sigils
326+ (and " \" " (group (one-or-more (not (any " \" " )))) " \" " ))
327+ 1 font-lock-string-face )
328+ (,(elixir-rx sigils
329+ (and " '" (group (one-or-more (not (any " '" )))) " '" ))
330+ 1 font-lock-string-face )
331+ (,(elixir-rx sigils
332+ (and " <" (group (one-or-more (not (any " >" )))) " >" ))
333+ 1 font-lock-string-face )
334+
333335 ; ; Regex patterns. Elixir has support for eight different regex delimiters.
334336 ; ; This isn't a very DRY approach here but it gets the job done.
335337 (,(elixir-rx " ~r"
@@ -357,6 +359,10 @@ for the Elixir programming language."
357359 (and " <" (group (one-or-more (not (any " >" )))) " >" ))
358360 1 font-lock-string-face )
359361
362+ ; ; Modules
363+ (,(elixir-rx (group module-names))
364+ 1 font-lock-type-face )
365+
360366 ; ; Atoms and singleton-like words like true/false/nil.
361367 (,(elixir-rx (group atoms))
362368 1 elixir-atom-face)
@@ -365,8 +371,8 @@ for the Elixir programming language."
365371 (,(elixir-rx (group (and (one-or-more identifiers) " :" )))
366372 1 elixir-atom-face)
367373
368- ; ; Built-in modules and pseudovariables
369- (,(elixir-rx (group ( or builtin-modules pseudo-var) ))
374+ ; ; Pseudovariables
375+ (,(elixir-rx (group pseudo-var))
370376 1 font-lock-constant-face )
371377
372378 ; ; Code points
@@ -407,8 +413,7 @@ Argument FILE-NAME ."
407413
408414(defun elixir-quoted--initialize-buffer (quoted )
409415 (pop-to-buffer elixir-quoted--buffer-name)
410- (setq buffer-undo-list nil ) ; Get rid of undo information from
411- ; previous expansions
416+ (setq buffer-undo-list nil ) ; Get rid of undo information from previous expansions
412417 (let ((inhibit-read-only t )
413418 (buffer-undo-list t )) ; Ignore undo information
414419 (erase-buffer )
0 commit comments