Skip to content

Commit fb1928b

Browse files
dgutovTrevoke
authored andcommitted
Make usable again in Emacs 27 (#448)
* Remove redundant uses of 'one-or-more' To avoid backtracking and thus improve font-locking performance. Necessary in Emacs 27 because of some correctness improvements in 'rx'. Suggested by Mattias Engdegård in https://debbugs.gnu.org/38104. * Remove two more 'one-or-more' uses They never did anything anyway because 'identifiers' doesn't include any separators, so the resulting construct could only match one identifier anyway.
1 parent 5c50dce commit fb1928b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

elixir-mode.el

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
134134
;; The first character of an identifier must be a letter or an underscore.
135135
;; After that, they may contain any alphanumeric character + underscore.
136136
;; Additionally, the final character may be either `?' or `!'.
137-
(identifiers . ,(rx (one-or-more (any "A-Z" "a-z" "_"))
137+
(identifiers . ,(rx (any "A-Z" "a-z" "_")
138138
(zero-or-more (any "A-Z" "a-z" "0-9" "_"))
139139
(optional (or "?" "!"))))
140140
(keyword . ,(rx symbol-start
@@ -151,11 +151,11 @@
151151
;; or `!'.
152152
(module-names . ,(rx symbol-start
153153
(optional (or "%" "&"))
154-
(one-or-more (any "A-Z"))
154+
(any "A-Z")
155155
(zero-or-more (any "A-Z" "a-z" "_" "0-9"))
156156
(zero-or-more
157157
(and "."
158-
(one-or-more (any "A-Z" "_"))
158+
(any "A-Z" "_")
159159
(zero-or-more (any "A-Z" "a-z" "_" "0-9"))))
160160
(optional (or "!" "?"))
161161
symbol-end))
@@ -304,7 +304,7 @@ is used to limit the scan."
304304
(elixir-match-interpolation 0 font-lock-variable-name-face t)
305305

306306
;; Module attributes
307-
(,(elixir-rx (and "@" (1+ identifiers)))
307+
(,(elixir-rx (and "@" identifiers))
308308
0 elixir-attribute-face)
309309

310310
;; Keywords
@@ -399,7 +399,7 @@ is used to limit the scan."
399399
1 font-lock-variable-name-face)
400400

401401
;; Map keys
402-
(,(elixir-rx (group (and (one-or-more identifiers) ":")) space)
402+
(,(elixir-rx (group (and identifiers ":")) space)
403403
1 elixir-atom-face)
404404

405405
;; Pseudovariables

0 commit comments

Comments
 (0)