Personal emacs config
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

246 lines
8.1 KiB

5 years ago
  1. ;;; php-face.el --- Face definitions for PHP script -*- lexical-binding: t; -*-
  2. ;; Copyright (C) 2020 Friends of Emacs-PHP development
  3. ;; Author: USAMI Kenta <tadsan@zonu.me>
  4. ;; Created: 5 May 2019
  5. ;; Version: 1.24.0
  6. ;; Keywords: faces, php
  7. ;; Homepage: https://github.com/emacs-php/php-mode
  8. ;; License: GPL-3.0-or-later
  9. ;; This program is free software; you can redistribute it and/or modify
  10. ;; it under the terms of the GNU General Public License as published by
  11. ;; the Free Software Foundation, either version 3 of the License, or
  12. ;; (at your option) any later version.
  13. ;; This program is distributed in the hope that it will be useful,
  14. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. ;; GNU General Public License for more details.
  17. ;; You should have received a copy of the GNU General Public License
  18. ;; along with this program. If not, see <https://www.gnu.org/licenses/>.
  19. ;;; Commentary:
  20. ;; Face definitions for PHP script.
  21. ;;; Code:
  22. ;;;###autoload
  23. (defgroup php-faces nil
  24. "Faces used in PHP Mode"
  25. :tag "PHP Faces"
  26. :group 'php-mode
  27. :group 'faces)
  28. (defface php-string '((t (:inherit font-lock-string-face)))
  29. "PHP Mode face used to highlight string literals."
  30. :group 'php-faces
  31. :tag "PHP String")
  32. (defface php-keyword '((t (:inherit font-lock-keyword-face)))
  33. "PHP Mode face used to highlight keywords."
  34. :group 'php-faces
  35. :tag "PHP Keyword")
  36. (defface php-builtin '((t (:inherit font-lock-builtin-face)))
  37. "PHP Mode face used to highlight builtins."
  38. :group 'php-faces
  39. :tag "PHP Built-in")
  40. (defface php-function-name '((t (:inherit font-lock-function-name-face)))
  41. "PHP Mode face used to highlight function names."
  42. :group 'php-faces
  43. :tag "PHP Function Name")
  44. (defface php-function-call '((t ()))
  45. "PHP Mode face used to highlight function names in calles."
  46. :group 'php-faces
  47. :tag "PHP Function Call")
  48. (defface php-method-call '((t (:inherit php-function-call)))
  49. "PHP Mode face used to highlight method names in calles."
  50. :group 'php-faces
  51. :tag "PHP Method Call")
  52. (defface php-static-method-call '((t (:inherit php-method-call)))
  53. "PHP Mode face used to highlight static method names in calles."
  54. :group 'php-faces
  55. :tag "PHP Static Method Call")
  56. (defface php-variable-name '((t (:inherit font-lock-variable-name-face)))
  57. "PHP Mode face used to highlight variable names."
  58. :group 'php-faces
  59. :tag "PHP Variable Name")
  60. (defface php-property-name '((t (:inherit php-variable-name)))
  61. "PHP Mode face used to highlight property names."
  62. :group 'php-faces
  63. :tag "PHP Property Name")
  64. (defface php-variable-sigil '((t ()))
  65. "PHP Mode face used to highlight variable sigils ($)."
  66. :group 'php-faces
  67. :tag "PHP Variable Sigil")
  68. (defface php-operator '((t ()))
  69. "PHP Mode face used to operators."
  70. :group 'php-faces
  71. :tag "PHP Operator")
  72. (defface php-assignment-op '((t (:inherit php-operator)))
  73. "PHP Mode face used to assignment operators (=, +=, ...)."
  74. :group 'php-faces
  75. :tag "PHP Object Op")
  76. (defface php-comparison-op '((t (:inherit php-operator)))
  77. "PHP Mode face used to comparison operators (==, !=, ===, ...)."
  78. :group 'php-faces
  79. :tag "PHP Comparison Op")
  80. (defface php-logical-op '((t (:inherit php-operator)))
  81. "PHP Mode face used to logical operators (&&, ||, ?:)."
  82. :group 'php-faces
  83. :tag "PHP Logical Op")
  84. (defface php-arithmetic-op '((t (:inherit php-operator)))
  85. "PHP Mode face used to arithmetic operators (+, -, %, ...)."
  86. :group 'php-faces
  87. :tag "PHP Arithmetic Op")
  88. (defface php-inc-dec-op '((t (:inherit php-operator)))
  89. "PHP Mode face used to increment and decremt operators (--, ++)."
  90. :group 'php-faces
  91. :tag "PHP Increment/Decrement Op")
  92. (defface php-string-op '((t (:inherit php-operator)))
  93. "PHP Mode face used to logical operators (.)."
  94. :group 'php-faces
  95. :tag "PHP String Op")
  96. (defface php-object-op '((t (:inherit php-operator)))
  97. "PHP Mode face used to object operators (->)."
  98. :group 'php-faces
  99. :tag "PHP Object Op")
  100. (defface php-paamayim-nekudotayim '((t ()))
  101. "PHP Mode face used to highlight \"Paamayim Nekudotayim\" scope resolution operators (::)."
  102. :group 'php-faces
  103. :tag "PHP Paamayim Nekudotayim")
  104. (defface php-type '((t (:inherit font-lock-type-face)))
  105. "PHP Mode face used to highlight types."
  106. :group 'php-faces
  107. :tag "PHP Type")
  108. (defface php-class '((t (:inherit font-lock-type-face)))
  109. "PHP Mode face used to highlight class."
  110. :group 'php-faces
  111. :tag "PHP Class")
  112. (defface php-constant '((t (:inherit font-lock-constant-face)))
  113. "PHP Mode face used to highlight constants."
  114. :group 'php-faces
  115. :tag "PHP Constant")
  116. (defface php-constant-assign '((t (:inherit font-lock-type-face)))
  117. "PHP Mode face used to highlight constant assigning (\"const\" statement)."
  118. :group 'php-faces
  119. :tag "PHP Constant Assign")
  120. (defface php-magical-constant '((t (:inherit font-lock-builtin-face)))
  121. "PHP Mode face used to highlight magical constants."
  122. :group 'php-faces
  123. :tag "PHP Magical Constant")
  124. (defface php-$this '((t (:inherit php-constant)))
  125. "PHP Mode face used to highlight $this variables."
  126. :group 'php-faces
  127. :tag "PHP $this")
  128. (defface php-$this-sigil '((t (:inherit php-constant)))
  129. "PHP Mode face used to highlight sigils($) of $this variable."
  130. :group 'php-faces
  131. :tag "PHP $this Sigil")
  132. (defface php-errorcontrol-op '((t (:inherit font-lock-type-face)))
  133. "PHP Mode face used to highlight errorcontrol operators (@).."
  134. :group 'php-faces
  135. :tag "PHP ErrorControl Op")
  136. (defface php-php-tag '((t (:inherit font-lock-preprocessor-face)))
  137. "PHP Mode face used to highlight PHP tags."
  138. :group 'php-faces
  139. :tag "PHP php Tag")
  140. (defface php-doc-annotation-tag '((t . (:inherit font-lock-constant-face)))
  141. "Face used to highlight annotation tags in doc-comment."
  142. :group 'php-faces
  143. :tag "PHPDoc Annotation Tag")
  144. (defface php-doc-variable-sigil '((t (:inherit font-lock-variable-name-face)))
  145. "PHP Mode face used to highlight variable sigils($)."
  146. :group 'php-faces
  147. :tag "PHPDoc Variable Sigil")
  148. (defface php-doc-$this '((t (:inherit php-type)))
  149. "PHP Mode face used to highlight $this variable in doc-comment."
  150. :group 'php-faces
  151. :tag "PHPDoc $this")
  152. (defface php-doc-$this-sigil '((t (:inherit php-type)))
  153. "PHP Mode face used to highlight sigil of $this variable in doc-comment."
  154. :group 'php-faces
  155. :tag "PHPDoc $this Sigil")
  156. (defface php-doc-class-name '((t (:inherit php-string)))
  157. "PHP Mode Face used to class names in doc-comment."
  158. :group 'php-faces
  159. :tag "PHPDoc Class Name")
  160. (defface php-class-declaration '((t (:inherit php-keyword)))
  161. "PHP Mode Face used to class declarations."
  162. :group 'php-faces
  163. :tag "PHP Class Declaration")
  164. (defface php-class-declaration-spec '((t (:inherit php-keyword)))
  165. "PHP Mode Face used to highlight class declaration specification keywords (implements, extends)"
  166. :group 'php-faces
  167. :tag "PHP Class Declaration Specification")
  168. (defface php-namespace-declaration '((t (:inherit php-keyword)))
  169. "PHP Mode Face used to highlight namespace declaration keyword."
  170. :group 'php-faces
  171. :tag "PHP Namespace Declaration")
  172. (defface php-import-declaration '((t (:inherit php-keyword)))
  173. "PHP Mode Face used to highlight import statements (use ... as ...)."
  174. :group 'php-faces
  175. :tag "PHP Import Statement")
  176. (defface php-class-modifier '((t (:inherit php-keyword)))
  177. "PHP Mode Face used to highlight class modifiers (final, abstract)."
  178. :group 'php-faces
  179. :tag "PHP Class Modifier")
  180. (defface php-method-modifier '((t (:inherit php-keyword)))
  181. "PHP Mode Face used to highlight method modifiers (final, abstract)."
  182. :group 'php-faces
  183. :tag "PHP Method Modifier")
  184. (defface php-visibility-modifier '((t (:inherit php-keyword)))
  185. "PHP Mode Face used to highlight access keywords (public, protected, private)."
  186. :group 'php-faces
  187. :tag "PHP Visibility Modifier")
  188. (defface php-control-structure '((t (:inherit php-keyword)))
  189. "PHP Mode Face used to highlight control structures (if, foreach, while, switch, catch...)."
  190. :group 'php-faces
  191. :tag "PHP Control Structure")
  192. (define-obsolete-face-alias 'php-annotations-annotation-face 'php-doc-annotation-tag "1.19.0")
  193. (provide 'php-face)
  194. ;;; php-face.el ends here