2021-04-09 10:42:49 +02:00
|
|
|
(php_tag) @tag
|
|
|
|
"?>" @tag
|
|
|
|
|
|
|
|
; Types
|
|
|
|
|
|
|
|
(primitive_type) @type.builtin
|
|
|
|
(cast_type) @type.builtin
|
2022-01-16 02:11:47 +01:00
|
|
|
(named_type (name) @type) @type
|
|
|
|
(named_type (qualified_name) @type) @type
|
2021-04-09 10:42:49 +02:00
|
|
|
|
2022-08-05 14:34:03 +02:00
|
|
|
(namespace_definition
|
|
|
|
name: (namespace_name (name) @namespace))
|
|
|
|
|
|
|
|
; Superglobals
|
|
|
|
(subscript_expression
|
|
|
|
(variable_name(name) @constant.builtin
|
|
|
|
(#match? @constant.builtin "^_?[A-Z][A-Z\\d_]+$")))
|
|
|
|
|
2021-04-09 10:42:49 +02:00
|
|
|
; Functions
|
|
|
|
|
|
|
|
(array_creation_expression "array" @function.builtin)
|
|
|
|
(list_literal "list" @function.builtin)
|
|
|
|
|
|
|
|
(method_declaration
|
|
|
|
name: (name) @function.method)
|
|
|
|
|
|
|
|
(function_call_expression
|
2022-08-05 14:34:03 +02:00
|
|
|
function: (_) @function)
|
2021-04-09 10:42:49 +02:00
|
|
|
|
|
|
|
(scoped_call_expression
|
|
|
|
name: (name) @function)
|
|
|
|
|
|
|
|
(member_call_expression
|
|
|
|
name: (name) @function.method)
|
|
|
|
|
|
|
|
(function_definition
|
|
|
|
name: (name) @function)
|
|
|
|
|
2022-08-05 14:34:03 +02:00
|
|
|
|
2021-04-09 10:42:49 +02:00
|
|
|
; Member
|
|
|
|
|
|
|
|
(property_element
|
2021-11-03 04:00:52 +01:00
|
|
|
(variable_name) @variable.other.member)
|
2021-04-09 10:42:49 +02:00
|
|
|
|
|
|
|
(member_access_expression
|
2021-11-03 04:00:52 +01:00
|
|
|
name: (variable_name (name)) @variable.other.member)
|
2021-04-09 10:42:49 +02:00
|
|
|
(member_access_expression
|
2021-11-03 04:00:52 +01:00
|
|
|
name: (name) @variable.other.member)
|
2021-04-09 10:42:49 +02:00
|
|
|
|
|
|
|
; Variables
|
|
|
|
|
|
|
|
(relative_scope) @variable.builtin
|
|
|
|
|
|
|
|
((name) @constant
|
2021-10-16 11:02:06 +02:00
|
|
|
(#match? @constant "^_?[A-Z][A-Z\\d_]+$"))
|
2021-04-09 10:42:49 +02:00
|
|
|
|
|
|
|
((name) @constructor
|
|
|
|
(#match? @constructor "^[A-Z]"))
|
|
|
|
|
|
|
|
((name) @variable.builtin
|
|
|
|
(#eq? @variable.builtin "this"))
|
|
|
|
|
|
|
|
(variable_name) @variable
|
|
|
|
|
|
|
|
; Basic tokens
|
|
|
|
|
|
|
|
(string) @string
|
|
|
|
(heredoc) @string
|
2021-11-03 04:00:52 +01:00
|
|
|
(boolean) @constant.builtin.boolean
|
2021-04-09 10:42:49 +02:00
|
|
|
(null) @constant.builtin
|
2021-11-03 04:00:52 +01:00
|
|
|
(integer) @constant.numeric.integer
|
|
|
|
(float) @constant.numeric.float
|
2021-04-09 10:42:49 +02:00
|
|
|
(comment) @comment
|
|
|
|
|
|
|
|
"$" @operator
|
|
|
|
|
|
|
|
; Keywords
|
|
|
|
|
2022-08-05 14:34:03 +02:00
|
|
|
[
|
|
|
|
"abstract"
|
|
|
|
"as"
|
|
|
|
"break"
|
|
|
|
"case"
|
|
|
|
"catch"
|
|
|
|
"class"
|
|
|
|
"const"
|
|
|
|
"continue"
|
|
|
|
"declare"
|
|
|
|
"default"
|
|
|
|
"do"
|
|
|
|
"echo"
|
|
|
|
"else"
|
|
|
|
"elseif"
|
|
|
|
"enddeclare"
|
|
|
|
"endforeach"
|
|
|
|
"endif"
|
|
|
|
"endswitch"
|
|
|
|
"endwhile"
|
|
|
|
"enum"
|
|
|
|
"extends"
|
|
|
|
"final"
|
|
|
|
"finally"
|
|
|
|
"foreach"
|
|
|
|
"fn"
|
|
|
|
"function"
|
|
|
|
"global"
|
|
|
|
"if"
|
|
|
|
"implements"
|
|
|
|
"include_once"
|
|
|
|
"include"
|
|
|
|
"insteadof"
|
|
|
|
"interface"
|
|
|
|
"match"
|
|
|
|
"namespace"
|
|
|
|
"new"
|
|
|
|
"private"
|
|
|
|
"protected"
|
|
|
|
"public"
|
|
|
|
"require_once"
|
|
|
|
"require"
|
|
|
|
"return"
|
|
|
|
"static"
|
|
|
|
"switch"
|
|
|
|
"throw"
|
|
|
|
"trait"
|
|
|
|
"try"
|
|
|
|
"use"
|
|
|
|
"while"
|
|
|
|
] @keyword
|