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