highlights(php): fix and add missing highlights

This commit is contained in:
Michael Härtl 2022-01-14 21:37:23 +01:00 committed by Stephan Seitz
parent a76e1eb89d
commit 749f72d351

View file

@ -10,6 +10,23 @@
] @type.builtin ] @type.builtin
(named_type (name)) @type (named_type (name)) @type
(named_type (qualified_name)) @type (named_type (qualified_name)) @type
(class_declaration
name: (name) @type)
(base_clause
[(name) (qualified_name)] @type)
(enum_declaration
name: (name) @type)
(interface_declaration
name: (name) @type)
(namespace_use_clause
[(name) (qualified_name)] @type)
(class_interface_clause
[(name) (qualified_name)] @type)
(scoped_call_expression
scope: [(name) (qualified_name)] @type)
(class_constant_access_expression
. [(name) (qualified_name)] @type
(name) @constant)
; Functions ; Functions
@ -37,6 +54,12 @@
(nullsafe_member_call_expression (nullsafe_member_call_expression
name: (name) @method) name: (name) @method)
; Parameters
[
(simple_parameter)
(variadic_parameter)
] @parameter
; Member ; Member
(property_element (property_element
@ -58,17 +81,25 @@
((name) @constructor ((name) @constructor
(#lua-match? @constructor "^[A-Z]")) (#lua-match? @constructor "^[A-Z]"))
(const_declaration (const_element (name) @constant))
((name) @variable.builtin ((name) @variable.builtin
(#eq? @variable.builtin "this")) (#eq? @variable.builtin "this"))
(variable_name) @variable ; Namespace
(namespace_definition
name: (namespace_name) @namespace)
; Conditions ( ? : )
(conditional_expression) @conditional
; Basic tokens ; Basic tokens
[ [
(string) (string)
(heredoc) (heredoc)
(shell_command_expression) ; backtick operator: `ls -la`
] @string ] @string
(encapsed_string (escape_sequence) @string.escape)
(boolean) @boolean (boolean) @boolean
(null) @constant.builtin (null) @constant.builtin
@ -76,10 +107,15 @@
(float) @float (float) @float
(comment) @comment (comment) @comment
(named_label_statement) @label
; Keywords ; Keywords
[ [
"and"
"as" "as"
"instanceof"
"or"
"xor"
] @keyword.operator ] @keyword.operator
[ [
@ -92,19 +128,19 @@
"abstract" "abstract"
"break" "break"
"class" "class"
"clone"
"const" "const"
"continue"
"declare" "declare"
"default" "default"
"echo" "echo"
"unset"
"enddeclare" "enddeclare"
"enum"
"extends" "extends"
"final" "final"
"global" "global"
"goto"
"implements" "implements"
"insteadof" "insteadof"
"instanceof"
"interface" "interface"
"namespace" "namespace"
"new" "new"
@ -113,9 +149,13 @@
"public" "public"
"static" "static"
"trait" "trait"
"unset"
] @keyword ] @keyword
"return" @keyword.return [
"return"
"yield"
] @keyword.return
[ [
"case" "case"
@ -126,9 +166,11 @@
"if" "if"
"switch" "switch"
"match" "match"
"??"
] @conditional ] @conditional
[ [
"continue"
"do" "do"
"endfor" "endfor"
"endforeach" "endforeach"
@ -156,7 +198,6 @@
[ [
"," ","
";" ";"
"."
] @punctuation.delimiter ] @punctuation.delimiter
[ [
@ -173,14 +214,17 @@
[ [
"=" "="
"."
"-" "-"
"*" "*"
"/" "/"
"+" "+"
"%" "%"
"**"
"~" "~"
"|" "|"
"^"
"&" "&"
"<<" "<<"
">>" ">>"
@ -194,6 +238,7 @@
"<=" "<="
">=" ">="
">" ">"
"<>"
"==" "=="
"!=" "!="
"===" "==="
@ -203,15 +248,24 @@
"&&" "&&"
"||" "||"
".="
"-=" "-="
"+=" "+="
"*=" "*="
"/=" "/="
"%=" "%="
"|=" "**="
"&=" "&="
"|="
"^="
"<<="
">>="
"??="
"--" "--"
"++" "++"
"@"
"::"
] @operator ] @operator
(ERROR) @error (ERROR) @error