github-linguist 5.0.10 → 5.0.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/grammars/source.batchfile.json +577 -76
  3. data/grammars/source.clojure.json +5 -18
  4. data/grammars/source.crystal.json +1 -1
  5. data/grammars/source.csound-document.json +80 -20
  6. data/grammars/source.css.json +1 -1
  7. data/grammars/source.css.less.json +5 -10
  8. data/grammars/source.d.json +4 -0
  9. data/grammars/source.dart.json +128 -478
  10. data/grammars/source.gfm.json +107 -86
  11. data/grammars/source.graphql.json +1 -0
  12. data/grammars/source.harbour.json +28 -16
  13. data/grammars/source.jison.json +5 -2
  14. data/grammars/source.jisonlex-injection.json +1 -1
  15. data/grammars/source.js.json +1 -1
  16. data/grammars/source.lua.json +117 -29
  17. data/grammars/source.modelica.json +4 -0
  18. data/grammars/source.nim.json +1 -1
  19. data/grammars/source.pep8.json +122 -0
  20. data/grammars/source.perl6fe.json +3 -3
  21. data/grammars/source.php.zephir.json +6 -6
  22. data/grammars/source.rust.json +60 -52
  23. data/grammars/source.shen.json +162 -0
  24. data/grammars/source.sqf.json +1 -1
  25. data/grammars/source.terraform.json +1 -1
  26. data/grammars/source.tla.json +1 -1
  27. data/grammars/source.yaml-ext.json +330 -0
  28. data/grammars/text.haml.json +42 -12
  29. data/grammars/text.html.basic.json +43 -1
  30. data/grammars/text.html.php.blade.json +10 -6
  31. data/grammars/text.html.php.json +18 -14
  32. data/grammars/text.html.soy.json +609 -0
  33. data/lib/linguist/generated.rb +4 -4
  34. data/lib/linguist/languages.json +1 -1
  35. data/lib/linguist/languages.yml +32 -4
  36. data/lib/linguist/samples.json +1336 -90
  37. data/lib/linguist/version.rb +1 -1
  38. metadata +6 -5
  39. data/grammars/source.pubspec.json +0 -13
  40. data/grammars/text.dart-analysis-output.json +0 -162
  41. data/grammars/text.dart-doccomments.json +0 -19
@@ -64,14 +64,11 @@
64
64
  },
65
65
  {
66
66
  "include": "#symbol"
67
- },
68
- {
69
- "include": "#whitespace"
70
67
  }
71
68
  ],
72
69
  "repository": {
73
70
  "comment": {
74
- "begin": ";",
71
+ "begin": "(?<!\\\\);",
75
72
  "beginCaptures": {
76
73
  "0": {
77
74
  "name": "punctuation.definition.comment.clojure"
@@ -217,18 +214,15 @@
217
214
  "name": "punctuation.section.expression.begin.clojure"
218
215
  }
219
216
  },
220
- "end": "(\\))(\\n)|(\\)(?=[\\}\\]\\)\\s]*(?:;|$)))|(\\))",
217
+ "end": "(\\))$|(\\)(?=[\\}\\]\\)\\s]*(?:;|$)))|(\\))",
221
218
  "endCaptures": {
222
219
  "1": {
223
220
  "name": "punctuation.section.expression.end.trailing.clojure"
224
221
  },
225
222
  "2": {
226
- "name": "meta.after-expression.clojure"
227
- },
228
- "3": {
229
223
  "name": "punctuation.section.expression.end.trailing.clojure"
230
224
  },
231
- "4": {
225
+ "3": {
232
226
  "name": "punctuation.section.expression.end.clojure"
233
227
  }
234
228
  },
@@ -293,18 +287,15 @@
293
287
  "name": "punctuation.section.expression.begin.clojure"
294
288
  }
295
289
  },
296
- "end": "(\\))(\\n)|(\\)(?=[\\}\\]\\)\\s]*(?:;|$)))|(\\))",
290
+ "end": "(\\))$|(\\)(?=[\\}\\]\\)\\s]*(?:;|$)))|(\\))",
297
291
  "endCaptures": {
298
292
  "1": {
299
293
  "name": "punctuation.section.expression.end.trailing.clojure"
300
294
  },
301
295
  "2": {
302
- "name": "meta.after-expression.clojure"
303
- },
304
- "3": {
305
296
  "name": "punctuation.section.expression.end.trailing.clojure"
306
297
  },
307
- "4": {
298
+ "3": {
308
299
  "name": "punctuation.section.expression.end.clojure"
309
300
  }
310
301
  },
@@ -448,10 +439,6 @@
448
439
  "include": "$self"
449
440
  }
450
441
  ]
451
- },
452
- "whitespace": {
453
- "match": "\\s+$",
454
- "name": "invalid.trailing-whitespace"
455
442
  }
456
443
  }
457
444
  }
@@ -133,7 +133,7 @@
133
133
  },
