tm-grammars 1.26.0 → 1.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -458,7 +458,7 @@
458
458
  "match": "(?i)^\\s*([-\\w]+)\\s*(\\[)?\\s*([-\\w]+|\"[-\\w\\s]+\")?\\s*(])?$"
459
459
  },
460
460
  {
461
- "begin": "(?i)\\s+([-\\w]+)\\s*(\\[)?\\s*([-\\w]+|\"[-\\w\\s]+\")?\\s*(])?\\s*(\\{)",
461
+ "begin": "(?i)\\s*([-\\w]+)\\s*(\\[)?\\s*([-\\w]+|\"[-\\w\\s]+\")?\\s*(])?\\s*(\\{)",
462
462
  "beginCaptures": {
463
463
  "1": {
464
464
  "name": "variable"
@@ -498,7 +498,7 @@
498
498
  "name": "string"
499
499
  }
500
500
  },
501
- "match": "(?i)\\s*([-\\w]+)\\s+([-\\w]+)\\s+([FPU]K(?:,\\s*[FPU]K){0,2})?\\s*(\"[!-(*-/:-?\\\\^\\w\\s]*\")?\\s*"
501
+ "match": "(?i)\\s*([-\\w]+)\\s+([-\\w]+)\\s+([FPU]K(?:,\\s*[FPU]K){0,2})?\\s*(\"[^\\n\\r\"]*\")?\\s*"
502
502
  },
503
503
  {
504
504
  "match": "%%.*",
@@ -1081,6 +1081,70 @@
1081
1081
  }
1082
1082
  ]
1083
1083
  },
1084
+ {
1085
+ "begin": "^\\s*(mindmap)",
1086
+ "beginCaptures": {
1087
+ "1": {
1088
+ "name": "keyword.control.mermaid"
1089
+ }
1090
+ },
1091
+ "end": "(^|\\G)(?=\\s*[:`~]{3,}\\s*$)",
1092
+ "patterns": [
1093
+ {
1094
+ "match": "%%.*",
1095
+ "name": "comment"
1096
+ },
1097
+ {
1098
+ "captures": {
1099
+ "1": {
1100
+ "name": "keyword.control.mermaid"
1101
+ },
1102
+ "2": {
1103
+ "name": "string"
1104
+ }
1105
+ },
1106
+ "match": "(?i)(\\s*:::)(\\s*[!-$\\&'*-/;-?\\\\^\\w\\s]*)"
1107
+ },
1108
+ {
1109
+ "captures": {
1110
+ "1": {
1111
+ "name": "keyword.control.mermaid"
1112
+ },
1113
+ "2": {
1114
+ "name": "punctuation.parenthesis.open.mermaid"
1115
+ },
1116
+ "3": {
1117
+ "name": "string"
1118
+ },
1119
+ "4": {
1120
+ "name": "punctuation.parenthesis.close.mermaid"
1121
+ }
1122
+ },
1123
+ "match": "(?i)(\\s*::icon)(\\s*\\()(\\s*[!-$\\&'*-/;-?\\\\^\\w\\s]*)(\\s*\\))"
1124
+ },
1125
+ {
1126
+ "captures": {
1127
+ "1": {
1128
+ "name": "variable"
1129
+ },
1130
+ "2": {
1131
+ "name": "keyword.control.mermaid"
1132
+ },
1133
+ "3": {
1134
+ "name": "string"
1135
+ },
1136
+ "4": {
1137
+ "name": "keyword.control.mermaid"
1138
+ }
1139
+ },
1140
+ "match": "(?i)(\\s*[!-$\\&'*-/:-?\\\\^\\w\\s]*)(\\s*\\({1,2}|\\){1,2}|\\{\\{|\\[)(\\s*[!-$\\&'*-/:-?\\\\^\\w\\s]*)(\\s*\\){1,2}|\\({1,2}|}}|])"
1141
+ },
1142
+ {
1143
+ "match": "^(\\s*[!-$\\&'*-/:-?\\\\^\\w\\s]*)",
1144
+ "name": "string"
1145
+ }
1146
+ ]
1147
+ },
1084
1148
  {
1085
1149
  "begin": "^\\s*(pie)",
1086
1150
  "beginCaptures": {
@@ -2001,7 +2065,7 @@
2001
2065
  ]
2002
2066
  },
