Skip to content

Commit 5598dd3

Browse files
authored
Merge pull request #413 from zonuexe/fix/fallen-test
Add syntax highlight not supported by current php-mode
2 parents 52d8311 + 79cb812 commit 5598dd3

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

php-mode-test.el

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,12 @@ style from Drupal."
721721
(search-forward "SpaceName")
722722
(goto-char (match-beginning 0))
723723
(should (eq 'php-constant
724-
(get-text-property (point) 'face)))))
724+
(get-text-property (point) 'face)))
725+
(search-forward-regexp "\\\\My_\\(Class\\)")
726+
(should (eq 'php-constant
727+
(get-text-property (match-beginning 0) 'face)))
728+
(should (eq 'php-constant
729+
(get-text-property (match-beginning 1) 'face)))))
725730

726731
(ert-deftest php-mode-test-variables()
727732
"Proper highlighting for variables."

php-mode.el

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1565,8 +1565,8 @@ a completion list."
15651565
(")\\s-*:\\s-*\\??\\(array\\)\\b" 1 font-lock-type-face)
15661566

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

15711571
;; Support the ::class constant in PHP5.6
15721572
("\\sw+\\(::\\)\\(class\\)\\b" (1 'php-paamayim-nekudotayim) (2 'php-constant)))

tests/identifiers.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@
1212
// When calling a method, the class name should be highlighted with
1313
// the constant face. Just like c++-mode "NS::Class::method()"
1414
ClassName::method();
15-
\SpaceName\ClassName::method();
15+
\SpaceName\ClassName::method();
16+
\My_Class::method();

0 commit comments

Comments
 (0)