Skip to content

Commit f90de54

Browse files
committed
Add faces list for Emacs 24
1 parent b83e62b commit f90de54

File tree

2 files changed

+169
-1
lines changed

2 files changed

+169
-1
lines changed

php-mode-test.el

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,10 @@ Meant for `php-mode-test-issue-503'."
667667

668668
(ert-deftest php-mode-test-lang ()
669669
"Test highlighting for language constructs."
670-
(with-php-mode-test ("comments.php" :faces t))
670+
(with-php-mode-test ("comments.php"
671+
:faces (if (eq emacs-major-version 24)
672+
".24.faces"
673+
t)))
671674
(with-php-mode-test ("doc-comment-return-type.php" :faces t))
672675
(with-php-mode-test ("lang/types/cast.php" :faces t))
673676
(with-php-mode-test ("lang/types/function.php" :faces t))

tests/comments.php.24.faces

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
;; -*- mode: emacs-lisp -*-
2+
(("<?php" . php-php-tag)
3+
("\n\n")
4+
("/**\n * File level doc-comment\n *\n * " . font-lock-doc-face)
5+
("@copyright" php-doc-annotation-tag font-lock-doc-face)
6+
(" 1999, 2000, 2001, 2003, 2004 Turadg Aleahmad\n * " . font-lock-doc-face)
7+
("@copyright" php-doc-annotation-tag font-lock-doc-face)
8+
(" 2008 Aaron S. Hawley\n * " . font-lock-doc-face)
9+
("@copyright" php-doc-annotation-tag font-lock-doc-face)
10+
(" 2011, 2012, 2013, 2014, 2015, 2016 Eric James Michael Ritz\n * " . font-lock-doc-face)
11+
("@author" php-doc-annotation-tag font-lock-doc-face)
12+
(" USAMI Kenta <tadsan@pixiv.com>\n * " . font-lock-doc-face)
13+
("@link" php-doc-annotation-tag font-lock-doc-face)
14+
(" " . font-lock-doc-face)
15+
("https://github.com/emacs-php/php-mode" link font-lock-doc-face)
16+
("\n * " . font-lock-doc-face)
17+
("@package" php-doc-annotation-tag font-lock-doc-face)
18+
(" " . font-lock-doc-face)
19+
("Emacs\\PHPMode" php-string font-lock-doc-face)
20+
("\n */" . font-lock-doc-face)
21+
("\n\n")
22+
("// " . font-lock-comment-delimiter-face)
23+
("one-line comment\n" . font-lock-comment-face)
24+
("// " . font-lock-comment-delimiter-face)
25+
("@annotation This is NOT annotation. 1\n" . font-lock-comment-face)
26+
("\n")
27+
("/*" . font-lock-comment-delimiter-face)
28+
("------------------------------------------------\n Multi-line comment\n\n * @annotation This is NOT annotation. 2\n -------------------------------------------------*/" . font-lock-comment-face)
29+
("\n\n")
30+
("// " . font-lock-comment-delimiter-face)
31+
("/**\n" . font-lock-comment-face)
32+
("// " . font-lock-comment-delimiter-face)
33+
("* Comment outed class implementation\n" . font-lock-comment-face)
34+
("// " . font-lock-comment-delimiter-face)
35+
("*\n" . font-lock-comment-face)
36+
("// " . font-lock-comment-delimiter-face)
37+
("* @annotation This is NOT annotation. 3\n" . font-lock-comment-face)
38+
("// " . font-lock-comment-delimiter-face)
39+
("*/\n" . font-lock-comment-face)
40+
("// " . font-lock-comment-delimiter-face)
41+
("class CommentOuted\n" . font-lock-comment-face)
42+
("// " . font-lock-comment-delimiter-face)
43+
("{\n" . font-lock-comment-face)
44+
("// " . font-lock-comment-delimiter-face)
45+
("}\n" . font-lock-comment-face)
46+
("\n")
47+
("/**\n * Class level doc-comment\n *\n * Description " . font-lock-doc-face)
48+
("{@internal " php-doc-annotation-tag font-lock-doc-face)
49+
("Description" php-string php-doc-annotation-tag font-lock-doc-face)
50+
("}" php-doc-annotation-tag font-lock-doc-face)
51+
(" inline tag.\n *\n * " . font-lock-doc-face)
52+
("@property-read" php-doc-annotation-tag font-lock-doc-face)
53+
(" " . font-lock-doc-face)
54+
("string" font-lock-type-face php-string font-lock-doc-face)
55+
("[]" php-string font-lock-doc-face)
56+
(" " . font-lock-doc-face)
57+
("$" php-doc-variable-sigil font-lock-doc-face)
58+
("name" php-variable-name font-lock-doc-face)
59+
("\n * " . font-lock-doc-face)
60+
("@ORM\\Table" php-doc-annotation-tag font-lock-doc-face)
61+
("(name=\"majormodes\")\n * " . font-lock-doc-face)
62+
("@ORM\\Entity" php-doc-annotation-tag font-lock-doc-face)
63+
("(repositoryClass=\"Emacs\\Repository\\MajorModeRepository\")\n */" . font-lock-doc-face)
64+
("\n")
65+
("final" . php-keyword)
66+
(" ")
67+
("class" . php-keyword)
68+
(" ")
69+
("SampleClass" . font-lock-type-face)
70+
("\n{\n ")
71+
("/** Const doc-comment */" . font-lock-doc-face)
72+
("\n ")
73+
("const" . php-keyword)
74+
(" ")
75+
("SAMPLE" . php-constant-assign)
76+
(" = ")
77+
("'SAMPLE'" . php-string)
78+
(";\n ")
79+
("/** " . font-lock-doc-face)
80+
("@var" php-doc-annotation-tag font-lock-doc-face)
81+
(" " . font-lock-doc-face)
82+
("string" font-lock-type-face php-string font-lock-doc-face)
83+
(" sample property doc-comment */" . font-lock-doc-face)
84+
("\n ")
85+
("private" . php-keyword)
86+
(" ")
87+
("$" . php-variable-sigil)
88+
("name" . php-variable-name)
89+
(";\n\n ")
90+
("/**\n * " . font-lock-doc-face)
91+
("@param" php-doc-annotation-tag font-lock-doc-face)
92+
(" " . font-lock-doc-face)
93+
("string" font-lock-type-face php-string font-lock-doc-face)
94+
(" " . font-lock-doc-face)
95+
("$" php-doc-variable-sigil font-lock-doc-face)
96+
("name" php-variable-name font-lock-doc-face)
97+
("\n */" . font-lock-doc-face)
98+
("\n ")
99+
("public" . php-keyword)
100+
(" ")
101+
("function" . php-keyword)
102+
(" ")
103+
("__construct" . php-function-name)
104+
("(")
105+
("$" . php-variable-sigil)
106+
("name" . php-variable-name)
107+
(")\n {\n ")
108+
("$" . php-$this-sigil)
109+
("this" . php-$this)
110+
("->" . php-object-op)
111+
("name" . php-property-name)
112+
(" = ")
113+
("$" . php-variable-sigil)
114+
("name" . php-variable-name)
115+
("; ")
116+
("// " . font-lock-comment-delimiter-face)
117+
("comment in after code\n" . font-lock-comment-face)
118+
("\n ")
119+
("/** " . font-lock-doc-face)
120+
("@var" php-doc-annotation-tag font-lock-doc-face)
121+
(" " . font-lock-doc-face)
122+
("string" font-lock-type-face php-string font-lock-doc-face)
123+
("|" php-string font-lock-doc-face)
124+
("bool" font-lock-type-face php-string font-lock-doc-face)
125+
("|" php-string font-lock-doc-face)
126+
("array" font-lock-type-face php-string font-lock-doc-face)
127+
("[]|ArrayObject" php-string font-lock-doc-face)
128+
(" */" . font-lock-doc-face)
129+
("\n ")
130+
("$" . php-variable-sigil)
131+
("foo" . php-variable-name)
132+
(" = hoge();\n\n ")
133+
("// " . font-lock-comment-delimiter-face)
134+
("one-line comment\n" . font-lock-comment-face)
135+
(" ")
136+
("// " . font-lock-comment-delimiter-face)
137+
("@annotation This is NOT annotation. 4\n" . font-lock-comment-face)
138+
("\n ")
139+
("/** " . font-lock-doc-face)
140+
("@var" php-doc-annotation-tag font-lock-doc-face)
141+
(" " . font-lock-doc-face)
142+
("int" font-lock-type-face php-string font-lock-doc-face)
143+
(" internal linter variable */" . font-lock-doc-face)
144+
("\n ")
145+
("$" . php-variable-sigil)
146+
("offset" . php-variable-name)
147+
(" = 0;\n }\n\n ")
148+
("/**\n * Summary\n *\n * " . font-lock-doc-face)
149+
("@throws" php-doc-annotation-tag font-lock-doc-face)
150+
(" " . font-lock-doc-face)
151+
("\\RuntimeException" php-string font-lock-doc-face)
152+
("\n */" . font-lock-doc-face)
153+
("\n ")
154+
("public" . php-keyword)
155+
(" ")
156+
("function" . php-keyword)
157+
(" ")
158+
("test" . php-function-name)
159+
("()\n {\n ")
160+
("throw" . php-keyword)
161+
(" ")
162+
("new" . php-keyword)
163+
(" ")
164+
("\\RuntimeException" . font-lock-type-face)
165+
(";\n }\n}\n"))

0 commit comments

Comments
 (0)