2003
2067
  "mermaid-code-block": {
2004
- "begin": "(?i)(?<=[`~])mermaid(\\s+[^`~]*)?$",
2068
+ "begin": "(?i)(?<=[`~])\\s*mermaid(\\s+[^`~]*)?$",
2005
2069
  "contentName": "meta.embedded.block.mermaid",
2006
2070
  "end": "(^|\\G)(?=\\s*[`~]{3,}\\s*$)",
2007
2071
  "patterns": [
@@ -2011,7 +2075,7 @@
2011
2075
  ]
2012
2076
  },
2013
2077
  "mermaid-code-block-with-attributes": {
2014
- "begin": "(?i)(?<=[`~])\\{\\s*\\.?mermaid(\\s+[^`~]*)?$",
2078
+ "begin": "(?i)(?<=[`~])\\s*\\{\\s*\\.?mermaid(\\s+[^`~]*)?$",
2015
2079
  "contentName": "meta.embedded.block.mermaid",
2016
2080
  "end": "(^|\\G)(?=\\s*[`~]{3,}\\s*$)",
2017
2081
  "patterns": [
@@ -3592,7 +3592,7 @@
3592
3592
  "name": "variable.other.python"
3593
3593
  }
3594
3594
  },
3595
- "match": "\\b(var|let|alias) \\s*([_[:alpha:]]\\w*)\\b"
3595
+ "match": "\\b(var|let|alias|comptime) \\s*([_[:alpha:]]\\w*)\\b"
3596
3596
  }
3597
3597
  ]
3598
3598
  },