134
134
  {
135
135
  "comment": " just as above but being not a logical operation",
136
- "match": "(?<!\\.)\\b(alias|alias_method|break|next|redo|retry|return|super|type|undef|yield)\\b(?![?!])|\\bdefined\\?|\\bblock_given\\?",
136
+ "match": "(?<!\\.)\\b(alias|alias_method|break|next|redo|retry|return|super|type|undef|yield|out|pointerof|typeof)\\b(?![?!])|\\bdefined\\?|\\bblock_given\\?",
137
137
  "name": "keyword.control.pseudo-method.crystal"
138
138
  },
139
139
  {
@@ -7,31 +7,55 @@
7
7
  "firstLineMatch": "<CsoundSynthesi[sz]er>",
8
8
  "patterns": [
9
9
  {
10
- "begin": "<(CsoundSynthesi[sz]er)>",
11
- "end": "</(CsoundSynthesi[sz]er)>",
10
+ "begin": "(<)(CsoundSynthesi[sz]er)(>)",
11
+ "end": "(</)(CsoundSynthesi[sz]er)(>)",
12
12
  "beginCaptures": {
13
13
  "1": {
14
- "name": "entity.name.tag.csound-document"
14
+ "name": "punctuation.definition.tag.begin.csound-document"
15
+ },
16
+ "2": {
17
+ "name": "entity.name.tag.begin.csound-document"
18
+ },
19
+ "3": {
20
+ "name": "punctuation.definition.tag.begin.csound-document"
15
21
  }
16
22
  },
17
23
  "endCaptures": {
18
24
  "1": {
19
- "name": "entity.name.tag.csound-document"
25
+ "name": "punctuation.definition.tag.end.csound-document"
26
+ },
27
+ "2": {
28
+ "name": "entity.name.tag.end.csound-document"
29
+ },
30
+ "3": {
31
+ "name": "punctuation.definition.tag.end.csound-document"
20
32
  }
21
33
  },
22
34
  "patterns": [
23
35
  {
24
36
  "name": "meta.orchestra.csound-document",
25
- "begin": "<(CsOptions)>",
26
- "end": "</(CsOptions)>",
37
+ "begin": "(<)(CsOptions)(>)",
38
+ "end": "(</)(CsOptions)(>)",
27
39
  "beginCaptures": {
28
40
  "1": {
29
- "name": "entity.name.tag.csound-document"
41
+ "name": "punctuation.definition.tag.begin.csound-document"
42
+ },
43
+ "2": {
44
+ "name": "entity.name.tag.begin.csound-document"
45
+ },
46
+ "3": {
47
+ "name": "punctuation.definition.tag.begin.csound-document"
30
48
  }
31
49
  },
32
50
  "endCaptures": {
33
51
  "1": {
34
- "name": "entity.name.tag.csound-document"
52
+ "name": "punctuation.definition.tag.end.csound-document"
53
+ },
54
+ "2": {
55
+ "name": "entity.name.tag.end.csound-document"
56
+ },
57
+ "3": {
58
+ "name": "punctuation.definition.tag.end.csound-document"
35
59
  }
36
60
  },
37
61
  "patterns": [
@@ -42,16 +66,28 @@
42
66
  },
43
67
  {
44
68
  "name": "meta.orchestra.csound-document",
45
- "begin": "<(CsInstruments)>",
46
- "end": "</(CsInstruments)>",
69
+ "begin": "(<)(CsInstruments)(>)",
70
+ "end": "(</)(CsInstruments)(>)",
47
71
  "beginCaptures": {
48
72
  "1": {
49
- "name": "entity.name.tag.csound-document"
73
+ "name": "punctuation.definition.tag.begin.csound-document"
74
+ },
75
+ "2": {
76
+ "name": "entity.name.tag.begin.csound-document"
77
+ },
78
+ "3": {
79
+ "name": "punctuation.definition.tag.begin.csound-document"
50
80
  }
51
81
  },
52
82
  "endCaptures": {
53
83
  "1": {
54
- "name": "entity.name.tag.csound-document"
84
+ "name": "punctuation.definition.tag.end.csound-document"
85
+ },
86
+ "2": {
87
+ "name": "entity.name.tag.end.csound-document"
88
+ },
89
+ "3": {
90
+ "name": "punctuation.definition.tag.end.csound-document"
55
91
  }
56
92
  },
57
93
  "patterns": [
@@ -62,16 +98,28 @@
62
98
  },
63
99
  {
64
100
  "name": "meta.score.csound-document",
65
- "begin": "<(CsScore)>",
66
- "end": "</(CsScore)>",
101
+ "begin": "(<)(CsScore)(>)",
102
+ "end": "(</)(CsScore)(>)",
67
103
  "beginCaptures": {
68
104
  "1": {
69
- "name": "entity.name.tag.csound-document"
105
+ "name": "punctuation.definition.tag.begin.csound-document"
106
+ },
107
+ "2": {
108
+ "name": "entity.name.tag.begin.csound-document"
109
+ },
110
+ "3": {
111
+ "name": "punctuation.definition.tag.begin.csound-document"
70
112
  }
71
113
  },
72
114
  "endCaptures": {
73
115
  "1": {
74
- "name": "entity.name.tag.csound-document"
116
+ "name": "punctuation.definition.tag.end.csound-document"
117
+ },
118
+ "2": {
119
+ "name": "entity.name.tag.end.csound-document"
120
+ },
121
+ "3": {
122
+ "name": "punctuation.definition.tag.end.csound-document"
75
123
  }
76
124
  },
77
125
  "patterns": [
@@ -183,16 +231,28 @@
183
231
  "tags": {
184
232
  "patterns": [
185
233
  {
186
- "begin": "<([a-zA-Z0-9:-]+)>",
187
- "end": "</([a-zA-Z0-9:-]+)>",
234
+ "begin": "(<)([a-zA-Z0-9:-]+)(>)",
235
+ "end": "(</)([a-zA-Z0-9:-]+)(>)",
188
236
  "beginCaptures": {
189
237
  "1": {
190
- "name": "entity.name.tag.csound-document"
238
+ "name": "punctuation.definition.tag.begin.csound-document"
239
+ },
240
+ "2": {
241
+ "name": "entity.name.tag.begin.csound-document"
242
+ },
243
+ "3": {
244
+ "name": "punctuation.definition.tag.begin.csound-document"
191
245
  }
192
246
  },
193
247
  "endCaptures": {
194
248
  "1": {
195
- "name": "entity.name.tag.csound-document"
249
+ "name": "punctuation.definition.tag.end.csound-document"
250
+ },
251
+ "2": {
252
+ "name": "entity.name.tag.end.csound-document"
253
+ },
254
+ "3": {
255
+ "name": "punctuation.definition.tag.end.csound-document"
196
256
  }
197
257
  }
198
258
  }
@@ -1328,7 +1328,7 @@
1328
1328
  "name": "keyword.other.unit.${2:/downcase}.css"
1329
1329
  }
1330
1330
  },
1331
- "match": "(?xi) (?<![\\w-])\n[-+]? # Sign indicator\n\n(?: # Numerals\n [0-9]+ (?:\\.[0-9]+)? # Integer/float with leading digits\n | \\.[0-9]+ # Float without leading digits\n)\n\n(?: # Scientific notation\n (?<=[0-9]) # Exponent must follow a digit\n E # Exponent indicator\n [-+]? # Possible sign indicator\n [0-9]+ # Exponent value\n)?\n\n(?: # Possible unit for data-type:\n (%) # - Percentage\n | ( deg|grad|rad|turn # - Angle\n | Hz|kHz # - Frequency\n | ch|cm|em|ex|in|mm|mozmm|pc| # - Length\n pt|px|q|rem|vh|vmax|vmin|vw\n | dpi|dpcm|dppx # - Resolution\n | s|ms # - Time\n )\n \\b # Boundary checking intentionally lax to\n)? # facilitate embedding in CSS-like grammars",
1331
+ "match": "(?xi) (?<![\\w-])\n[-+]? # Sign indicator\n\n(?: # Numerals\n [0-9]+ (?:\\.[0-9]+)? # Integer/float with leading digits\n | \\.[0-9]+ # Float without leading digits\n)\n\n(?: # Scientific notation\n (?<=[0-9]) # Exponent must follow a digit\n E # Exponent indicator\n [-+]? # Possible sign indicator\n [0-9]+ # Exponent value\n)?\n\n(?: # Possible unit for data-type:\n (%) # - Percentage\n | ( deg|grad|rad|turn # - Angle\n | Hz|kHz # - Frequency\n | ch|cm|em|ex|fr|in|mm|mozmm| # - Length\n pc|pt|px|q|rem|vh|vmax|vmin|\n vw\n | dpi|dpcm|dppx # - Resolution\n | s|ms # - Time\n )\n \\b # Boundary checking intentionally lax to\n)? # facilitate embedding in CSS-like grammars",
1332
1332
  "name": "constant.numeric.css"
1333
1333
  }
1334
1334
  ]
@@ -146,12 +146,7 @@
146
146
  "name": "comment.block.css"
147
147
  },
148
148
  {
149
- "match": "[+-]?\\d*\\.?\\d+",
150
- "name": "constant.numeric.css"
151
- },
152
- {
153
- "match": "(?<=[\\d])(ch|cm|deg|dpi|dpcm|dppx|em|ex|grad|in|mm|ms|pc|pt|px|rad|rem|turn|s|vh|vmin|vw)\\b|%",
154
- "name": "keyword.other.unit.css"
149
+ "include": "source.css#numeric-values"
155
150
  },
156
151
  {
157
152
  "captures": {
@@ -281,13 +276,13 @@
281
276
  ]
282
277
  },
283
278
  {
279
+ "match": "(@|\\-\\-)[\\w-]+(?=\\s*)",
280
+ "name": "variable.other.less",
284
281
  "captures": {
285
282
  "1": {
286
283
  "name": "punctuation.definition.variable.less"
287
284
  }
288
- },
289
- "match": "(?:@|\\-\\-)[a-zA-Z0-9_-][\\w-]*(?=\\s*)",
290
- "name": "variable.other.less"
285
+ }
291
286
  },
292
287
  {
293
288
  "include": "#variable_interpolation"
@@ -516,7 +511,7 @@
516
511
  "include": "#strings"
517
512
  },
518
513
  {
519
- "match": "(\\b|\\.{0,2}/).*\\b",
514
+ "match": "(\\b|\\.{0,2}/)[^)]*\\b",
520
515
  "name": "string.url.css"
521
516
  }
522
517
  ]
@@ -376,6 +376,10 @@
376
376
  "match": "(\\-|\\+|\\*|\\/|~|%|\\^|\\^\\^)=?",
377
377
  "name": "keyword.operator.arithmetic.d"
378
378
  },
379
+ {
380
+ "match": "(\\.\\.\\.)",
381
+ "name": "keyword.operator.variadic.d"
382
+ },
379
383
  {
380
384
  "match": "(\\.\\.)",
381
385
  "name": "keyword.operator.slice.d"
@@ -2,6 +2,8 @@
2
2
  "fileTypes": [
3
3
  "dart"
4
4
  ],
5
+ "foldingStartMarker": "\\{\\s*$",
6
+ "foldingStopMarker": "^\\s*\\}",
5
7
  "name": "Dart",
6
8
  "patterns": [
7
9
  {
@@ -9,7 +11,7 @@
9
11
  "name": "meta.preprocessor.script.dart"
10
12
  },
11
13
  {
12
- "begin": "^\\s*\\b(library|import|export|part of|part)\\b",
14
+ "begin": "^\\w*\\b(library|import|part of|part|export)\\b",
13
15
  "beginCaptures": {
14
16
  "0": {
15
17
  "name": "keyword.other.import.dart"
@@ -27,7 +29,7 @@
27
29
  "include": "#strings"
28
30
  },
29
31
  {
30
- "match": "\\b(as|show|hide|deferred)\\b",
32
+ "match": "\\b(as|show|hide)\\b",
31
33
  "name": "keyword.other.import.dart"
32
34
  }
33
35
  ]
@@ -36,22 +38,13 @@
36
38
  "include": "#comments"
37
39
  },
38
40
  {
39
- "include": "#constants-and-special-vars"
41
+ "include": "#punctuation"
40
42
  },
41
43
  {
42
44
  "include": "#annotations"
43
45
  },
44
46
  {
45
- "include": "#decl-typedef"
46
- },
47
- {
48
- "include": "#decl-class"
49
- },
50
- {
51
- "include": "#decl-enum"
52
- },
53
- {
54
- "include": "#decl-function"
47
+ "include": "#constants-and-special-vars"
55
48
  },
56
49
  {
57
50
  "include": "#keywords"
@@ -61,21 +54,34 @@
61
54
  }
62
55
  ],
63
56
  "repository": {
64
- "annotations": {
57
+ "dartdoc": {
65
58
  "patterns": [
66
59
  {
60
+ "match": "(\\[.*?\\])",
61
+ "captures": {
62
+ "0": {
63
+ "name": "variable.name.source.dart"
64
+ }
65
+ }
66
+ },
67
+ {
68
+ "match": "(`.*?`)",
69
+ "captures": {
70
+ "0": {
71
+ "name": "variable.other.source.dart"
72
+ }
73
+ }
74
+ },
75
+ {
76
+ "match": "(\\* (( ).*))$",
67
77
  "captures": {
68
- "1": {
69
- "name": "annotation.dart"
70
- },
71
78
  "2": {
72
- "name": "entity.name.function.annotation.dart"
73
- },
74
- "3": {
75
- "name": "support.type.dart"
79
+ "name": "variable.other.source.dart"
76
80
  }
77
- },
78
- "match": "^(?:\\s*)((@)([a-zA-Z0-9_]+))"
81
+ }
82
+ },
83
+ {
84
+ "match": "(\\* .*)$"
79
85
  }
80
86
  ]
81
87
  },
@@ -91,451 +97,156 @@
91
97
  "name": "comment.block.empty.dart"
92
98
  },
93
99
  {
94
- "include": "#comments-inline"
95
- }
96
- ]
97
- },
98
- "comments-inline": {
99
- "patterns": [
100
- {
101
- "begin": "/\\*",
102
- "end": "\\*/",
103
- "name": "comment.block.dart",
104
- "patterns": [
105
- {
106
- "include": "text.dart-doccomments"
107
- }
108
- ]
109
- },
110
- {
111
- "begin": "(///)",
112
- "beginCaptures": {
113
- "1": {
114
- "name": "marker.dart"
115
- }
116
- },
117
- "end": "$",
118
- "name": "comment.line.triple-slash.dart",
119
- "patterns": [
120
- {
121
- "include": "text.dart-doccomments"
122
- }
123
- ]
124
- },
125
- {
126
- "begin": "(//)",
127
- "beginCaptures": {
128
- "1": {
129
- "name": "marker.dart"
130
- }
131
- },
132
- "end": "$",
133
- "name": "comment.line.double-slash.dart",
134
- "patterns": [
135
- {
136
- "include": "text.dart-doccomments"
137
- }
138
- ]
139
- }
140
- ]
141
- },
142
- "constants-and-special-vars": {
143
- "patterns": [
144
- {
145
- "match": "\\b(true|false|null)\\b",
146
- "name": "constant.language.dart"
100
+ "include": "#comments-doc-oldschool"
147
101
  },
148
102
  {
149
- "match": "\\b(this|super)\\b",
150
- "name": "variable.language.dart"
103
+ "include": "#comments-doc"
151
104
  },
152
105
  {
153
- "match": "\\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)\\b",
154
- "name": "constant.numeric.dart"
155
- }
156
- ]
157
- },
158
- "decl-class": {
159
- "patterns": [
160
- {
161
- "begin": "\\bclass\\b",
162
- "beginCaptures": {
163
- "0": {
164
- "name": "keyword.control.new.dart"
165
- }
166
- },
167
- "end": "(?={)",
168
- "name": "meta.declaration.class.dart",
169
- "patterns": [
170
- {
171
- "include": "#keywords"
172
- },
173
- {
174
- "match": "[A-Za-z_][A-Za-z0-9_]*",
175
- "name": "class.name.dart"
176
- }
177
- ]
106
+ "include": "#comments-inline"
178
107
  }
179
108
  ]
180
109
  },
181
- "decl-enum": {
110
+ "comments-doc-oldschool": {
182
111
  "patterns": [
183
112
  {
184
- "begin": "\\benum\\b",
185
- "beginCaptures": {
186
- "0": {
187
- "name": "keyword.declaration.dart"
188
- }
189
- },
190
- "end": "(?={)",
191
- "name": "meta.declaration.enum.dart",
113
+ "begin": "/\\*\\*",
114
+ "end": "\\*/",
115
+ "name": "comment.block.documentation.dart",
192
116
  "patterns": [
193
117
  {
194
- "include": "#keywords"
195
- },
196
- {
197
- "match": "[A-Za-z_][A-Za-z0-9_]*",
198
- "name": "enum.name.dart"
118
+ "include": "#dartdoc"
199
119
  }
200
120
  ]
201
121
  }
202
122
  ]
203
123
  },
204
- "decl-function": {
124
+ "comments-doc": {
205
125
  "patterns": [
206
126
  {
127
+ "match": "(///) (.*?)$",
207
128
  "captures": {
208
129
  "1": {
209
- "name": "storage.type.primitive.dart"
130
+ "name": "comment.block.triple-slash.dart"
210
131
  },
211
132
  "2": {
212
- "name": "keyword.declaration.dart"
213
- },
214
- "3": {
215
- "name": "function.name.dart"
133
+ "name": "variable.other.source.dart"
216
134
  }
217
- },
218
- "comment": "A getter with a primitive return type.",
219
- "match": "^\\s*(?:\\b(void|bool|num|int|double|dynamic|var|String|List|Map)\\b)\\s+(get)\\s+(\\w+)\\s+(?==>)",
220
- "name": "meta.declaration.function.dart"
135
+ }
221
136
  },
222
137
  {
138
+ "match": "(///)(.*?)$",
223
139
  "captures": {
224
140
  "1": {
225
- "name": "type.user-defined.dart"
141
+ "name": "comment.block.triple-slash.dart"
226
142
  },
227
143
  "2": {
228
- "name": "keyword.declaration.dart"
229
- },
230
- "3": {
231
- "name": "function.name.dart"
232
- }
233
- },
234
- "comment": "A getter with a user-defined return type or no return type.",
235
- "match": "^\\s*(?:\\b(\\w+)\\b\\s+)?(get)\\s+(\\w+)\\s+(?==>)",
236
- "name": "meta.declaration.function.dart"
237
- },
238
- {
239
- "begin": "^\\s*(set)\\s+(\\w+)(?=\\()",
240
- "beginCaptures": {
241
- "1": {
242
- "name": "keyword.declaration.dart"
243
- },
244
- "2": {
245
- "name": "function.name.dart"
246
- }
247
- },
248
- "comment": "A setter.",
249
- "end": "\\)",
250
- "name": "meta.declaration.function.dart",
251
- "patterns": [
252
- {
253
- "include": "#comments-inline"
254
- },
255
- {
256
- "include": "#decl-function-parameter"
257
- },
258
- {
259
- "include": "#strings"
260
- },
261
- {
262
- "include": "#keywords"
144
+ "name": "comment.block.documentation.dart",
145
+ "patterns": [
146
+ {
147
+ "include": "#dartdoc"
148
+ }
149
+ ]
263
150
  }
264
- ]
265
- },
151
+ }
152
+ }
153
+ ]
154
+ },
155
+ "comments-inline": {
156
+ "patterns": [
266
157
  {
267
- "begin": "^\\s*(?:\\b(void|bool|num|int|double|dynamic|var|String|List|Map)\\b)\\s+(\\w+)(?=\\()",
268
- "beginCaptures": {
269
- "1": {
270
- "name": "storage.type.primitive.dart"
271
- },
272
- "2": {
273
- "name": "function.name.dart"
274
- }
275
- },
276
- "comment": "A function with a primitive return type.",
277
- "end": "\\)",
278
- "name": "meta.declaration.function.dart",
279
- "patterns": [
280
- {
281
- "include": "#comments-inline"
282
- },
283
- {
284
- "include": "#decl-function-parameter"
285
- },
286
- {
287
- "include": "#strings"
288
- },
289
- {
290
- "include": "#keywords"
291
- }
292
- ]
158
+ "begin": "/\\*",
159
+ "end": "\\*/",
160
+ "name": "comment.block.dart"
293
161
  },
294
162
  {
295
- "begin": "^\\s*(?:\\b(return)\\b)\\s+(\\w+)(?=\\()",
296
- "beginCaptures": {
163
+ "captures": {
297
164
  "1": {
298
- "name": "keyword.control.dart"
299
- },
300
- "2": {
301
- "name": "function.name.dart"
165
+ "name": "comment.line.double-slash.dart"
302
166
  }
303
167
  },
304
- "comment": "A function invocation after 'return'",
305
- "end": "\\)",
306
- "name": "meta.invocation.function.dart",
307
- "patterns": [
308
- {
309
- "include": "#comments-inline"
310
- },
311
- {
312
- "include": "#decl-function-parameter"
313
- },
314
- {
315
- "include": "#strings"
316
- },
317
- {
318
- "include": "#keywords"
319
- }
320
- ]
321
- },
168
+ "match": "((//).*)$"
169
+ }
170
+ ]
171
+ },
172
+ "annotations": {
173
+ "patterns": [
322
174
  {
323
- "begin": "^\\s*\\b(new)\\b\\s+(\\w+)(?=\\()",
324
- "beginCaptures": {
325
- "1": {
326
- "name": "keyword.declaration.dart"
327
- },
328
- "2": {
329
- "name": "function.name.dart"
330
- }
331
- },
332
- "comment": "A class instantiation after 'new'",
333
- "end": "\\)",
334
- "name": "meta.invocation.function.dart",
335
- "patterns": [
336
- {
337
- "include": "#comments-inline"
338
- },
339
- {
340
- "include": "#decl-function-parameter"
341
- },
342
- {
343
- "include": "#strings"
344
- },
345
- {
346
- "include": "#keywords"
347
- }
348
- ]
175
+ "match": "@[a-zA-Z]+",
176
+ "name": "storage.type.annotation.dart"
349
177
  }
350
178
  ]
351
179
  },
