-
-
Notifications
You must be signed in to change notification settings - Fork 30
/
source.pkl.js
405 lines (403 loc) · 25.9 KB
/
source.pkl.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
// This is a TextMate grammar distributed by `starry-night`.
// This grammar is developed at
// <https://github.com/apple/pkl.tmbundle>
// and licensed `apache-2.0`.
// See <https://github.com/wooorm/starry-night> for more info.
/**
* @import {Grammar} from '@wooorm/starry-night'
*/
/** @type {Grammar} */
const grammar = {
extensions: ['.pkl'],
names: ['pkl'],
patterns: [
{
captures: {
1: {name: 'variable.language.pkl'},
2: {name: 'variable.other.module.pkl'}
},
match:
'(?x:\n \\b\n (module)\n \\s+\n (\n [\\p{L}_$][\\p{L}0-9_$]*(?:\\.[\\p{L}_$][\\p{L}0-9_$]*)*\n )\n)'
},
{
captures: {
1: {name: 'keyword.class.pkl'},
2: {name: 'entity.name.type.pkl'},
3: {name: 'punctuation.pkl'},
4: {name: 'entity.name.type.pkl'}
},
match:
'(?x:\n (typealias)\n \\s+\n ([\\p{L}_$][\\p{L}0-9_$]*)\n \\s*(=)\\s*\n ((?x:\n (?x:\n [\\p{L}_$][\\p{L}0-9_$]* # ident\n \\s*\n (?:<[^>]*>)? # optional type parameters\n \\s*\n (?:\\([^)]*\\))? # optional constraint (this is an approximation)\n \\s*\n \\?? # optional nulability indicator\n)\n \\s*\n (\\|\\s*(?x:\n [\\p{L}_$][\\p{L}0-9_$]* # ident\n \\s*\n (?:<[^>]*>)? # optional type parameters\n \\s*\n (?:\\([^)]*\\))? # optional constraint (this is an approximation)\n \\s*\n \\?? # optional nulability indicator\n))*\n))\n)'
},
{
captures: {1: {name: 'keyword.class.pkl'}},
match: '\\b(class)\\s+[\\p{L}_$][\\p{L}0-9_$]*',
name: 'entity.name.type.pkl'
},
{
captures: {
1: {name: 'keyword.control.pkl'},
2: {name: 'variable.other.property.pkl'},
3: {name: 'variable.other.property.pkl'},
4: {name: 'storage.modifier.pkl'}
},
match:
'(?x:\n \\b(for)\n \\s*\\(\n ([\\p{L}_$][\\p{L}0-9_$]*)(?:\\s*,\\s*([\\p{L}_$][\\p{L}0-9_$]*))* # bindings\n \\s+\n (in)\n)'
},
{
captures: {
1: {name: 'keyword.control.pkl'},
2: {name: 'entity.name.type.pkl'}
},
match:
'\\b(new)\\s+((?x:\n (?x:\n [\\p{L}_$][\\p{L}0-9_$]* # ident\n \\s*\n (?:<[^>]*>)? # optional type parameters\n \\s*\n (?:\\([^)]*\\))? # optional constraint (this is an approximation)\n \\s*\n \\?? # optional nulability indicator\n)\n \\s*\n (\\|\\s*(?x:\n [\\p{L}_$][\\p{L}0-9_$]* # ident\n \\s*\n (?:<[^>]*>)? # optional type parameters\n \\s*\n (?:\\([^)]*\\))? # optional constraint (this is an approximation)\n \\s*\n \\?? # optional nulability indicator\n))*\n))'
},
{
captures: {
1: {name: 'keyword.pkl'},
2: {name: 'variable.other.property.pkl'}
},
match: '\\b(function)\\s+([\\p{L}_$][\\p{L}0-9_$]*)'
},
{
captures: {1: {name: 'keyword.pkl'}, 2: {name: 'entity.name.type.pkl'}},
match:
'\\b(as)\\s+((?x:\n (?x:\n [\\p{L}_$][\\p{L}0-9_$]* # ident\n \\s*\n (?:<[^>]*>)? # optional type parameters\n \\s*\n (?:\\([^)]*\\))? # optional constraint (this is an approximation)\n \\s*\n \\?? # optional nulability indicator\n)\n \\s*\n (\\|\\s*(?x:\n [\\p{L}_$][\\p{L}0-9_$]* # ident\n \\s*\n (?:<[^>]*>)? # optional type parameters\n \\s*\n (?:\\([^)]*\\))? # optional constraint (this is an approximation)\n \\s*\n \\?? # optional nulability indicator\n))*\n))'
},
{match: '\\b(true|false|null)\\b', name: 'constant.character.language.pkl'},
{match: '//.*', name: 'comment.line.pkl'},
{begin: '/\\*', end: '\\*/', name: 'comment.block.pkl'},
{
begin:
'(?x:\n (\n (?:\\b|\\s*)[\\p{L}_$][\\p{L}0-9_$]* # variable name\n |\n `[^`]+` # quoted variable name\n )\n \\s*\n (:)\n \\s*\n ((?x:\n (?x:\n [\\p{L}_$][\\p{L}0-9_$]* # ident\n \\s*\n (?:<[^>]*>)? # optional type parameters\n \\s*\n (?:\\([^)]*\\))? # optional constraint (this is an approximation)\n \\s*\n \\?? # optional nulability indicator\n)\n \\s*\n (\\|\\s*(?x:\n [\\p{L}_$][\\p{L}0-9_$]* # ident\n \\s*\n (?:<[^>]*>)? # optional type parameters\n \\s*\n (?:\\([^)]*\\))? # optional constraint (this is an approximation)\n \\s*\n \\?? # optional nulability indicator\n))*\n)) # type\n)',
captures: {
1: {name: 'variable.other.property.pkl'},
2: {name: 'punctuation.pkl'},
3: {name: 'entity.name.type.pkl'}
},
end: '\\s*=|,|\\)|^[ \\t]*$'
},
{
captures: {
1: {name: 'variable.other.property.pkl'},
2: {name: 'punctuation.pkl'}
},
match:
'(?x:\n (\n \\b[\\p{L}_$][\\p{L}0-9_$]* # variable name\n |\n `[^`]+` # quoted variable name\n )\n \\s*\n (=)(?!=)\n)'
},
{
captures: {
1: {name: 'punctuation.pkl'},
2: {name: 'entity.name.type.pkl'}
},
match:
'(:)\\s*((?x:\n (?x:\n [\\p{L}_$][\\p{L}0-9_$]* # ident\n \\s*\n (?:<[^>]*>)? # optional type parameters\n \\s*\n (?:\\([^)]*\\))? # optional constraint (this is an approximation)\n \\s*\n \\?? # optional nulability indicator\n)\n \\s*\n (\\|\\s*(?x:\n [\\p{L}_$][\\p{L}0-9_$]* # ident\n \\s*\n (?:<[^>]*>)? # optional type parameters\n \\s*\n (?:\\([^)]*\\))? # optional constraint (this is an approximation)\n \\s*\n \\?? # optional nulability indicator\n))*\n))'
},
{
captures: {1: {name: 'variable.other.property.pkl'}},
match: '^\\s*([\\p{L}_$][\\p{L}0-9_$]*)\\s*\\{'
},
{
match:
'\\b(hidden|local|abstract|external|open|in|out|amends|extends|fixed|const)\\b',
name: 'storage.modifier.pkl'
},
{
match:
'\\b(amends|as|extends|function|is|let|read|read\\?|import|throw|trace)\\b',
name: 'keyword.pkl'
},
{match: '\\b(if|else|when|for|import|new)\\b', name: 'keyword.control.pkl'},
{
match:
'(?x:\n \\b\n 0x(?:[\\da-fA-F][\\da-fA-F_]*[\\da-fA-F]|[\\da-fA-F_])\n \\b\n)',
name: 'constant.numeric.hex.pkl'
},
{
match: '(?x:\n \\b\n 0b(?:[0-1][0-1_]*[0-1]|[0-1])\n \\b\n)',
name: 'constant.numeric.binary.pkl'
},
{
match: '(?x:\n \\b\n 0o(?:[0-7][0-7_]*[0-7]|[0-7])\n \\b\n)',
name: 'constant.numeric.octal.pkl'
},
{
match: '(?x:\n \\b\n (?:\\d[0-9_]*\\d|\\d)\n \\b\n)',
name: 'constant.numeric.decimal.pkl'
},
{
match:
'(?x:\n \\b\n (?:\n (?:\\d[0-9_]*\\d|\\d)? # 0 or more digits\n \\. # dot literal\n (?:\\d[0-9_]*\\d|\\d) # 1 or more digits\n (?:[eE][+-]?(?:\\d[0-9_]*\\d|\\d))? # optional exponent\n | # OR\n (?:\\d[0-9_]*\\d|\\d) # 1 or more digits\n [eE][+-]?(?:\\d[0-9_]*\\d|\\d) # exponent\n )\n \\b\n)',
name: 'constant.numeric.pkl'
},
{
match:
'(?x:\n # MATH\n \\+ # add\n |\n - # minus\n |\n \\* # multiply\n |\n / # divide\n |\n ~/ # integer divide\n |\n % # modulo\n |\n \\*\\* # power\n |\n > # greater than\n |\n >= # greater than or equals\n |\n < # less than\n |\n <= # less than or equals\n |\n == # equals\n |\n != # not equals\n\n # LOGICAL\n |\n ! # unary not\n |\n && # and\n |\n \\|\\| # or\n |\n\n # MISCELLANEOUS\n \\|> # function pipe\n |\n \\?\\? # nullish coalesce\n |\n !! # non-null assertion\n |\n = # assignment\n |\n -> # lambda arrow\n |\n \\| # type union\n)',
name: 'keyword.operator.pkl'
},
{match: '\\b(this|module|outer|super)\\b', name: 'variable.language.pkl'},
{match: '\\b(unknown|never)\\b', name: 'support.type.pkl'},
{match: '[(){}\\[\\]]', name: 'meta.brace.pkl'},
{match: '\\b(class|typealias)\\b', name: 'keyword.class.pkl'},
{
match:
'(?x:\n \\.\\? # optional chain\n |\n \\. # member access\n |\n ; # semicolon\n |\n : # colon\n)',
name: 'punctuation.pkl'
},
{match: '@[\\p{L}_$][\\p{L}0-9_$]*', name: 'entity.name.type.pkl'},
{
begin: '(""")',
captures: {1: {name: 'punctuation.delimiter.pkl'}},
end: '(""")',
name: 'string.quoted.triple.0.pkl',
patterns: [
{
captures: {
1: {name: 'invalid.illegal.unrecognized-string-escape.pkl'}
},
match:
'(?x: # turn on extended mode\n \\\\\n (?:\n [trn"\\\\] # tab, carriage return, newline, quote, backslash\n | # OR\n u # the letter u\n \\{ # curly opening brace literal\n [\\da-fA-F]+ # 1 or more hex number literal\n } # curly end literal\n | # OR\n \\( # interpolation start\n .+? # one or more characters lazily (correct syntax highlighting within here should be provided by semantic tokens)\n \\) # interpolation end\n )\n | # OR\n ( # capture group: invalid escape\n \\\\ # the escape char\n . # any character\n )\n)',
name: 'constant.character.escape.0.pkl'
}
]
},
{
begin: '(")',
beginCaptures: {1: {name: 'punctuation.delimiter.pkl'}},
end: '(?x:\n (") # string end\n | # OR\n (.?$) # error; unterminated string (flag last character as an error)\n)',
endCaptures: {
1: {name: 'punctuation.delimimter.pkl'},
2: {name: 'invalid.illegal.newline.pkl'}
},
name: 'string.quoted.double.0.pkl',
patterns: [
{
captures: {
1: {name: 'invalid.illegal.unrecognized-string-escape.pkl'}
},
match:
'(?x: # turn on extended mode\n \\\\\n (?:\n [trn"\\\\] # tab, carriage return, newline, quote, backslash\n | # OR\n u # the letter u\n \\{ # curly opening brace literal\n [\\da-fA-F]+ # 1 or more hex number literal\n } # curly end literal\n | # OR\n \\( # interpolation start\n .+? # one or more characters lazily (correct syntax highlighting within here should be provided by semantic tokens)\n \\) # interpolation end\n )\n | # OR\n ( # capture group: invalid escape\n \\\\ # the escape char\n . # any character\n )\n)',
name: 'constant.character.escape.0.pkl'
}
]
},
{
begin: '(#""")',
captures: {1: {name: 'punctuation.delimiter.pkl'}},
end: '("""#)',
name: 'string.quoted.triple.1.pkl',
patterns: [
{
captures: {
1: {name: 'invalid.illegal.unrecognized-string-escape.pkl'}
},
match:
'(?x: # turn on extended mode\n \\\\\\#\n (?:\n [trn"\\\\] # tab, carriage return, newline, quote, backslash\n | # OR\n u # the letter u\n \\{ # curly opening brace literal\n [\\da-fA-F]+ # 1 or more hex number literal\n } # curly end literal\n | # OR\n \\( # interpolation start\n .+? # one or more characters lazily (correct syntax highlighting within here should be provided by semantic tokens)\n \\) # interpolation end\n )\n | # OR\n ( # capture group: invalid escape\n \\\\\\# # the escape char\n . # any character\n )\n)',
name: 'constant.character.escape.1.pkl'
}
]
},
{
begin: '(#")',
beginCaptures: {1: {name: 'punctuation.delimiter.pkl'}},
end: '(?x:\n ("\\#) # string end\n | # OR\n (.?$) # error; unterminated string (flag last character as an error)\n)',
endCaptures: {
1: {name: 'punctuation.delimimter.pkl'},
2: {name: 'invalid.illegal.newline.pkl'}
},
name: 'string.quoted.double.1.pkl',
patterns: [
{
captures: {
1: {name: 'invalid.illegal.unrecognized-string-escape.pkl'}
},
match:
'(?x: # turn on extended mode\n \\\\\\#\n (?:\n [trn"\\\\] # tab, carriage return, newline, quote, backslash\n | # OR\n u # the letter u\n \\{ # curly opening brace literal\n [\\da-fA-F]+ # 1 or more hex number literal\n } # curly end literal\n | # OR\n \\( # interpolation start\n .+? # one or more characters lazily (correct syntax highlighting within here should be provided by semantic tokens)\n \\) # interpolation end\n )\n | # OR\n ( # capture group: invalid escape\n \\\\\\# # the escape char\n . # any character\n )\n)',
name: 'constant.character.escape.1.pkl'
}
]
},
{
begin: '(##""")',
captures: {1: {name: 'punctuation.delimiter.pkl'}},
end: '("""##)',
name: 'string.quoted.triple.2.pkl',
patterns: [
{
captures: {
1: {name: 'invalid.illegal.unrecognized-string-escape.pkl'}
},
match:
'(?x: # turn on extended mode\n \\\\\\#\\#\n (?:\n [trn"\\\\] # tab, carriage return, newline, quote, backslash\n | # OR\n u # the letter u\n \\{ # curly opening brace literal\n [\\da-fA-F]+ # 1 or more hex number literal\n } # curly end literal\n | # OR\n \\( # interpolation start\n .+? # one or more characters lazily (correct syntax highlighting within here should be provided by semantic tokens)\n \\) # interpolation end\n )\n | # OR\n ( # capture group: invalid escape\n \\\\\\#\\# # the escape char\n . # any character\n )\n)',
name: 'constant.character.escape.2.pkl'
}
]
},
{
begin: '(##")',
beginCaptures: {1: {name: 'punctuation.delimiter.pkl'}},
end: '(?x:\n ("\\#\\#) # string end\n | # OR\n (.?$) # error; unterminated string (flag last character as an error)\n)',
endCaptures: {
1: {name: 'punctuation.delimimter.pkl'},
2: {name: 'invalid.illegal.newline.pkl'}
},
name: 'string.quoted.double.2.pkl',
patterns: [
{
captures: {
1: {name: 'invalid.illegal.unrecognized-string-escape.pkl'}
},
match:
'(?x: # turn on extended mode\n \\\\\\#\\#\n (?:\n [trn"\\\\] # tab, carriage return, newline, quote, backslash\n | # OR\n u # the letter u\n \\{ # curly opening brace literal\n [\\da-fA-F]+ # 1 or more hex number literal\n } # curly end literal\n | # OR\n \\( # interpolation start\n .+? # one or more characters lazily (correct syntax highlighting within here should be provided by semantic tokens)\n \\) # interpolation end\n )\n | # OR\n ( # capture group: invalid escape\n \\\\\\#\\# # the escape char\n . # any character\n )\n)',
name: 'constant.character.escape.2.pkl'
}
]
},
{
begin: '(###""")',
captures: {1: {name: 'punctuation.delimiter.pkl'}},
end: '("""###)',
name: 'string.quoted.triple.3.pkl',
patterns: [
{
captures: {
1: {name: 'invalid.illegal.unrecognized-string-escape.pkl'}
},
match:
'(?x: # turn on extended mode\n \\\\\\#\\#\\#\n (?:\n [trn"\\\\] # tab, carriage return, newline, quote, backslash\n | # OR\n u # the letter u\n \\{ # curly opening brace literal\n [\\da-fA-F]+ # 1 or more hex number literal\n } # curly end literal\n | # OR\n \\( # interpolation start\n .+? # one or more characters lazily (correct syntax highlighting within here should be provided by semantic tokens)\n \\) # interpolation end\n )\n | # OR\n ( # capture group: invalid escape\n \\\\\\#\\#\\# # the escape char\n . # any character\n )\n)',
name: 'constant.character.escape.3.pkl'
}
]
},
{
begin: '(###")',
beginCaptures: {1: {name: 'punctuation.delimiter.pkl'}},
end: '(?x:\n ("\\#\\#\\#) # string end\n | # OR\n (.?$) # error; unterminated string (flag last character as an error)\n)',
endCaptures: {
1: {name: 'punctuation.delimimter.pkl'},
2: {name: 'invalid.illegal.newline.pkl'}
},
name: 'string.quoted.double.3.pkl',
patterns: [
{
captures: {
1: {name: 'invalid.illegal.unrecognized-string-escape.pkl'}
},
match:
'(?x: # turn on extended mode\n \\\\\\#\\#\\#\n (?:\n [trn"\\\\] # tab, carriage return, newline, quote, backslash\n | # OR\n u # the letter u\n \\{ # curly opening brace literal\n [\\da-fA-F]+ # 1 or more hex number literal\n } # curly end literal\n | # OR\n \\( # interpolation start\n .+? # one or more characters lazily (correct syntax highlighting within here should be provided by semantic tokens)\n \\) # interpolation end\n )\n | # OR\n ( # capture group: invalid escape\n \\\\\\#\\#\\# # the escape char\n . # any character\n )\n)',
name: 'constant.character.escape.3.pkl'
}
]
},
{
begin: '(####""")',
captures: {1: {name: 'punctuation.delimiter.pkl'}},
end: '("""####)',
name: 'string.quoted.triple.4.pkl',
patterns: [
{
captures: {
1: {name: 'invalid.illegal.unrecognized-string-escape.pkl'}
},
match:
'(?x: # turn on extended mode\n \\\\\\#\\#\\#\\#\n (?:\n [trn"\\\\] # tab, carriage return, newline, quote, backslash\n | # OR\n u # the letter u\n \\{ # curly opening brace literal\n [\\da-fA-F]+ # 1 or more hex number literal\n } # curly end literal\n | # OR\n \\( # interpolation start\n .+? # one or more characters lazily (correct syntax highlighting within here should be provided by semantic tokens)\n \\) # interpolation end\n )\n | # OR\n ( # capture group: invalid escape\n \\\\\\#\\#\\#\\# # the escape char\n . # any character\n )\n)',
name: 'constant.character.escape.4.pkl'
}
]
},
{
begin: '(####")',
beginCaptures: {1: {name: 'punctuation.delimiter.pkl'}},
end: '(?x:\n ("\\#\\#\\#\\#) # string end\n | # OR\n (.?$) # error; unterminated string (flag last character as an error)\n)',
endCaptures: {
1: {name: 'punctuation.delimimter.pkl'},
2: {name: 'invalid.illegal.newline.pkl'}
},
name: 'string.quoted.double.4.pkl',
patterns: [
{
captures: {
1: {name: 'invalid.illegal.unrecognized-string-escape.pkl'}
},
match:
'(?x: # turn on extended mode\n \\\\\\#\\#\\#\\#\n (?:\n [trn"\\\\] # tab, carriage return, newline, quote, backslash\n | # OR\n u # the letter u\n \\{ # curly opening brace literal\n [\\da-fA-F]+ # 1 or more hex number literal\n } # curly end literal\n | # OR\n \\( # interpolation start\n .+? # one or more characters lazily (correct syntax highlighting within here should be provided by semantic tokens)\n \\) # interpolation end\n )\n | # OR\n ( # capture group: invalid escape\n \\\\\\#\\#\\#\\# # the escape char\n . # any character\n )\n)',
name: 'constant.character.escape.4.pkl'
}
]
},
{
begin: '(#####""")',
captures: {1: {name: 'punctuation.delimiter.pkl'}},
end: '("""#####)',
name: 'string.quoted.triple.5.pkl',
patterns: [
{
captures: {
1: {name: 'invalid.illegal.unrecognized-string-escape.pkl'}
},
match:
'(?x: # turn on extended mode\n \\\\\\#\\#\\#\\#\\#\n (?:\n [trn"\\\\] # tab, carriage return, newline, quote, backslash\n | # OR\n u # the letter u\n \\{ # curly opening brace literal\n [\\da-fA-F]+ # 1 or more hex number literal\n } # curly end literal\n | # OR\n \\( # interpolation start\n .+? # one or more characters lazily (correct syntax highlighting within here should be provided by semantic tokens)\n \\) # interpolation end\n )\n | # OR\n ( # capture group: invalid escape\n \\\\\\#\\#\\#\\#\\# # the escape char\n . # any character\n )\n)',
name: 'constant.character.escape.5.pkl'
}
]
},
{
begin: '(#####")',
beginCaptures: {1: {name: 'punctuation.delimiter.pkl'}},
end: '(?x:\n ("\\#\\#\\#\\#\\#) # string end\n | # OR\n (.?$) # error; unterminated string (flag last character as an error)\n)',
endCaptures: {
1: {name: 'punctuation.delimimter.pkl'},
2: {name: 'invalid.illegal.newline.pkl'}
},
name: 'string.quoted.double.5.pkl',
patterns: [
{
captures: {
1: {name: 'invalid.illegal.unrecognized-string-escape.pkl'}
},
match:
'(?x: # turn on extended mode\n \\\\\\#\\#\\#\\#\\#\n (?:\n [trn"\\\\] # tab, carriage return, newline, quote, backslash\n | # OR\n u # the letter u\n \\{ # curly opening brace literal\n [\\da-fA-F]+ # 1 or more hex number literal\n } # curly end literal\n | # OR\n \\( # interpolation start\n .+? # one or more characters lazily (correct syntax highlighting within here should be provided by semantic tokens)\n \\) # interpolation end\n )\n | # OR\n ( # capture group: invalid escape\n \\\\\\#\\#\\#\\#\\# # the escape char\n . # any character\n )\n)',
name: 'constant.character.escape.5.pkl'
}
]
},
{
begin: '(######""")',
captures: {1: {name: 'punctuation.delimiter.pkl'}},
end: '("""######)',
name: 'string.quoted.triple.6.pkl',
patterns: [
{
captures: {
1: {name: 'invalid.illegal.unrecognized-string-escape.pkl'}
},
match:
'(?x: # turn on extended mode\n \\\\\\#\\#\\#\\#\\#\\#\n (?:\n [trn"\\\\] # tab, carriage return, newline, quote, backslash\n | # OR\n u # the letter u\n \\{ # curly opening brace literal\n [\\da-fA-F]+ # 1 or more hex number literal\n } # curly end literal\n | # OR\n \\( # interpolation start\n .+? # one or more characters lazily (correct syntax highlighting within here should be provided by semantic tokens)\n \\) # interpolation end\n )\n | # OR\n ( # capture group: invalid escape\n \\\\\\#\\#\\#\\#\\#\\# # the escape char\n . # any character\n )\n)',
name: 'constant.character.escape.6.pkl'
}
]
},
{
begin: '(######")',
beginCaptures: {1: {name: 'punctuation.delimiter.pkl'}},
end: '(?x:\n ("\\#\\#\\#\\#\\#\\#) # string end\n | # OR\n (.?$) # error; unterminated string (flag last character as an error)\n)',
endCaptures: {
1: {name: 'punctuation.delimimter.pkl'},
2: {name: 'invalid.illegal.newline.pkl'}
},
name: 'string.quoted.double.6.pkl',
patterns: [
{
captures: {
1: {name: 'invalid.illegal.unrecognized-string-escape.pkl'}
},
match:
'(?x: # turn on extended mode\n \\\\\\#\\#\\#\\#\\#\\#\n (?:\n [trn"\\\\] # tab, carriage return, newline, quote, backslash\n | # OR\n u # the letter u\n \\{ # curly opening brace literal\n [\\da-fA-F]+ # 1 or more hex number literal\n } # curly end literal\n | # OR\n \\( # interpolation start\n .+? # one or more characters lazily (correct syntax highlighting within here should be provided by semantic tokens)\n \\) # interpolation end\n )\n | # OR\n ( # capture group: invalid escape\n \\\\\\#\\#\\#\\#\\#\\# # the escape char\n . # any character\n )\n)',
name: 'constant.character.escape.6.pkl'
}
]
}
],
scopeName: 'source.pkl'
}
export default grammar