Skip to content

PHP highlighter missing operators and keywords #119

Description

@mprz1024

We're missing highlighting for :: -> ... and #[ , as well as keywords such as exit, unset or var, and the $ sign is not an operator but part of a variable name; variables look awful otherwise. I've modified highlights.scm for this with these changes (but I couldn't get var to work):

@@ -70,18 +70,20 @@
 ; Variables
 
+(variable_name
+  "$" @punctuation.special
+  (name) @variable)

@@ -153,9 +155,19 @@
 
   "@"
 
-  "$"
+  "::"
+  "->"
+  "..."
 ] @operator

+; Delimiters
+
+[
+  ","
+  ";"
+  "=>"
+] @punctuation.delimiter
+
 ; punctuation

@@ -165,6 +177,7 @@
   "]"
   "{"
   "}"
+  "#["
 ] @punctuation.bracket

@@ -195,8 +208,8 @@
 "endswitch" @keyword
 "endwhile" @keyword
 "extends" @keyword
+"exit" @keyword
 "final" @keyword
 "finally" @keyword
 "for" @keyword
 "foreach" @keyword
@@ -228,6 +241,7 @@
 "throw" @keyword
 "trait" @keyword
 "try" @keyword
+"unset" @keyword
 "use" @keyword
 "while" @keyword
 "xor" @keyword

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions