Skip to content

Commit 457d88b

Browse files
committed
Add ebum and readonly class modifier to imenu
1 parent 5b6cc1c commit 457d88b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lisp/php.el

+8-2
Original file line numberDiff line numberDiff line change
@@ -325,12 +325,18 @@ can be used to match against definitions for that classlike."
325325
;; First see if 'abstract' or 'final' appear, although really these
326326
;; are not valid for all values of `type' that the function
327327
;; accepts.
328-
"^\\s-*\\(?:\\(?:abstract\\|final\\)\\s-+\\)?"
328+
(eval-when-compile
329+
(rx line-start
330+
(* (syntax whitespace))
331+
(? (or "abstract" "final" "readonly")
332+
(+ (syntax whitespace)))))
329333
;; The classlike type
330334
type
331335
;; Its name, which is the first captured group in the regexp. We
332336
;; allow backslashes in the name to handle namespaces, but again
333337
;; this is not necessarily correct for all values of `type'.
338+
;; (rx (+ (syntax whitespace))
339+
;; (group (+ (or (syntax word) "\\" (syntax symbol)))))
334340
"\\s-+\\(\\(?:\\sw\\|\\\\\\|\\s_\\)+\\)")))
335341

336342
(defconst php-imenu-generic-expression-default
@@ -465,7 +471,7 @@ can be used to match against definitions for that classlike."
465471

466472
(defconst php--re-classlike-pattern
467473
(eval-when-compile
468-
(php-create-regexp-for-classlike (regexp-opt '("class" "interface" "trait")))))
474+
(php-create-regexp-for-classlike (regexp-opt '("class" "interface" "trait" "enum")))))
469475

470476
(defvar php--analysis-syntax-table
471477
(eval-when-compile

0 commit comments

Comments
 (0)