From bf6f7042fef31ec5f16a2aa1a048d9475b8b2f76 Mon Sep 17 00:00:00 2001 From: Erasin Date: Fri, 5 Aug 2022 20:34:03 +0800 Subject: Fix php hightlight (#3317) Co-authored-by: Michael Davis --- runtime/queries/php/highlights.scm | 111 ++++++++++++++++++++----------------- 1 file changed, 61 insertions(+), 50 deletions(-) diff --git a/runtime/queries/php/highlights.scm b/runtime/queries/php/highlights.scm index 5379fa1e..77c9424f 100644 --- a/runtime/queries/php/highlights.scm +++ b/runtime/queries/php/highlights.scm @@ -8,6 +8,14 @@ (named_type (name) @type) @type (named_type (qualified_name) @type) @type +(namespace_definition + name: (namespace_name (name) @namespace)) + +; Superglobals +(subscript_expression + (variable_name(name) @constant.builtin + (#match? @constant.builtin "^_?[A-Z][A-Z\\d_]+$"))) + ; Functions (array_creation_expression "array" @function.builtin) @@ -17,7 +25,7 @@ name: (name) @function.method) (function_call_expression - function: (qualified_name (name)) @function) + function: (_) @function) (scoped_call_expression name: (name) @function) @@ -28,6 +36,7 @@ (function_definition name: (name) @function) + ; Member (property_element @@ -67,52 +76,54 @@ ; 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 -"enum" @keyword -"extends" @keyword -"final" @keyword -"finally" @keyword -"foreach" @keyword -"fn" @keyword -"function" @keyword -"global" @keyword -"if" @keyword -"implements" @keyword -"include_once" @keyword -"include" @keyword -"insteadof" @keyword -"interface" @keyword -"match" @keyword -"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 +[ + "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 -- cgit v1.2.3-70-g09d2