File tree Expand file tree Collapse file tree 2 files changed +21
-10
lines changed Expand file tree Collapse file tree 2 files changed +21
-10
lines changed Original file line number Diff line number Diff line change @@ -358,14 +358,6 @@ is used to limit the scan."
358
358
(group identifiers))
359
359
2 font-lock-function-name-face )
360
360
361
- ; ; Variable definitions
362
- (,(elixir-rx (group identifiers)
363
- (one-or-more space)
364
- " ="
365
- (or (one-or-more space)
366
- (one-or-more " \n " )))
367
- 1 font-lock-variable-name-face )
368
-
369
361
; ; Sigils
370
362
(,(elixir-rx (group sigils))
371
363
1 font-lock-builtin-face )
@@ -429,9 +421,19 @@ is used to limit the scan."
429
421
1 font-lock-type-face )
430
422
431
423
; ; Atoms and singleton-like words like true/false/nil.
432
- (,(elixir-rx (group atoms))
424
+ (,(elixir-rx (group atoms)
425
+ (zero-or-more space)
426
+ (optional " =" ))
433
427
1 elixir-atom-face)
434
428
429
+ ; ; Variable definitions
430
+ (,(elixir-rx (group identifiers)
431
+ (zero-or-more space)
432
+ " ="
433
+ (or (zero-or-more space)
434
+ (one-or-more " \n " )))
435
+ 1 font-lock-variable-name-face )
436
+
435
437
; ; Map keys
436
438
(,(elixir-rx (group (and (one-or-more identifiers) " :" )))
437
439
1 elixir-atom-face)
Original file line number Diff line number Diff line change @@ -21,10 +21,12 @@ buffer."
21
21
(ert-deftest elixir-mode-syntax-table/fontify-regex ()
22
22
:tags '(fontification syntax-table)
23
23
(elixir-test-with-temp-buffer
24
- " match = ~r/foo/"
24
+ " match = ~r/foo/
25
+ match=~r/foo/"
25
26
(should (eq (elixir-test-face-at 1 ) 'font-lock-variable-name-face ))
26
27
(should (eq (elixir-test-face-at 9 ) 'font-lock-builtin-face ))
27
28
(should (eq (elixir-test-face-at 12 ) 'font-lock-string-face ))
29
+ (should (eq (elixir-test-face-at 18 ) 'font-lock-variable-name-face ))
28
30
; ; no face for regex delimiters
29
31
(should (eq (elixir-test-face-at 15 ) nil ))))
30
32
@@ -188,6 +190,13 @@ some_expr"
188
190
(should (eq (elixir-test-face-at 19 ) 'font-lock-string-face ))
189
191
(should (eq (elixir-test-face-at 31 ) 'font-lock-string-face ))))
190
192
193
+ (ert-deftest elixir-mode-syntax-table/fontify-atom-in-pattern-match ()
194
+ :tags '(fontification atom syntax-table)
195
+ (elixir-test-with-temp-buffer
196
+ " :any = into_to_type(type)
197
+ :another=into_to_type(type)"
198
+ (should (eq (elixir-test-face-at 3 ) 'elixir-atom-face ))))
199
+
191
200
(ert-deftest elixir-mode-syntax-table/fontify-assignment-with-pattern/1 ()
192
201
:expected-result :failed
193
202
:tags '(fontification syntax-table)
You can’t perform that action at this time.
0 commit comments