Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion php-mode-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,12 @@ style from Drupal."
(search-forward "SpaceName")
(goto-char (match-beginning 0))
(should (eq 'php-constant
(get-text-property (point) 'face)))))
(get-text-property (point) 'face)))
(search-forward-regexp "\\\\My_\\(Class\\)")
(should (eq 'php-constant
(get-text-property (match-beginning 0) 'face)))
(should (eq 'php-constant
(get-text-property (match-beginning 1) 'face)))))

(ert-deftest php-mode-test-variables()
"Proper highlighting for variables."
Expand Down
4 changes: 2 additions & 2 deletions php-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -1565,8 +1565,8 @@ a completion list."
(")\\s-*:\\s-*\\??\\(array\\)\\b" 1 font-lock-type-face)

;; namespaces
("\\(\\([a-zA-Z0-9]+\\\\\\)+[a-zA-Z0-9]+\\|\\(\\\\[a-zA-Z0-9]+\\)+\\)[^:a-zA-Z0-9\\\\]" 1 'font-lock-type-face)
("\\(\\([a-zA-Z0-9]+\\\\\\)+[a-zA-Z0-9]+\\|\\(\\\\[a-zA-Z0-9]+\\)+\\)::" 1 'php-constant)
("\\(\\([a-zA-Z0-9_]+\\\\\\)+[a-zA-Z0-9_]+\\|\\(\\\\[a-zA-Z0-9_]+\\)+\\)[^:a-zA-Z0-9_\\\\]" 1 'font-lock-type-face)
("\\(\\([a-zA-Z0-9_]+\\\\\\)+[a-zA-Z0-9_]+\\|\\(\\\\[a-zA-Z0-9_]+\\)+\\)::" 1 'php-constant)

;; Support the ::class constant in PHP5.6
("\\sw+\\(::\\)\\(class\\)\\b" (1 'php-paamayim-nekudotayim) (2 'php-constant)))
Expand Down
3 changes: 2 additions & 1 deletion tests/identifiers.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@
// When calling a method, the class name should be highlighted with
// the constant face. Just like c++-mode "NS::Class::method()"
ClassName::method();
\SpaceName\ClassName::method();
\SpaceName\ClassName::method();
\My_Class::method();