352
- "decl-function-parameter": {
180
+ "constants-and-special-vars": {
353
181
  "patterns": [
354
182
  {
355
- "include": "#constants-and-special-vars"
183
+ "match": "\\b(true|false|null)\\b",
184
+ "name": "constant.language.dart"
356
185
  },
357
186
  {
358
- "begin": "(?:\\b(void|bool|num|int|double|dynamic|var|String|List|Map)\\b)\\s+(\\w+)(?=\\()",
359
- "beginCaptures": {
360
- "1": {
361
- "name": "storage.type.primitive.dart"
362
- },
363
- "2": {
364
- "name": "function.name.dart"
365
- }
366
- },
367
- "comment": "A function with a primitive return type.",
368
- "end": "\\)",
369
- "name": "meta.parameter.function.dart",
370
- "patterns": [
371
- {
372
- "include": "#decl-function-parameter"
373
- },
374
- {
375
- "include": "#strings"
376
- },
377
- {
378
- "include": "#keywords"
379
- }
380
- ]
187
+ "match": "\\b(this|super)\\b",
188
+ "name": "variable.language.dart"
381
189
  },
382
190
  {
383
- "begin": "\\b(new)\\b\\s+(\\w+)(?=\\()",
384
- "beginCaptures": {
385
- "1": {
386
- "name": "keyword.declaration.dart"
387
- },
388
- "2": {
389
- "name": "function.name.dart"
390
- }
391
- },
392
- "comment": "A class instantiation after 'new'",
393
- "end": "\\)",
394
- "name": "meta.invocation.function.dart",
395
- "patterns": [
396
- {
397
- "include": "#decl-function-parameter"
398
- },
399
- {
400
- "include": "#strings"
401
- },
402
- {
403
- "include": "#keywords"
404
- }
405
- ]
191
+ "match": "\\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)\\b",
192
+ "name": "constant.numeric.dart"
406
193
  },
407
194
  {
408
- "begin": "(?:\\b(\\w+)\\b)\\s+(\\w+)(?=\\()",
409
- "beginCaptures": {
410
- "1": {
411
- "name": "type.user-defined.dart"
412
- },
413
- "2": {
414
- "name": "function.name.dart"
415
- }
416
- },
417
- "comment": "A function with a user-defined return type.",
418
- "end": "\\)",
419
- "name": "meta.parameter.function.dart",
420
- "patterns": [
421
- {
422
- "include": "#decl-function-parameter"
423
- },
424
- {
425
- "include": "#strings"
426
- },
427
- {
428
- "include": "#keywords"
429
- }
430
- ]
195
+ "match": "\\b_?[A-Z][a-zA-Z0-9_]+\\b",
196
+ "name": "support.class.dart"
431
197
  },
432
198
  {
433
- "begin": "(\\w+)(?=\\()",
434
- "beginCaptures": {
199
+ "match": "(_?[a-z][a-zA-Z0-9_]+)(\\(|\\s+=>)",
200
+ "captures": {
435
201
  "1": {
436
- "name": "function.name.dart"
202
+ "name": "entity.name.function.dart"
437
203
  }
438
- },
439
- "comment": "A function with no return type.",
440
- "end": "\\)",
441
- "name": "meta.parameter.function.dart",
442
- "patterns": [
443
- {
444
- "include": "#decl-function-parameter"
445
- },
446
- {
447
- "include": "#strings"
448
- },
449
- {
450
- "include": "#keywords"
451
- }
452
- ]
453
- }
454
- ]
455
- },
456
- "decl-typedef": {
457
- "patterns": [
204
+ }
205
+ },
458
206
  {
459
- "begin": "typedef",
460
- "beginCaptures": {
461
- "0": {
462
- "name": "keyword.control.new.dart"
463
- }
464
- },
465
- "end": ";",
466
- "endCaptures": {
467
- "0": {
468
- "name": "punctuation.terminator.dart"
469
- }
470
- },
471
- "name": "meta.declaration.typedef.dart",
472
- "patterns": [
473
- {
474
- "captures": {
475
- "1": {
476
- "name": "storage.type.primitive.dart"
477
- },
478
- "2": {
479
- "name": "typedef.return.dart"
480
- },
481
- "3": {
482
- "name": "typedef.name.dart"
483
- }
484
- },
485
- "match": "(?:\\b(void|bool|num|int|double|dynamic|var|String|List|Map)\\b|([a-zA-Z_][a-zA-Z0-9_]*))\\s+([a-zA-Z_][a-zA-Z0-9_]+)"
486
- },
487
- {
488
- "begin": "\\(",
489
- "end": "\\)",
490
- "name": "typedef.params.dart",
491
- "patterns": [
492
- {
493
- "include": "#keywords"
494
- }
495
- ]
496
- }
497
- ]
207
+ "match": "\\b[A-Z_0-9]+\\b",
208
+ "name": "support.constant.dart"
498
209
  }
499
210
  ]
500
211
  },
