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.

247 lines
8.1 KiB

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