Skip to content

Commit

Permalink
Add block statement face
Browse files Browse the repository at this point in the history
  • Loading branch information
Demis Balbach committed Jan 2, 2020
1 parent 908cfa7 commit 249281d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions php-face.el
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,11 @@
:group 'php-faces
:tag "PHP Property Static")

(defface php-block-statement '((t (:inherit php-keyword)))
"Face used to highlight block statements (if, elseif, for, foreach, while, declare, switch, catch)."
:group 'php-faces
:tag "PHP Block Statement")

(define-obsolete-face-alias 'php-annotations-annotation-face 'php-doc-annotation-tag "1.19.0")

(provide 'php-face)
Expand Down
5 changes: 4 additions & 1 deletion php-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -1572,7 +1572,10 @@ a completion list."

;; Property static modifier
("\\(static\\)\\(?:[[:space:]]private\\|[[:space:]]protected\\|[[:space:]]public\\)?\\(?:[[:space:]]\$?[[:word:]]+\\)\\(?:[[:space:]]*=[[:space:]]*[^;]+\\)?\\(?:;\\)" (1 'php-property-static))


;; Block statements (if, elseif, for, foreach, catch, switch, while, declare)
("\\(if\\|elseif\\|for\\|foreach\\|catch\\|switch\\|while\\|declare\\)\\(?:[[:space:]]*\([[:space:]]*.*[[:space:]]*\)\\)" (1 'php-block-statement))

;; Highlight variables, e.g. 'var' in '$var' and '$obj->var', but
;; not in $obj->var()
("\\(->\\)\\(\\sw+\\)\\s-*(" (1 'php-object-op) (2 'php-method-call))
Expand Down

0 comments on commit 249281d

Please sign in to comment.