501
212
  "keywords": {
502
213
  "patterns": [
503
- {
504
- "match": "\\bassert\\b",
505
- "name": "keyword.control.assert.dart"
506
- },
507
214
  {
508
215
  "match": "\\bas\\b",
509
216
  "name": "keyword.cast.dart"
510
217
  },
511
218
  {
512
- "match": "\\b(try|catch|finally|throw|on|rethrow)\\b",
219
+ "match": "\\b(try|on|catch|finally|throw|rethrow)\\b",
513
220
  "name": "keyword.control.catch-exception.dart"
514
221
  },
515
222
  {
516
- "match": "\\s+\\?\\s+|\\s+:\\s+",
517
- "name": "keyword.control.ternary.dart"
223
+ "match": "\\b(break|case|continue|default|do|else|for|if|in|return|switch|while)\\b",
224
+ "name": "keyword.control.dart"
518
225
  },
519
226
  {
520
- "match": "\\b(break|case|continue|default|do|else|for|if|in|return|switch|while)\\b",
227
+ "match": "\\b(sync(\\*)?|async(\\*)?|await|yield(\\*)?)\\b",
521
228
  "name": "keyword.control.dart"
522
229
  },
523
230
  {
524
- "match": "\\b(async\\*|async|await\\*|await|yield)\\b",
525
- "name": "keyword.control.async.dart"
231
+ "match": "\\bassert\\b",
232
+ "name": "keyword.control.dart"
526
233
  },
527
234
  {
528
235
  "match": "\\b(new)\\b",
529
236
  "name": "keyword.control.new.dart"
530
237
  },
531
238
  {
532
- "match": "\\b(abstract|extends|external|factory|implements|with|interface|get|native|operator|set|typedef)\\b",
239
+ "match": "\\b(abstract|class|enum|extends|external|factory|implements|interface|get|native|operator|set|typedef|with)\\b",
533
240
  "name": "keyword.declaration.dart"
534
241
  },
535
242
  {
536
243
  "match": "\\b(is\\!?)\\b",
537
244
  "name": "keyword.operator.dart"
538
245
  },
246
+ {
247
+ "match": "\\?|:",
248
+ "name": "keyword.operator.ternary.dart"
249
+ },
539
250
  {
540
251
  "match": "(<<|>>>?|~|\\^|\\||&)",
541
252
  "name": "keyword.operator.bitwise.dart"
@@ -545,7 +256,7 @@
545
256
  "name": "keyword.operator.assignment.bitwise.dart"
546
257
  },
547
258
  {
548
- "match": "(===?|!==?|<=?|>=?)",
259
+ "match": "(==|!=|<=?|>=?)",
549
260
  "name": "keyword.operator.comparison.dart"
550
261
  },
551
262
  {
@@ -568,110 +279,28 @@
568
279
  "match": "(!|&&|\\|\\|)",
569
280
  "name": "keyword.operator.logical.dart"
570
281
  },
571
- {
572
- "match": ";",
573
- "name": "punctuation.terminator.dart"
574
- },
575
282
  {
576
283
  "match": "\\b(static|final|const)\\b",
577
284
  "name": "storage.modifier.dart"
578
285
  },
579
286
  {
580
- "match": "\\b(?:void|bool|num|int|double|dynamic|var|String|List|Map)\\b",
287
+ "match": "\\b(?:void|bool|num|int|double|dynamic|var)\\b",
581
288
  "name": "storage.type.primitive.dart"
582
289
  }
583
290
  ]
584
291
  },
