aboutsummaryrefslogtreecommitdiffstats
path: root/queries
diff options
context:
space:
mode:
authorStephan Seitz <stephan.seitz@fau.de>2021-06-22 00:34:11 +0200
committerStephan Seitz <stephan.lauf@yahoo.de>2021-07-01 22:38:26 +0200
commit2e073285dc818fca0f6728810df9f37ec91ab5f4 (patch)
tree5ea13fbc309f5f13d3f43042ed7df7a47ab9c55e /queries
parentUpdate lockfile.json (diff)
downloadnvim-treesitter-2e073285dc818fca0f6728810df9f37ec91ab5f4.tar
nvim-treesitter-2e073285dc818fca0f6728810df9f37ec91ab5f4.tar.gz
nvim-treesitter-2e073285dc818fca0f6728810df9f37ec91ab5f4.tar.bz2
nvim-treesitter-2e073285dc818fca0f6728810df9f37ec91ab5f4.tar.lz
nvim-treesitter-2e073285dc818fca0f6728810df9f37ec91ab5f4.tar.xz
nvim-treesitter-2e073285dc818fca0f6728810df9f37ec91ab5f4.tar.zst
nvim-treesitter-2e073285dc818fca0f6728810df9f37ec91ab5f4.zip
highlights(go): modernize highlights.scm
Diffstat (limited to 'queries')
-rw-r--r--queries/go/highlights.scm173
1 files changed, 106 insertions, 67 deletions
diff --git a/queries/go/highlights.scm b/queries/go/highlights.scm
index ace75b133..9bd831fa6 100644
--- a/queries/go/highlights.scm
+++ b/queries/go/highlights.scm
@@ -40,89 +40,128 @@
; 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
-"break" @keyword
-"case" @conditional
-"chan" @keyword
-"const" @keyword
-"continue" @keyword
-"default" @keyword
-"defer" @keyword
-"else" @conditional
-"fallthrough" @keyword
+[
+ "break"
+ "chan"
+ "const"
+ "continue"
+ "default"
+ "defer"
+ "func"
+ "go"
+ "goto"
+ "interface"
+ "map"
+ "range"
+ "return"
+ "select"
+ "struct"
+ "type"
+ "var"
+ "fallthrough"
+] @keyword
+
"for" @repeat
-"func" @keyword
-"go" @keyword
-"goto" @keyword
-"if" @conditional
-"import" @include
-"interface" @keyword
-"map" @keyword
-"package" @include
-"range" @keyword
-"return" @keyword
-"select" @keyword
-"struct" @keyword
-"switch" @conditional
-"type" @keyword
-"var" @keyword
+
+[
+ "import"
+ "package"
+] @include
+
+[
+ "else"
+ "case"
+ "switch"
+ "if"
+ ] @conditional
;; Builtin types
((type_identifier) @type.builtin
(#any-of? @type.builtin
- "bool" "byte" "complex128" "complex64" "error"
- "float32" "float64" "int" "int16" "int32" "int64"
- "int8" "rune" "string" "uint" "uint16" "uint32"
- "uint64" "uint8" "uintptr"))
+ "bool"
+ "byte"
+ "complex128"
+ "complex64"
+ "error"
+ "float32"
+ "float64"
+ "int"
+ "int16"
+ "int32"
+ "int64"
+ "int8"
+ "rune"
+ "string"
+ "uint"
+ "uint16"
+ "uint32"
+ "uint64"
+ "uint8"
+ "uintptr"))
;; Builtin functions
((identifier) @function.builtin
(#any-of? @function.builtin
- "append" "cap" "close" "complex" "copy"
- "delete" "imag" "len" "make" "new" "panic"
- "print" "println" "real" "recover"))
+ "append"
+ "cap"
+ "close"
+ "complex"
+ "copy"
+ "delete"
+ "imag"
+ "len"
+ "make"
+ "new"
+ "panic"
+ "print"
+ "println"
+ "real"
+ "recover"))
; Delimiters