@@ -0,0 +1,393 @@
1
+ {
2
+ "displayName": "MoonBit",
3
+ "fileTypes": [
4
+ "mbt"
5
+ ],
6
+ "name": "moonbit",
7
+ "patterns": [
8
+ {
9
+ "include": "#strings"
10
+ },
11
+ {
12
+ "include": "#comments"
13
+ },
14
+ {
15
+ "include": "#constants"
16
+ },
17
+ {
18
+ "include": "#keywords"
19
+ },
20
+ {
21
+ "include": "#functions"
22
+ },
23
+ {
24
+ "include": "#support"
25
+ },
26
+ {
27
+ "include": "#attribute"
28
+ },
29
+ {
30
+ "include": "#types"
31
+ },
32
+ {
33
+ "include": "#modules"
34
+ },
35
+ {
36
+ "include": "#variables"
37
+ }
38
+ ],
39
+ "repository": {
40
+ "attribute": {
41
+ "patterns": [
42
+ {
43
+ "captures": {
44
+ "1": {
45
+ "name": "keyword.control.directive"
46
+ },
47
+ "2": {
48
+ "patterns": [
49
+ {
50
+ "include": "#strings"
51
+ },
52
+ {
53
+ "match": "[ .0-9A-Z_a-z]+",
54
+ "name": "entity.name.tag"
55
+ },
56
+ {
57
+ "match": "=",
58
+ "name": "keyword.operator.attribute.moonbit"
59
+ }
60
+ ]
61
+ }
62
+ },
63
+ "match": "(#[a-z][ .0-9A-Z_a-z]*)(.*)"
64
+ }
65
+ ]
66
+ },
67
+ "comments": {
68
+ "patterns": [
69
+ {
70
+ "match": "//[^/].*",
71
+ "name": "comment.line"
72
+ },
73
+ {
74
+ "begin": "///",
75
+ "name": "comment.block.documentation.moonbit",
76
+ "patterns": [
77
+ {
78
+ "begin": "\\s*```",
79
+ "beginCaptures": {
80
+ "0": {
81
+ "name": "markup.fenced_code.block.markdown"
82
+ }
83
+ },
84
+ "end": "\\s*```",
85
+ "endCaptures": {
86
+ "0": {
87
+ "name": "markup.fenced_code.block.markdown"
88
+ }
89
+ },
90
+ "name": "meta.embedded.line.moonbit",
91
+ "patterns": [
92
+ {
93
+ "include": "$self"
94
+ }
95
+ ]
96
+ },
97
+ {
98
+ "match": ".*",
99
+ "name": "comment.block.documentation.moonbit"
100
+ }
101
+ ],
102
+ "while": "///"
103
+ }
104
+ ]
105
+ },
106
+ "constants": {
107
+ "patterns": [
108
+ {
109
+ "match": "\\b\\d([_\\d])*(?!\\.)((U)?(L)?|N?)\\b",
110
+ "name": "constant.numeric.moonbit"
111
+ },
112
+ {
113
+ "match": "(?<=\\.)\\d((?=\\.)|\\b)",
114
+ "name": "constant.numeric.moonbit"
115
+ },
116
+ {
117
+ "match": "\\b\\d+(?=\\.\\.)",
118
+ "name": "constant.numeric.moonbit"
119
+ },
120
+ {
121
+ "match": "\\b\\d[_\\d]*\\.[_\\d]*([Ee][-+]?\\d[_\\d]*\\b)?",
122
+ "name": "constant.numeric.moonbit"
123
+ },
124
+ {
125
+ "match": "\\b0[Oo][0-7][0-7]*((U)?(L)?|N?)\\b",
126
+ "name": "constant.numeric.moonbit"
127
+ },
128
+ {
129
+ "match": "\\b0[Xx][A-Fa-f\\d][A-F_a-f\\d]*(([LU]|UL|N)\\b|\\.[A-F_a-f\\d]*([Pp][-+]?[A-F_a-f\\d]+\\b)?)?",
130
+ "name": "constant.numeric.moonbit"
131
+ },
132
+ {
133
+ "match": "\\b(true|false)\\b",
134
+ "name": "constant.language.moonbit"
135
+ }
136
+ ]
137
+ },
138
+ "escape": {
139
+ "patterns": [
140
+ {
141
+ "match": "\\\\[\"'0\\\\bnrt]",
142
+ "name": "constant.character.escape.moonbit"
143
+ },
144
+ {
145
+ "match": "\\\\x\\h{2}",
146
+ "name": "constant.character.escape.moonbit"
147
+ },
148
+ {
149
+ "match": "\\\\o[0-3][0-7]{2}",
150
+ "name": "constant.character.escape.moonbit"
151
+ },
152
+ {
153
+ "match": "\\\\u\\h{4}",
154
+ "name": "constant.character.escape.unicode.moonbit"
155
+ },
156
+ {
157
+ "match": "\\\\u\\{\\h*}",
158
+ "name": "constant.character.escape.unicode.moonbit"
159
+ }
160
+ ]
161
+ },
162
+ "functions": {
163
+ "patterns": [
164
+ {
165
+ "captures": {
166
+ "1": {
167
+ "name": "keyword.moonbit"
168
+ },
169
+ "2": {
170
+ "name": "entity.name.type.moonbit"
171
+ },
172
+ "3": {
173
+ "name": "entity.name.function.moonbit"
174
+ }
175
+ },
176
+ "match": "\\b(fn)\\b\\s*(?:([A-Z][0-9A-Z_a-z]*)::)?([0-9_a-z][0-9A-Z_a-z]*)?\\b"
177
+ },
178
+ {
179
+ "begin": "(?!\\bfn\\s+)(?:\\.|::)?([0-9_a-z][0-9A-Z_a-z]*([!?]|!!)?)\\s*(\\()",
180
+ "beginCaptures": {
181
+ "1": {
182
+ "name": "entity.name.function.moonbit"
183
+ },
184
+ "2": {
185
+ "name": "punctuation.brackets.round.moonbit"
186
+ }
187
+ },
188
+ "end": "\\)",
189
+ "endCaptures": {
190
+ "0": {
191
+ "name": "punctuation.brackets.round.moonbit"
192
+ }
193
+ },
194
+ "name": "meta.function.call.moonbit",
195
+ "patterns": [
196
+ {
197
+ "include": "#comments"
198
+ },
199
+ {
200
+ "include": "#constants"
201
+ },
202
+ {
203
+ "include": "#keywords"
204
+ },
205
+ {
206
+ "include": "#functions"
207
+ },
208
+ {
209
+ "include": "#support"
210
+ },
211
+ {
212
+ "include": "#types"
213
+ },
214
+ {
215
+ "include": "#modules"
216
+ },
217
+ {
218
+ "include": "#strings"
219
+ },
220
+ {
221
+ "include": "#variables"
222
+ }
223
+ ]
224
+ }
225
+ ]
226
+ },
227
+ "interpolation": {
228
+ "patterns": [
229
+ {
230
+ "begin": "\\\\\\{",
231
+ "beginCaptures": {
232
+ "0": {
233
+ "name": "punctuation.section.embedded.begin.moonbit"
234
+ }
235
+ },
236
+ "contentName": "source.moonbit",
237
+ "end": "}",
238
+ "endCaptures": {
239
+ "0": {
240
+ "name": "punctuation.section.embedded.end.moonbit"
241
+ }
242
+ },
243
+ "name": "meta.embedded.line.moonbit",
244
+ "patterns": [
245
+ {
246
+ "include": "$self"
247
+ }
248
+ ]
249
+ }
250
+ ]
251
+ },
252
+ "keywords": {
253
+ "patterns": [
254
+ {
255
+ "match": "\\b(async)\\b",
256
+ "name": "keyword.control.moonbit.async"
257
+ },
258
+ {
259
+ "match": "\\b(guard|if|while|break|continue|return|try|catch|except|raise|noraise|match|lexmatch|using|else|as|in|is|loop|for|async|defer)\\b",
260
+ "name": "keyword.control.moonbit"
261
+ },
262
+ {
263
+ "match": "\\b(type!|lexmatch\\?|(type|typealias|let|const|enum|struct|import|trait|traitalias|derive|test|impl|with|fnalias|recur|suberror|letrec|and)\\b)",
264
+ "name": "keyword.moonbit"
265
+ },
266
+ {
267
+ "match": "\\b(mut|pub|priv|readonly|extern)\\b",
268
+ "name": "storage.modifier.moonbit"
269
+ },
270
+ {
271
+ "match": "->",
272
+ "name": "storage.type.function.arrow.moonbit"
273
+ },
274
+ {
275
+ "match": "=>",
276
+ "name": "storage.type.function.arrow.moonbit"
277
+ },
278
+ {
279
+ "match": "=",
280
+ "name": "keyword.operator.assignment.moonbit"
281
+ },
282
+ {
283
+ "match": "\\|>",
284
+ "name": "keyword.operator.other.moonbit"
285
+ },
286
+ {
287
+ "match": "(===?|!=|>=|<=|(?<!-)(?<!\\|)>(?!>)|<(?!<))",
288
+ "name": "keyword.operator.comparison.moonbit"
289
+ },
290
+ {
291
+ "match": "(\\bnot\\b|&&|\\|\\|)",
292
+ "name": "keyword.operator.logical.moonbit"
293
+ },
294
+ {
295
+ "match": "(\\|(?!\\|)(?!>)|&(?!&)|\\^|<<|>>)",
296
+ "name": "keyword.operator.bitwise.moonbit"
297
+ },
298
+ {
299
+ "match": "(\\+|-(?!>)|[%*/])",
300
+ "name": "keyword.operator.math.moonbit"
301
+ }
302
+ ]
303
+ },
304
+ "modules": {
305
+ "patterns": [
306
+ {
307
+ "match": "@[A-Za-z][/-9A-Z_a-z]*",
308
+ "name": "entity.name.namespace.moonbit"
309
+ }
310
+ ]
311
+ },
312
+ "strings": {
313
+ "patterns": [
314
+ {
315
+ "captures": {
316
+ "1": {
317
+ "name": "keyword.operator.other.moonbit"
318
+ }
319
+ },
320
+ "match": "(#\\|).*",
321
+ "name": "string.line"
322
+ },
323
+ {
324
+ "captures": {
325
+ "1": {
326
+ "name": "keyword.operator.other.moonbit"
327
+ },
328
+ "2": {
329
+ "patterns": [
330
+ {
331
+ "include": "#escape"
332
+ },
333
+ {
334
+ "include": "#interpolation"
335
+ }
336
+ ]
337
+ }
338
+ },
339
+ "match": "(\\$\\|)(.*)",
340
+ "name": "string.line"
341
+ },
342
+ {
343
+ "begin": "'",
344
+ "end": "'",
345
+ "name": "string.quoted.single.moonbit",
346
+ "patterns": [
347
+ {
348
+ "include": "#escape"
349
+ }
350
+ ]
351
+ },
352
+ {
353
+ "begin": "\"",
354
+ "end": "\"",
355
+ "name": "string.quoted.double.moonbit",
356
+ "patterns": [
357
+ {
358
+ "include": "#escape"
359
+ },
360
+ {
361
+ "include": "#interpolation"
362
+ }
363
+ ]
364
+ }
365
+ ]
366
+ },
367
+ "support": {
368
+ "patterns": [
369
+ {
370
+ "match": "\\b(Eq|Compare|Hash|Show|Default|ToJson|FromJson)\\b",
371
+ "name": "support.class.moonbit"
372
+ }
373
+ ]
374
+ },
375
+ "types": {
376
+ "patterns": [
377
+ {
378
+ "match": "\\b(?<!@)[A-Z][0-9A-Z_a-z]*((\\?)+|\\b)",
379
+ "name": "entity.name.type.moonbit"
380
+ }
381
+ ]
382
+ },
383
+ "variables": {
384
+ "patterns": [
385
+ {
386
+ "match": "\\b(?<!\\.|::)[_a-z][0-9A-Z_a-z]*\\b",
387
+ "name": "variable.other.moonbit"
388
+ }
389
+ ]
390
+ }
391
+ },
392
+ "scopeName": "source.moonbit"
393
+ }
@@ -71,7 +71,7 @@
71
71
  "include": "#comments"
