|
130 | 130 | (zero-or-more (any "a-z" "A-Z" "0-9" "_" "\"" "'"))) |
131 | 131 | (and "\"" (one-or-more (not (any "\""))) "\"") |
132 | 132 | (and "'" (one-or-more (not (any "'"))) "'")))) |
133 | | - (builtin . ,(rx symbol-start |
| 133 | + (builtin . ,(rx (or line-start (not (any "."))) |
| 134 | + symbol-start |
134 | 135 | (or "case" "cond" "for" "if" "unless" "try" "receive" |
135 | 136 | "raise" "quote" "unquote" "unquote_splicing" "throw" |
136 | 137 | "super") |
137 | 138 | symbol-end)) |
138 | | - (builtin-declaration . ,(rx symbol-start |
| 139 | + (builtin-declaration . ,(rx (or line-start (not (any "."))) |
| 140 | + symbol-start |
139 | 141 | (or "def" "defp" "defmodule" "defprotocol" |
140 | 142 | "defmacro" "defmacrop" "defdelegate" |
141 | 143 | "defexception" "defstruct" "defimpl" |
142 | 144 | "defcallback") |
143 | 145 | symbol-end)) |
144 | | - (builtin-namespace . ,(rx symbol-start |
| 146 | + (builtin-namespace . ,(rx (or line-start (not (any "."))) |
| 147 | + symbol-start |
145 | 148 | (or "import" "require" "use" "alias") |
146 | 149 | symbol-end)) |
147 | 150 | ;; Set aside code point syntax for `elixir-negation-face'. |
148 | 151 | (code-point . ,(rx symbol-start |
149 | 152 | "?" |
150 | 153 | anything |
151 | 154 | symbol-end)) |
152 | | - (function-declaration . ,(rx symbol-start |
| 155 | + (function-declaration . ,(rx (or line-start (not (any "."))) |
| 156 | + symbol-start |
153 | 157 | (or "def" "defp") |
154 | 158 | symbol-end)) |
155 | 159 | ;; Match `@doc' or `@moduledoc' syntax, with or without triple quotes. |
|
162 | 166 | (identifiers . ,(rx (one-or-more (any "A-Z" "a-z" "_")) |
163 | 167 | (zero-or-more (any "A-Z" "a-z" "0-9" "_")) |
164 | 168 | (optional (or "?" "!")))) |
165 | | - (keyword . ,(rx symbol-start |
| 169 | + (keyword . ,(rx (or line-start (not (any "."))) |
| 170 | + symbol-start |
166 | 171 | (or "fn" "do" "end" "after" "else" "rescue" "catch") |
167 | 172 | symbol-end)) |
168 | | - (keyword-operator . ,(rx symbol-start |
| 173 | + (keyword-operator . ,(rx (or line-start (not (any "."))) |
| 174 | + symbol-start |
169 | 175 | (or "not" "and" "or" "when" "in") |
170 | 176 | symbol-end)) |
171 | 177 | ;; Module and submodule names start with upper case letter. This |
|
0 commit comments