Skip to content

Commit 2cb9b54

Browse files
author
Demis Balbach
committed
Improve import statement
1 parent c68ab57 commit 2cb9b54

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Diff for: php-mode.el

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
3;;; php-mode.el --- Major mode for editing PHP code
1+
;;; php-mode.el --- Major mode for editing PHP code
22

33
;; Copyright (C) 2018-2019 Friends of Emacs-PHP development
44
;; Copyright (C) 1999, 2000, 2001, 2003, 2004 Turadg Aleahmad
@@ -1546,10 +1546,11 @@ a completion list."
15461546
("implements\\|extends" . 'php-class-declaration-spec)
15471547

15481548
;; Namespace declaration
1549-
("namespace" . 'php-namespace-declaration)
1549+
("namespace" . 'php-namespace-declaration)
15501550

1551-
;; import statement
1552-
("use\\|as" . 'php-import-declaration)
1551+
;; import statement (use ... as ...)
1552+
("\\(use[[:space:]]\\)\\(?:[[:word:]\\]\\)" (1 'php-import-declaration))
1553+
("\\(?:[[:word:]\\]\\)\\([[:space:]]as\\)" (1 'php-import-declaration))
15531554

15541555
;; Highlight variables, e.g. 'var' in '$var' and '$obj->var', but
15551556
;; not in $obj->var()
@@ -1638,7 +1639,7 @@ a completion list."
16381639

16391640
;; Highlight class name after "use .. as"
16401641
("\\<as\\s-+\\(\\sw+\\)" 1 font-lock-type-face)
1641-
1642+
16421643
;; Class names are highlighted by cc-mode as defined in
16431644
;; c-class-decl-kwds, below regexp is a workaround for a bug
16441645
;; where the class names are not highlighted right after opening

0 commit comments

Comments
 (0)