72
72
  },
73
73
  {
74
- "begin": "([A-Za-z][0-9A-Z_a-z]*)\\s*(=)\\s*(0[Xx]\\h+|[0-9]+)",
74
+ "begin": "([A-Za-z][0-9A-Z_a-z]*)\\s*(=)\\s*(-?0[Xx]\\h+|-?[0-9]+)",
75
75
  "beginCaptures": {
76
76
  "1": {
77
77
  "name": "variable.other.proto"
@@ -98,7 +98,7 @@
98
98
  ]
99
99
  },
100
100
  "field": {
101
- "begin": "\\s*(optional|repeated|required)?\\s*\\b([.\\w]+)\\s+(\\w+)\\s*(=)\\s*(0[Xx]\\h+|[0-9]+)",
101
+ "begin": "\\s*(optional|repeated|required)?\\s*(\\.?[.\\w]+)\\s+(\\w+)\\s*(=)\\s*(0[Xx]\\h+|[0-9]+)",
102
102
  "beginCaptures": {
103
103
  "1": {
104
104
  "name": "storage.modifier.proto"
@@ -150,7 +150,7 @@
150
150
  ]
151
151
  },
152
152
  "ident": {
153
- "match": "[A-Za-z][0-9A-Z_a-z]*",
153
+ "match": "\\.?[A-Za-z][.0-9A-Z_a-z]*",
154
154
  "name": "entity.name.class.proto"
155
155
  },
156
156
  "import": {
@@ -202,7 +202,7 @@
202
202
  ]
203
203
  },
204
204
  "mapfield": {
205
- "begin": "\\s*(map)\\s*(<)\\s*([.\\w]+)\\s*,\\s*([.\\w]+)\\s*(>)\\s+(\\w+)\\s*(=)\\s*(\\d+)",
205
+ "begin": "\\s*(map)\\s*(<)\\s*(\\.?[.\\w]+)\\s*,\\s*(\\.?[.\\w]+)\\s*(>)\\s+(\\w+)\\s*(=)\\s*(\\d+)",
206
206
  "beginCaptures": {
207
207
  "1": {
208
208
  "name": "storage.type.proto"
@@ -470,7 +470,7 @@
470
470
  "name": "storage.type.proto"
471
471
  },
472
472
  "string": {
473
- "match": "('(['[^']])*')|(\"([\"[^\"]])*\")",
473
+ "match": "([\"'])(?:\\\\.|[^\\\\])*?\\1",
474
474
  "name": "string.quoted.double.proto"
475
475
  },
476
476
  "subMsgOption": {