Skip to content

Commit 8bf70ae

Browse files
committed
Merge pull request #267 from syohex/fix-tilde-s
~s is sigil, not attribute
2 parents 6ddde66 + 0c3cf36 commit 8bf70ae

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

elixir-mode.el

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,6 @@
157157
symbol-start
158158
(or "def" "defp")
159159
symbol-end))
160-
;; Match `@doc' or `@moduledoc' syntax, with or without triple quotes.
161-
(heredocs . ,(rx symbol-start
162-
(or "@doc" "@moduledoc" "~s")
163-
symbol-end))
164160
;; The first character of an identifier must be a letter or an underscore.
165161
;; After that, they may contain any alphanumeric character + underscore.
166162
;; Additionally, the final character may be either `?' or `!'.
@@ -317,9 +313,8 @@ is used to limit the scan."
317313
(elixir-match-interpolation 0 font-lock-variable-name-face t)
318314

319315
;; Module attributes
320-
(,(elixir-rx (group (or heredocs
321-
(and "@" (1+ identifiers)))))
322-
1 elixir-attribute-face)
316+
(,(elixir-rx (and "@" (1+ identifiers)))
317+
0 elixir-attribute-face)
323318

324319
;; Keywords
325320
(,(elixir-rx (group (or builtin builtin-declaration builtin-namespace

test/elixir-mode-font-test.el

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ match=~r/foo/"
3737
(elixir-test-with-temp-buffer
3838
"asdfg = ~s{Capitalized noncapitalized}"
3939
(should (eq (elixir-test-face-at 1) 'font-lock-variable-name-face))
40-
(should (eq (elixir-test-face-at 9) 'elixir-attribute-face))
40+
(should (eq (elixir-test-face-at 9) 'font-lock-builtin-face))
4141
(should (eq (elixir-test-face-at 12) 'font-lock-string-face))
4242
(should (eq (elixir-test-face-at 26) 'font-lock-string-face))
4343
;; no face for regex delimiters
@@ -159,8 +159,8 @@ end"
159159
:tags '(fontification heredoc syntax-table)
160160
(elixir-test-with-temp-buffer
161161
"~s\"\"\""
162-
(should (eq (elixir-test-face-at 1) 'elixir-attribute-face))
163-
(should (eq (elixir-test-face-at 2) 'elixir-attribute-face))
162+
(should (eq (elixir-test-face-at 1) 'font-lock-builtin-face))
163+
(should (eq (elixir-test-face-at 2) 'font-lock-builtin-face))
164164
(should (eq (elixir-test-face-at 3) 'font-lock-string-face))))
165165

166166
(ert-deftest elixir-mode-syntax-table/fontify-atoms ()
@@ -329,6 +329,7 @@ foo
329329
(should-not (eq (elixir-test-face-at 23) 'font-lock-string-face))
330330

331331
(should-not (eq (elixir-test-face-at 25) 'font-lock-string-face)) ; ~s()
332+
(should (eq (elixir-test-face-at 25) 'font-lock-builtin-face)) ; ~s()
332333
(should-not (eq (elixir-test-face-at 29) 'font-lock-string-face))
333334

334335
(should-not (eq (elixir-test-face-at 31) 'font-lock-string-face)) ; ~r[]

0 commit comments

Comments
 (0)