File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ Running `M-x treesit-install-language-grammar [RET] php` will compile and instal
53
53
In ` php-ts-mode ` , syntax elements are classified as follows.
54
54
55
55
* ** Level 1** : ` comment ` ` definition ` ` preprocessor `
56
- * ** Level 2** : ` keyword ` ` string ` ` type `
56
+ * ** Level 2** : ` keyword ` ` string ` ` type ` ` built-in `
57
57
* ** Level 3** : ` function ` ` constant ` ` label `
58
58
* ** Level 4** : ` bracket ` ` delimiter ` ` operator ` ` variables ` ` this `
59
59
Original file line number Diff line number Diff line change 105
105
" while" " yield" )
106
106
" PHP keywords for tree-sitter font-locking." )
107
107
108
+ (defvar php-ts-mode--built-in-functions
109
+ '(" die" " echo" " empty" " isset" )
110
+ " PHP built-in functions for tree-sitter font-locking." )
111
+
108
112
(defvar php-ts-mode--operators
109
113
'(" !=" " !==" " %" " %=" " &" " &&" " &=" " *" " **" " *="
110
114
" +" " ++" " +=" " ," " -" " -" " --" " -=" " ->" " ."
@@ -259,6 +263,16 @@ see https://www.php.net/manual/language.constants.predefined.php")
259
263
(goto_statement " goto" @php-keyword)
260
264
(yield_expression " from" @php-keyword))
261
265
266
+ :language 'php
267
+ :feature 'built-in
268
+ :override t
269
+ `((function_call_expression
270
+ function: (name) @php-keyword
271
+ (:match ,(rx-to-string
272
+ `(seq bol
273
+ (or ,@php-ts-mode--built-in-functions )
274
+ eol)) @php-keyword)))
275
+
262
276
:language 'php
263
277
:feature 'label
264
278
`((goto_statement (name) @php-keyword)
@@ -359,7 +373,7 @@ Currently there are `php-mode' and `php-ts-mode'."
359
373
(setq-local treesit-font-lock-settings php-ts-mode--font-lock-settings)
360
374
(setq-local treesit-font-lock-feature-list
361
375
'((comment definition preprocessor)
362
- (keyword string type)
376
+ (keyword string type built-in )
363
377
(function constant label)
364
378
(bracket delimiter operator variables this)))
365
379
You can’t perform that action at this time.
0 commit comments