highlights(go): modernize highlights.scm

This commit is contained in:
Stephan Seitz 2021-06-22 00:34:11 +02:00 committed by Stephan Seitz
parent 33fb1e3a42
commit 2e073285dc

View file

@ -40,89 +40,128 @@
; Operators ; Operators
"--" @operator [
"-" @operator "--"
"-=" @operator "-"
":=" @operator "-="
"!" @operator ":="
"!=" @operator "!"
"..." @operator "!="
"*" @operator "..."
"*" @operator "*"
"*=" @operator "*"
"/" @operator "*="
"/=" @operator "/"
"&" @operator "/="
"&&" @operator "&"
"&=" @operator "&&"
"%" @operator "&="
"%=" @operator "%"
"^" @operator "%="
"^=" @operator "^"
"+" @operator "^="
"++" @operator "+"
"+=" @operator "++"
"<-" @operator "+="
"<" @operator "<-"
"<<" @operator "<"
"<<=" @operator "<<"
"<=" @operator "<<="
"=" @operator "<="
"==" @operator "="
">" @operator "=="
">=" @operator ">"
">>" @operator ">="
">>=" @operator ">>"
"|" @operator ">>="
"|=" @operator "|"
"||" @operator "|="
"||"
] @operator
; Keywords ; Keywords
"break" @keyword [
"case" @conditional "break"
"chan" @keyword "chan"
"const" @keyword "const"
"continue" @keyword "continue"
"default" @keyword "default"
"defer" @keyword "defer"
"else" @conditional "func"
"fallthrough" @keyword "go"
"goto"
"interface"
"map"
"range"
"return"
"select"
"struct"
"type"
"var"
"fallthrough"
] @keyword
"for" @repeat "for" @repeat
"func" @keyword
"go" @keyword [
"goto" @keyword "import"
"if" @conditional "package"
"import" @include ] @include
"interface" @keyword
"map" @keyword [
"package" @include "else"
"range" @keyword "case"
"return" @keyword "switch"
"select" @keyword "if"
"struct" @keyword ] @conditional
"switch" @conditional
"type" @keyword
"var" @keyword
;; Builtin types ;; Builtin types
((type_identifier) @type.builtin ((type_identifier) @type.builtin
(#any-of? @type.builtin (#any-of? @type.builtin
"bool" "byte" "complex128" "complex64" "error" "bool"
"float32" "float64" "int" "int16" "int32" "int64" "byte"
"int8" "rune" "string" "uint" "uint16" "uint32" "complex128"
"uint64" "uint8" "uintptr")) "complex64"
"error"
"float32"
"float64"
"int"
"int16"
"int32"
"int64"
"int8"
"rune"
"string"
"uint"
"uint16"
"uint32"
"uint64"
"uint8"
"uintptr"))
;; Builtin functions ;; Builtin functions
((identifier) @function.builtin ((identifier) @function.builtin
(#any-of? @function.builtin (#any-of? @function.builtin
"append" "cap" "close" "complex" "copy" "append"
"delete" "imag" "len" "make" "new" "panic" "cap"
"print" "println" "real" "recover")) "close"
"complex"
"copy"
"delete"
"imag"
"len"
"make"
"new"
"panic"
"print"
"println"
"real"
"recover"))
; Delimiters ; Delimiters