Skip to content

Commit 1fce425

Browse files
committed
[go] Update grammar to atom/language-go@d941ce3 (2016-10-10)
1 parent c7c960e commit 1fce425

4 files changed

Lines changed: 119 additions & 3 deletions

File tree

extensions/go/syntaxes/go.json

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,64 @@
170170
}
171171
}
172172
},
173+
{
174+
"comment": "Single line import declarations",
175+
"match": "(?<=import)(\\s+((?!\\s+\")[^\\s]*)?\\s*)((\")([^\"]*)(\"))",
176+
"captures": {
177+
"2": {
178+
"name": "entity.alias.import.go"
179+
},
180+
"3": {
181+
"name": "string.quoted.double.go"
182+
},
183+
"4": {
184+
"name": "punctuation.definition.string.begin.go"
185+
},
186+
"5": {
187+
"name": "entity.name.import.go"
188+
},
189+
"6": {
190+
"name": "punctuation.definition.string.end.go"
191+
}
192+
}
193+
},
194+
{
195+
"comment": "Multiline import declarations",
196+
"begin": "(?<=import)\\s+(\\()",
197+
"beginCaptures": {
198+
"1": {
199+
"name": "punctuation.other.bracket.round.go"
200+
}
201+
},
202+
"patterns": [
203+
{
204+
"match": "((?!\\s+\")[^\\s]*)?\\s+((\")([^\"]*)(\"))",
205+
"captures": {
206+
"1": {
207+
"name": "entity.alias.import.go"
208+
},
209+
"2": {
210+
"name": "string.quoted.double.go"
211+
},
212+
"3": {
213+
"name": "punctuation.definition.string.begin.go"
214+
},
215+
"4": {
216+
"name": "entity.name.import.go"
217+
},
218+
"5": {
219+
"name": "punctuation.definition.string.end.go"
220+
}
221+
}
222+
}
223+
],
224+
"end": "\\)",
225+
"endCaptures": {
226+
"0": {
227+
"name": "punctuation.other.bracket.round.go"
228+
}
229+
}
230+
},
173231
{
174232
"comment": "Type declarations",
175233
"match": "(?<=type)\\s+([a-zA-Z_]\\w*)",
@@ -549,5 +607,5 @@
549607
]
550608
}
551609
},
552-
"version": "https://github.com/atom/language-go/commit/93594dfb138a664f0914d54e408527e136899fb2"
610+
"version": "https://github.com/atom/language-go/commit/d941ce3155b500e65b4d7fbc53ea51b9c92ec1cb"
553611
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
var e [][]*aType // ( bug in highligher?)
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
[
2+
{
3+
"c": "var",
4+
"t": "go.keyword.var",
5+
"r": {
6+
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.keyword rgb(86, 156, 214)",
7+
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.keyword rgb(0, 0, 255)",
8+
"dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.keyword rgb(86, 156, 214)",
9+
"light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.keyword rgb(0, 0, 255)",
10+
"hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.keyword rgb(86, 156, 214)"
11+
}
12+
},
13+
{
14+
"c": " e [][]*aType // ( ",
15+
"t": "",
16+
"r": {
17+
"dark_plus": ".vs-dark .token rgb(212, 212, 212)",
18+
"light_plus": ".vs .token rgb(0, 0, 0)",
19+
"dark_vs": ".vs-dark .token rgb(212, 212, 212)",
20+
"light_vs": ".vs .token rgb(0, 0, 0)",
21+
"hc_black": ".hc-black .token rgb(255, 255, 255)"
22+
}
23+
},
24+
{
25+
"c": "bug",
26+
"t": "declaration.go.other.variable",
27+
"r": {
28+
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.variable rgb(156, 220, 254)",
29+
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.variable rgb(0, 16, 128)",
30+
"dark_vs": ".vs-dark .token rgb(212, 212, 212)",
31+
"light_vs": ".vs .token rgb(0, 0, 0)",
32+
"hc_black": ".hc-black .token rgb(255, 255, 255)"
33+
}
34+
},
35+
{
36+
"c": " in highligher?",
37+
"t": "",
38+
"r": {
39+
"dark_plus": ".vs-dark .token rgb(212, 212, 212)",
40+
"light_plus": ".vs .token rgb(0, 0, 0)",
41+
"dark_vs": ".vs-dark .token rgb(212, 212, 212)",
42+
"light_vs": ".vs .token rgb(0, 0, 0)",
43+
"hc_black": ".hc-black .token rgb(255, 255, 255)"
44+
}
45+
},
46+
{
47+
"c": ")",
48+
"t": "bracket.go.other.punctuation.round",
49+
"r": {
50+
"dark_plus": ".vs-dark .token rgb(212, 212, 212)",
51+
"light_plus": ".vs .token rgb(0, 0, 0)",
52+
"dark_vs": ".vs-dark .token rgb(212, 212, 212)",
53+
"light_vs": ".vs .token rgb(0, 0, 0)",
54+
"hc_black": ".hc-black .token rgb(255, 255, 255)"
55+
}
56+
}
57+
]

extensions/go/test/colorize-results/test_go.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
},
9090
{
9191
"c": "encoding/base64",
92-
"t": "double.go.quoted.string",
92+
"t": "double.entity.go.import.name.quoted.string",
9393
"r": {
9494
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.string rgb(206, 145, 120)",
9595
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.string rgb(163, 21, 21)",
@@ -133,7 +133,7 @@
133133
},
134134
{
135135
"c": "fmt",
136-
"t": "double.go.quoted.string",
136+
"t": "double.entity.go.import.name.quoted.string",
137137
"r": {
138138
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.string rgb(206, 145, 120)",
139139
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.string rgb(163, 21, 21)",

0 commit comments

Comments
 (0)