Skip to content

Commit 249281d

Browse files
author
Demis Balbach
committed
Add block statement face
1 parent 908cfa7 commit 249281d

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

php-face.el

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,11 @@
256256
:group 'php-faces
257257
:tag "PHP Property Static")
258258

259+
(defface php-block-statement '((t (:inherit php-keyword)))
260+
"Face used to highlight block statements (if, elseif, for, foreach, while, declare, switch, catch)."
261+
:group 'php-faces
262+
:tag "PHP Block Statement")
263+
259264
(define-obsolete-face-alias 'php-annotations-annotation-face 'php-doc-annotation-tag "1.19.0")
260265

261266
(provide 'php-face)

php-mode.el

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1572,7 +1572,10 @@ a completion list."
15721572

15731573
;; Property static modifier
15741574
("\\(static\\)\\(?:[[:space:]]private\\|[[:space:]]protected\\|[[:space:]]public\\)?\\(?:[[:space:]]\$?[[:word:]]+\\)\\(?:[[:space:]]*=[[:space:]]*[^;]+\\)?\\(?:;\\)" (1 'php-property-static))
1575-
1575+
1576+
;; Block statements (if, elseif, for, foreach, catch, switch, while, declare)
1577+
("\\(if\\|elseif\\|for\\|foreach\\|catch\\|switch\\|while\\|declare\\)\\(?:[[:space:]]*\([[:space:]]*.*[[:space:]]*\)\\)" (1 'php-block-statement))
1578+
15761579
;; Highlight variables, e.g. 'var' in '$var' and '$obj->var', but
15771580
;; not in $obj->var()
15781581
("\\(->\\)\\(\\sw+\\)\\s-*(" (1 'php-object-op) (2 'php-method-call))

0 commit comments

Comments
 (0)