Skip to content

Commit 7728b70

Browse files
committed
[go] update grammar
1 parent fb84773 commit 7728b70

1 file changed

Lines changed: 17 additions & 8 deletions

File tree

extensions/go/syntaxes/go.json

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@
227227
]
228228
},
229229
{
230-
"match": "(?<!var)\\s*(\\w+(?:,\\s*\\w+)*)(?=\\s*=(?!=))",
230+
"match": "(?<!var)\\s*(\\w+(?:\\.\\w+)?(?:,\\s*\\w+(?:\\.\\w+)?)*)(?=\\s*=(?!=))",
231231
"captures": {
232232
"1": {
233233
"patterns": [
@@ -236,8 +236,17 @@
236236
"name": "invalid.illegal.identifier.go"
237237
},
238238
{
239-
"match": "\\w+",
240-
"name": "variable.other.assignment.go"
239+
"match": "\\w+(?:\\.\\w+)?",
240+
"name": "variable.other.assignment.go",
241+
"captures": {
242+
"0": {
243+
"patterns": [
244+
{
245+
"include": "#delimiters"
246+
}
247+
]
248+
}
249+
}
241250
},
242251
{
243252
"include": "#delimiters"
@@ -384,10 +393,10 @@
384393
},
385394
"patterns": [
386395
{
387-
"include": "#imports"
396+
"include": "#comments"
388397
},
389398
{
390-
"include": "#comments"
399+
"include": "#imports"
391400
}
392401
]
393402
}
@@ -538,7 +547,7 @@
538547
"variables": {
539548
"patterns": [
540549
{
541-
"match": "(\\w+(?:,\\s*\\w+)*)(\\s+\\*?\\w+\\s*)?(?=\\s*=)",
550+
"match": "(\\w+(?:,\\s*\\w+)*)(\\s+\\*?\\w+(?:\\.\\w+)?\\s*)?(?=\\s*=)",
542551
"captures": {
543552
"1": {
544553
"patterns": [
@@ -565,7 +574,7 @@
565574
}
566575
},
567576
{
568-
"match": "(\\w+(?:,\\s*\\w+)*)(\\s+(\\[\\d*\\])*\\*?\\w+\\s*[^=].*)",
577+
"match": "(\\w+(?:,\\s*\\w+)*)(\\s+(\\[(\\d*|\\.\\.\\.)\\])*\\*?\\w+(?:\\.\\w+)?\\s*[^=].*)",
569578
"captures": {
570579
"1": {
571580
"patterns": [
@@ -616,5 +625,5 @@
616625
]
617626
}
618627
},
619-
"version": "https://github.com/atom/language-go/commit/6de3f61efa8e8afb9ef0d5bc19c797c8469ec9f8"
628+
"version": "https://github.com/atom/language-go/commit/190bfd97cc97bd9228dc12feaa7329afb2e070fa"
620629
}

0 commit comments

Comments
 (0)