585
- "regexp": {
586
- "patterns": [
587
- {
588
- "match": "\\\\[^'\"]",
589
- "name": "constant.character.escaped.regex.dart"
590
- },
591
- {
592
- "begin": "\\(",
593
- "contentName": "meta.capture.regex.dart",
594
- "end": "\\)",
595
- "patterns": [
596
- {
597
- "match": "\\?(:|=|!)",
598
- "name": "ignore.capture.regex.dart"
599
- },
600
- {
601
- "include": "#regex.dart"
602
- }
603
- ]
604
- },
605
- {
606
- "match": "\\*|\\+|\\?|\\.|\\|",
607
- "name": "keyword.other.regex.dart"
608
- },
609
- {
610
- "match": "\\^|\\$",
611
- "name": "keyword.other.regex.dart"
612
- },
613
- {
614
- "match": "\\.",
615
- "name": "constant.other.regex.dart"
616
- },
617
- {
618
- "begin": "\\[(\\^)?",
619
- "beginCaptures": {
620
- "1": {
621
- "name": "keyword.other.negation.regex.dart"
622
- }
623
- },
624
- "end": "\\]",
625
- "name": "constant.character.range.regex.dart",
626
- "patterns": [
627
- {
628
- "match": "\\\\[^\"']",
629
- "name": "constant.character.escaped.regex.dart"
630
- }
631
- ]
632
- },
633
- {
634
- "match": "\\{(?:\\d+)?,(?:\\d+)?\\}",
635
- "name": "keyword.other.regex.dart"
636
- }
637
- ]
638
- },
639
292
  "string-interp": {
640
293
  "patterns": [
641
- {
642
- "begin": "(\\$)(\\{)",
643
- "beginCaptures": {
644
- "1": {
645
- "name": "keyword.other.dart"
646
- },
647
- "2": {
648
- "name": "keyword.other.dart"
649
- }
650
- },
651
- "contentName": "source.dart",
652
- "end": "(\\})",
653
- "endCaptures": {
654
- "1": {
655
- "name": "keyword.other.dart"
656
- }
657
- },
658
- "name": "interpolation.dart",
659
- "patterns": [
660
- {
661
- "include": "$self"
662
- }
663
- ]
664
- },
665
294
  {
666
295
  "captures": {
667
- "1": {
668
- "name": "keyword.other.dart"
669
- },
670
296
  "2": {
671
297
  "name": "variable.parameter.dart"
298
+ },
299
+ "3": {
300
+ "name": "variable.parameter.dart"
672
301
  }
673
302
  },
674
- "match": "(\\$)(\\w+)"
303
+ "match": "\\$((\\w+)|\\{(\\w+)\\})"
675
304
  },
676
305
  {
677
306
  "match": "\\\\.",
@@ -712,7 +341,7 @@
712
341
  "name": "string.quoted.triple.single.dart"
713
342
  },
714
343
  {
715
- "begin": "(?<!\\\\|r)\"",
344
+ "begin": "(?<!\\|r)\"",
716
345
  "end": "\"",
717
346
  "name": "string.interpolated.double.dart",
718
347
  "patterns": [
@@ -731,7 +360,8 @@
731
360
  "name": "string.quoted.double.dart",
732
361
  "patterns": [
733
362
  {
734
- "include": "#regexp"
363
+ "match": "\\n",
364
+ "name": "invalid.string.newline"
735
365
  }
736
366
  ]
737
367
  },
@@ -740,6 +370,10 @@
740
370
  "end": "'",
741
371
  "name": "string.interpolated.single.dart",
742
372
  "patterns": [
373
+ {
374
+ "match": "\\n",
375
+ "name": "invalid.string.newline"
376
+ },
743
377
  {
744
378
  "include": "#string-interp"
745
379
  }
@@ -751,13 +385,29 @@
751
385
  "name": "string.quoted.single.dart",
752
386
  "patterns": [
753
387
  {
754
- "include": "#regexp"
388
+ "match": "\\n",
389
+ "name": "invalid.string.newline"
755
390
  }
756
391
  ]
757
392
  }
758
393
  ]
394
+ },
395
+ "punctuation": {
396
+ "patterns": [
397
+ {
398
+ "match": ",",
399
+ "name": "punctuation.comma.dart"
400
+ },
401
+ {
402
+ "match": ";",
403
+ "name": "punctuation.terminator.dart"
404
+ },
405
+ {
406
+ "match": "\\.",
407
+ "name": "punctuation.dot.dart"
408
+ }
409
+ ]
759
410
  }
760
411
  },
761
- "scopeName": "source.dart",
762
- "uuid": "958518BC-799F-477A-99F9-5B28EBF230F6"
412
+ "scopeName": "source.dart"
763
413
  }