Skip to content

Commit 161500f

Browse files
committed
Update queries to make use of new features
1 parent b0c7823 commit 161500f

2 files changed

Lines changed: 83 additions & 72 deletions

File tree

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"nan": "^2.10.0"
1414
},
1515
"devDependencies": {
16-
"tree-sitter-cli": "^0.16.7"
16+
"tree-sitter-cli": "^0.16.9"
1717
},
1818
"scripts": {
1919
"build": "tree-sitter generate && node-gyp build",

‎queries/highlights.scm‎

Lines changed: 82 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -23,84 +23,95 @@
2323

2424
; Operators
2525

26-
"--" @operator
27-
"-" @operator
28-
"-=" @operator
29-
":=" @operator
30-
"!" @operator
31-
"!=" @operator
32-
"..." @operator
33-
"*" @operator
34-
"*" @operator
35-
"*=" @operator
36-
"/" @operator
37-
"/=" @operator
38-
"&" @operator
39-
"&&" @operator
40-
"&=" @operator
41-
"%" @operator
42-
"%=" @operator
43-
"^" @operator
44-
"^=" @operator
45-
"+" @operator
46-
"++" @operator
47-
"+=" @operator
48-
"<-" @operator
49-
"<" @operator
50-
"<<" @operator
51-
"<<=" @operator
52-
"<=" @operator
53-
"=" @operator
54-
"==" @operator
55-
">" @operator
56-
">=" @operator
57-
">>" @operator
58-
">>=" @operator
59-
"|" @operator
60-
"|=" @operator
61-
"||" @operator
26+
[
27+
"--"
28+
"-"
29+
"-="
30+
":="
31+
"!"
32+
"!="
33+
"..."
34+
"*"
35+
"*"
36+
"*="
37+
"/"
38+
"/="
39+
"&"
40+
"&&"
41+
"&="
42+
"%"
43+
"%="
44+
"^"
45+
"^="
46+
"+"
47+
"++"
48+
"+="
49+
"<-"
50+
"<"
51+
"<<"
52+
"<<="
53+
"<="
54+
"="
55+
"=="
56+
">"
57+
">="
58+
">>"
59+
">>="
60+
"|"
61+
"|="
62+
"||"
63+
] @operator
6264

6365
; Keywords
6466

65-
"break" @keyword
66-
"case" @keyword
67-
"chan" @keyword
68-
"const" @keyword
69-
"continue" @keyword
70-
"default" @keyword
71-
"defer" @keyword
72-
"else" @keyword
73-
"fallthrough" @keyword
74-
"for" @keyword
75-
"func" @keyword
76-
"go" @keyword
77-
"goto" @keyword
78-
"if" @keyword
79-
"import" @keyword
80-
"interface" @keyword
81-
"map" @keyword
82-
"package" @keyword
83-
"range" @keyword
84-
"return" @keyword
85-
"select" @keyword
86-
"struct" @keyword
87-
"switch" @keyword
88-
"type" @keyword
89-
"var" @keyword
67+
[
68+
"break"
69+
"case"
70+
"chan"
71+
"const"
72+
"continue"
73+
"default"
74+
"defer"
75+
"else"
76+
"fallthrough"
77+
"for"
78+
"func"
79+
"go"
80+
"goto"
81+
"if"
82+
"import"
83+
"interface"
84+
"map"
85+
"package"
86+
"range"
87+
"return"
88+
"select"
89+
"struct"
90+
"switch"
91+
"type"
92+
"var"
93+
] @keyword
9094

9195
; Literals
9296

93-
(interpreted_string_literal) @string
94-
(raw_string_literal) @string
95-
(rune_literal) @string
96-
(escape_sequence) @escape
97+
[
98+
(interpreted_string_literal)
99+
(raw_string_literal)
100+
(rune_literal)
101+
] @string
97102

98-
(int_literal) @number
99-
(float_literal) @number
100-
(imaginary_literal) @number
103+
(escape_sequence) @escape
101104

102-
(true) @constant.builtin
103-
(false) @constant.builtin
104-
(nil) @constant.builtin
105+
[
106+
(int_literal)
107+
(float_literal)
108+
(imaginary_literal)
109+
] @number
110+
111+
[
112+
(true)
113+
(false)
114+
(nil)
115+
] @constant.builtin
105116

106117
(comment) @comment

0 commit comments

Comments
 (0)