File tree Expand file tree Collapse file tree 3 files changed +35
-6
lines changed Expand file tree Collapse file tree 3 files changed +35
-6
lines changed Original file line number Diff line number Diff line change 287
287
(zero-or-more
288
288
(any " a-z" )))
289
289
symbol-end))
290
- (variables . ,(rx symbol-start
291
- (one-or-more (any " A-Z" " a-z" " 0-9" " _" ))
292
- symbol-end))
290
+ (identifiers . ,(rx symbol-start
291
+ (one-or-more (any " A-Z" " a-z" " _" ))
292
+ (zero-or-more (any " 0-9" ))
293
+ (optional (or " ?" " !" ))
294
+ symbol-end))
293
295
(atoms . ,(rx " :"
294
296
(or
295
297
(one-or-more (any " a-z" " A-Z" " 0-9" " _" ))
321
323
; ; Method names, i.e. `def foo do'
322
324
(,(elixir-rx method-defines
323
325
space
324
- (group (one-or-more (any " a-z " " _ " )) ))
326
+ (group identifiers ))
325
327
1 font-lock-function-name-face )
326
328
327
329
; ; Variable definitions
328
- (,(elixir-rx (group variables )
330
+ (,(elixir-rx (group identifiers )
329
331
(one-or-more space)
330
332
" ="
331
333
(one-or-more space))
Original file line number Diff line number Diff line change 18
18
(modify-syntax-entry ?_ " w" table)
19
19
(modify-syntax-entry ?? " w" table)
20
20
(modify-syntax-entry ?~ " w" table)
21
-
21
+ ( modify-syntax-entry ?! " _ " table)
22
22
(modify-syntax-entry ?' " \" '" table)
23
23
(modify-syntax-entry ?\" " \"\" " table)
24
24
(modify-syntax-entry ?# " <" table)
Original file line number Diff line number Diff line change @@ -72,3 +72,30 @@ x = 15"
72
72
" a = \"\" <> \" ?\"
73
73
x = 15"
74
74
(should (eq (elixir-test-face-at 15 ) 'font-lock-variable-name-face ))))
75
+
76
+ (ert-deftest elixir-mode-syntax-table/fontify-function-name/1 ()
77
+ :tags '(fontification syntax-table)
78
+ (elixir-test-with-temp-buffer
79
+ " def fooBar do
80
+ :foo
81
+ end"
82
+ (should (eq (elixir-test-face-at 5 ) 'font-lock-function-name-face ))
83
+ (should (eq (elixir-test-face-at 8 ) 'font-lock-function-name-face ))))
84
+
85
+ (ert-deftest elixir-mode-syntax-table/fontify-function-name/2 ()
86
+ :tags '(fontification syntax-table)
87
+ (elixir-test-with-temp-buffer
88
+ " def foo? do
89
+ :foo
90
+ end"
91
+ (should (eq (elixir-test-face-at 5 ) 'font-lock-function-name-face ))
92
+ (should (eq (elixir-test-face-at 8 ) 'font-lock-function-name-face ))))
93
+
94
+ (ert-deftest elixir-mode-syntax-table/fontify-function-name/3 ()
95
+ :tags '(fontification syntax-table)
96
+ (elixir-test-with-temp-buffer
97
+ " def foo! do
98
+ :foo
99
+ end"
100
+ (should (eq (elixir-test-face-at 5 ) 'font-lock-function-name-face ))
101
+ (should (eq (elixir-test-face-at 8 ) 'font-lock-function-name-face ))))
You can’t perform that action at this time.
0 commit comments