Skip to content

Commit 3e59322

Browse files
authored
Merge pull request #7 from piotrkwiecinski/font-lock-list
clean up free-font-lock-settings
2 parents 4725968 + 6793801 commit 3e59322

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

Diff for: php-ts-mode.el

+8-14
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,11 @@
8383
"PHP keywords for tree-sitter font-locking.")
8484

8585
(defvar php-ts-mode--operators
86-
'(("!=" "!==" "%" "%=" "&" "&&" "&=" "*" "**" "*="
86+
'("!=" "!==" "%" "%=" "&" "&&" "&=" "*" "**" "*="
8787
"+" "++" "+=" "," "-" "-" "--" "-=" "->" "."
8888
".=" "/" "/=" ":" "::" "<" "<<" "<<=" "<=" "<=>"
8989
"<>" "=" "==" "===" "=>" ">" ">=" ">>" ">>=" "?"
90-
"??" "??=" "?->" "@" "\\" "^" "^=" "|" "|=" "||"))
90+
"??" "??=" "?->" "@" "\\" "^" "^=" "|" "|=" "||")
9191
"PHP operators for tree-sitter font-locking.")
9292

9393
(defconst php-ts-mode--magical-constants
@@ -202,22 +202,17 @@ the available version of Tree-sitter for PHP."
202202
]
203203
@font-lock-string-face)
204204

205-
:language 'php
206-
:feature 'interpolation
207-
`((interpolation "${" @font-lock-misc-punctuation-face)
208-
(interpolation "}" @font-lock-misc-punctuation-face))
209-
210205
:language 'php
211206
:feature 'operator
212207
`([,@php-ts-mode--operators] @font-lock-operator-face)
213208

214209
:language 'php
215-
:feature 'string
216-
`((string) @font-lock-string-face)
210+
:feature 'keyword
211+
`([,@php-ts-mode--keywords] @font-lock-keyword-face)
217212

218213
:language 'php
219-
:feature 'keyword
220-
`([,@php-ts-mode--keywords] @font-lock-keyword-face))
214+
:feature 'bracket
215+
`((["(" ")" "[" "]" "{" "}"]) @font-lock-bracket-face))
221216
"Tree-sitter font-lock settings for `php-ts-mode'.")
222217

223218
(defun php-ts-mode--defun-name (node)
@@ -283,9 +278,8 @@ Return nil if there is no name or if NODE is not a defun node."
283278
(setq-local treesit-font-lock-settings php-ts-mode--font-lock-settings)
284279
(setq-local treesit-font-lock-feature-list
285280
'((comment definition preprocessor)
286-
(constant keyword string type variables)
287-
(annotation expression literal function)
288-
(bracket delimiter operator)))
281+
(keyword string type variables)
282+
(function bracket operator)))
289283

290284
;; Imenu.
291285
(setq-local treesit-simple-imenu-settings

0 commit comments

Comments
 (0)