@live-codes/browser-compilers 0.5.1 → 0.5.2

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.
@@ -0,0 +1,710 @@
1
+ // 'WebAssembly Text Format' Monarch language
2
+ // from https://github.com/AssemblyScript/website/blob/main/src/.vuepress/public/scripts/wat.js
3
+ export default {
4
+ config: {
5
+ brackets: [
6
+ ['(', ')'],
7
+ ['if', 'end'],
8
+ ['loop', 'end'],
9
+ ['block', 'end'],
10
+ ],
11
+ autoClosingPairs: [
12
+ { open: '(', close: ')' },
13
+ { open: 'if', close: 'end' },
14
+ { open: 'loop', close: 'end' },
15
+ { open: 'block', close: 'end' },
16
+ ],
17
+ surroundingPairs: [
18
+ { open: '(', close: ')' },
19
+ { open: 'if', close: 'end' },
20
+ { open: 'loop', close: 'end' },
21
+ { open: 'block', close: 'end' },
22
+ ],
23
+ },
24
+ tokens: {
25
+ keywords: [
26
+ 'module',
27
+ 'import',
28
+ 'export',
29
+ 'memory',
30
+ 'data',
31
+ 'table',
32
+ 'elem',
33
+ 'start',
34
+ 'func',
35
+ 'tag',
36
+ 'type',
37
+ 'param',
38
+ 'result',
39
+ 'global',
40
+ 'local',
41
+ 'mut',
42
+ 'struct',
43
+ 'array',
44
+ 'field',
45
+ ],
46
+ types: [
47
+ 'i8',
48
+ 'i16',
49
+ 'i32',
50
+ 'i64',
51
+ 'f32',
52
+ 'f64',
53
+ 'v128',
54
+ 'i31ref',
55
+ 'eqref',
56
+ 'anyref',
57
+ 'dataref',
58
+ 'externref',
59
+ 'funcref',
60
+ 'exnref',
61
+ 'extern',
62
+ 'null',
63
+ 'any',
64
+ 'eq',
65
+ ],
66
+ instructions: [
67
+ 'pop',
68
+ 'nop',
69
+ 'drop',
70
+ 'data.drop',
71
+ 'elem.drop',
72
+ 'local.get',
73
+ 'local.set',
74
+ 'local.tee',
75
+ 'global.get',
76
+ 'global.set',
77
+ 'tuple.make',
78
+ 'tuple.extract',
79
+ 'select',
80
+ 'v128.const',
81
+ 'v128.and',
82
+ 'v128.or',
83
+ 'v128.xor',
84
+ 'v128.not',
85
+ 'v128.andnot',
86
+ 'v128.bitselect',
87
+ 'v128.load',
88
+ 'v128.load8x8_s',
89
+ 'v128.load8x8_u',
90
+ 'v128.load16x4_s',
91
+ 'v128.load16x4_u',
92
+ 'v128.load32x2_s',
93
+ 'v128.load32x2_u',
94
+ 'v128.load8_lane',
95
+ 'v128.load16_lane',
96
+ 'v128.load32_lane',
97
+ 'v128.load64_lane',
98
+ 'v128.load8_splat',
99
+ 'v128.load16_splat',
100
+ 'v128.load32_splat',
101
+ 'v128.load64_splat',
102
+ 'v128.load32_zero',
103
+ 'v128.load64_zero',
104
+ 'v128.store',
105
+ 'v128.store8_lane',
106
+ 'v128.store16_lane',
107
+ 'v128.store32_lane',
108
+ 'v128.store64_lane',
109
+ 'v128.any_true',
110
+ 'i8x16.shuffle',
111
+ 'i8x16.swizzle',
112
+ 'i8x16.bitmask',
113
+ 'i8x16.splat',
114
+ 'i8x16.popcnt',
115
+ 'i8x16.replace_lane',
116
+ 'i8x16.extract_lane_s',
117
+ 'i8x16.extract_lane_u',
118
+ 'i8x16.all_true',
119
+ 'i8x16.abs',
120
+ 'i8x16.add',
121
+ 'i8x16.add_sat_s',
122
+ 'i8x16.add_sat_u',
123
+ 'i8x16.sub',
124
+ 'i8x16.sub_sat_s',
125
+ 'i8x16.sub_sat_u',
126
+ 'i8x16.mul',
127
+ 'i8x16.neg',
128
+ 'i8x16.shl',
129
+ 'i8x16.shr_s',
130
+ 'i8x16.shr_u',
131
+ 'i8x16.eq',
132
+ 'i8x16.ne',
133
+ 'i8x16.lt_s',
134
+ 'i8x16.lt_u',
135
+ 'i8x16.le_s',
136
+ 'i8x16.le_u',
137
+ 'i8x16.gt_s',
138
+ 'i8x16.gt_u',
139
+ 'i8x16.ge_s',
140
+ 'i8x16.ge_u',
141
+ 'i8x16.min_s',
142
+ 'i8x16.min_u',
143
+ 'i8x16.max_s',
144
+ 'i8x16.max_u',
145
+ 'i8x16.avgr_u',
146
+ 'i8x16.narrow_i16x8_s',
147
+ 'i8x16.narrow_i16x8_u',
148
+ 'i16x8.bitmask',
149
+ 'i16x8.splat',
150
+ 'i16x8.load_8x8_s',
151
+ 'i16x8.load_8x8_u',
152
+ 'i16x8.replace_lane',
153
+ 'i16x8.extract_lane_s',
154
+ 'i16x8.extract_lane_u',
155
+ 'i16x8.extend_low_i8x16_s',
156
+ 'i16x8.extend_high_i8x16_s',
157
+ 'i16x8.extend_low_i8x16_u',
158
+ 'i16x8.extend_high_i8x16_u',
159
+ 'i16x8.all_true',
160
+ 'i16x8.abs',
161
+ 'i16x8.add',
162
+ 'i16x8.add_sat_s',
163
+ 'i16x8.add_sat_u',
164
+ 'i16x8.extadd_pairwise_i8x16_s',
165
+ 'i16x8.extadd_pairwise_i8x16_u',
166
+ 'i16x8.sub',
167
+ 'i16x8.sub_sat_s',
168
+ 'i16x8.sub_sat_u',
169
+ 'i16x8.q15mulr_sat_s',
170
+ 'i16x8.mul',
171
+ 'i16x8.extmul_low_i8x16_s',
172
+ 'i16x8.extmul_high_i8x16_s',
173
+ 'i16x8.extmul_low_i8x16_u',
174
+ 'i16x8.extmul_high_i8x16_u',
175
+ 'i16x8.neg',
176
+ 'i16x8.shl',
177
+ 'i16x8.shr_s',
178
+ 'i16x8.shr_u',
179
+ 'i16x8.eq',
180
+ 'i16x8.ne',
181
+ 'i16x8.lt_s',
182
+ 'i16x8.lt_u',
183
+ 'i16x8.le_s',
184
+ 'i16x8.le_u',
185
+ 'i16x8.gt_s',
186
+ 'i16x8.gt_u',
187
+ 'i16x8.ge_s',
188
+ 'i16x8.ge_u',
189
+ 'i16x8.min_s',
190
+ 'i16x8.min_u',
191
+ 'i16x8.max_s',
192
+ 'i16x8.max_u',
193
+ 'i16x8.avgr_u',
194
+ 'i16x8.narrow_i32x4_s',
195
+ 'i16x8.narrow_i32x4_u',
196
+ 'i32x4.bitmask',
197
+ 'i32x4.splat',
198
+ 'i32x4.load_16x4_s',
199
+ 'i32x4.load_16x4_u',
200
+ 'i32x4.replace_lane',
201
+ 'i32x4.extract_lane',
202
+ 'i32x4.extend_low_i16x8_s',
203
+ 'i32x4.extend_high_i16x8_s',
204
+ 'i32x4.extend_low_i16x8_u',
205
+ 'i32x4.extend_high_i16x8_u',
206
+ 'i32x4.all_true',
207
+ 'i32x4.abs',
208
+ 'i32x4.add',
209
+ 'i32x4.extadd_pairwise_i16x8_s',
210
+ 'i32x4.extadd_pairwise_i16x8_u',
211
+ 'i32x4.sub',
212
+ 'i32x4.mul',
213
+ 'i32x4.extmul_low_i16x8_s',
214
+ 'i32x4.extmul_high_i16x8_s',
215
+ 'i32x4.extmul_low_i16x8_u',
216
+ 'i32x4.extmul_high_i16x8_u',
217
+ 'i32x4.neg',
218
+ 'i32x4.shl',
219
+ 'i32x4.shr_s',
220
+ 'i32x4.shr_u',
221
+ 'i32x4.eq',
222
+ 'i32x4.ne',
223
+ 'i32x4.lt_s',
224
+ 'i32x4.lt_u',
225
+ 'i32x4.le_s',
226
+ 'i32x4.le_u',
227
+ 'i32x4.gt_s',
228
+ 'i32x4.gt_u',
229
+ 'i32x4.ge_s',
230
+ 'i32x4.ge_u',
231
+ 'i32x4.min_s',
232
+ 'i32x4.min_u',
233
+ 'i32x4.max_s',
234
+ 'i32x4.max_u',
235
+ 'i32x4.trunc_sat_f32x4_s',
236
+ 'i32x4.trunc_sat_f32x4_u',
237
+ 'i32x4.trunc_sat_f64x2_s_zero',
238
+ 'i32x4.trunc_sat_f64x2_u_zero',
239
+ 'i32x4.dot_i16x8_s',
240
+ 'i64x2.bitmask',
241
+ 'i64x2.splat',
242
+ 'i64x2.load32x2_s',
243
+ 'i64x2.load32x2_u',
244
+ 'i64x2.replace_lane',
245
+ 'i64x2.extract_lane',
246
+ 'i64x2.extend_low_i32x4_s',
247
+ 'i64x2.extend_high_i32x4_s',
248
+ 'i64x2.extend_low_i32x4_u',
249
+ 'i64x2.extend_high_i32x4_u',
250
+ 'i64x2.all_true',
251
+ 'i64x2.abs',
252
+ 'i64x2.add',
253
+ 'i64x2.sub',
254
+ 'i64x2.mul',
255
+ 'i64x2.neg',
256
+ 'i64x2.shl',
257
+ 'i64x2.shr_s',
258
+ 'i64x2.shr_u',
259
+ 'f32x4.splat',
260
+ 'f32x4.replace_lane',
261
+ 'f32x4.extract_lane',
262
+ 'f32x4.add',
263
+ 'f32x4.sub',
264
+ 'f32x4.mul',
265
+ 'i64x2.extmul_low_i32x4_s',
266
+ 'i64x2.extmul_high_i32x4_s',
267
+ 'i64x2.extmul_low_i32x4_u',
268
+ 'i64x2.extmul_high_i32x4_u',
269
+ 'i64x2.eq',
270
+ 'i64x2.ne',
271
+ 'i64x2.lt_s',
272
+ 'i64x2.le_s',
273
+ 'i64x2.gt_s',
274
+ 'i64x2.ge_s',
275
+ 'f32x4.neg',
276
+ 'f32x4.eq',
277
+ 'f32x4.ne',
278
+ 'f32x4.lt',
279
+ 'f32x4.le',
280
+ 'f32x4.gt',
281
+ 'f32x4.ge',
282
+ 'f32x4.abs',
283
+ 'f32x4.min',
284
+ 'f32x4.pmin',
285
+ 'f32x4.max',
286
+ 'f32x4.pmax',
287
+ 'f32x4.div',
288
+ 'f32x4.sqrt',
289
+ 'f32x4.ceil',
290
+ 'f32x4.floor',
291
+ 'f32x4.trunc',
292
+ 'f32x4.nearest',
293
+ 'f32x4.demote_f64x2_zero',
294
+ 'f32x4.convert_i32x4_s',
295
+ 'f32x4.convert_i32x4_u',
296
+ 'f64x2.splat',
297
+ 'f64x2.replace_lane',
298
+ 'f64x2.extract_lane',
299
+ 'f64x2.add',
300
+ 'f64x2.sub',
301
+ 'f64x2.mul',
302
+ 'f64x2.neg',
303
+ 'f64x2.eq',
304
+ 'f64x2.ne',
305
+ 'f64x2.lt',
306
+ 'f64x2.le',
307
+ 'f64x2.gt',
308
+ 'f64x2.ge',
309
+ 'f64x2.abs',
310
+ 'f64x2.min',
311
+ 'f64x2.max',
312
+ 'f64x2.pmin',
313
+ 'f64x2.pmax',
314
+ 'f64x2.div',
315
+ 'f64x2.sqrt',
316
+ 'f64x2.ceil',
317
+ 'f64x2.floor',
318
+ 'f64x2.trunc',
319
+ 'f64x2.nearest',
320
+ 'f64x2.promote_low_f32x4',
321
+ 'f64x2.convert_low_i32x4_s',
322
+ 'f64x2.convert_low_i32x4_u',
323
+ 'i32.atomic.load',
324
+ 'i32.atomic.load8_u',
325
+ 'i32.atomic.load16_u',
326
+ 'i32.atomic.store',
327
+ 'i32.atomic.store8',
328
+ 'i32.atomic.store16',
329
+ 'i32.atomic.rmw.add',
330
+ 'i32.atomic.rmw.sub',
331
+ 'i32.atomic.rmw.and',
332
+ 'i32.atomic.rmw.or',
333
+ 'i32.atomic.rmw.xor',
334
+ 'i32.atomic.rmw.xchg',
335
+ 'i32.atomic.rmw.cmpxchg',
336
+ 'i32.atomic.rmw8.add_u',
337
+ 'i32.atomic.rmw8.sub_u',
338
+ 'i32.atomic.rmw8.and_u',
339
+ 'i32.atomic.rmw8.or_u',
340
+ 'i32.atomic.rmw8.xor_u',
341
+ 'i32.atomic.rmw8.xchg_u',
342
+ 'i32.atomic.rmw8.cmpxchg_u',
343
+ 'i32.atomic.rmw16.add_u',
344
+ 'i32.atomic.rmw16.sub_u',
345
+ 'i32.atomic.rmw16.and_u',
346
+ 'i32.atomic.rmw16.or_u',
347
+ 'i32.atomic.rmw16.xor_u',
348
+ 'i32.atomic.rmw16.xchg_u',
349
+ 'i32.atomic.rmw16.cmpxchg_u',
350
+ 'i64.atomic.load',
351
+ 'i64.atomic.load8_u',
352
+ 'i64.atomic.load16_u',
353
+ 'i64.atomic.load32_u',
354
+ 'i64.atomic.store',
355
+ 'i64.atomic.store8',
356
+ 'i64.atomic.store16',
357
+ 'i64.atomic.store32',
358
+ 'i64.atomic.rmw.add',
359
+ 'i64.atomic.rmw.sub',
360
+ 'i64.atomic.rmw.and',
361
+ 'i64.atomic.rmw.or',
362
+ 'i64.atomic.rmw.xor',
363
+ 'i64.atomic.rmw.xchg',
364
+ 'i64.atomic.rmw.cmpxchg',
365
+ 'i64.atomic.rmw8.add_u',
366
+ 'i64.atomic.rmw8.sub_u',
367
+ 'i64.atomic.rmw8.and_u',
368
+ 'i64.atomic.rmw8.or_u',
369
+ 'i64.atomic.rmw8.xor_u',
370
+ 'i64.atomic.rmw8.xchg_u',
371
+ 'i64.atomic.rmw8.cmpxchg_u',
372
+ 'i64.atomic.rmw16.add_u',
373
+ 'i64.atomic.rmw16.sub_u',
374
+ 'i64.atomic.rmw16.and_u',
375
+ 'i64.atomic.rmw16.or_u',
376
+ 'i64.atomic.rmw16.xor_u',
377
+ 'i64.atomic.rmw16.xchg_u',
378
+ 'i64.atomic.rmw16.cmpxchg_u',
379
+ 'i64.atomic.rmw32.add_u',
380
+ 'i64.atomic.rmw32.sub_u',
381
+ 'i64.atomic.rmw32.and_u',
382
+ 'i64.atomic.rmw32.or_u',
383
+ 'i64.atomic.rmw32.xor_u',
384
+ 'i64.atomic.rmw32.xchg_u',
385
+ 'i64.atomic.rmw32.cmpxchg_u',
386
+ 'atomic.fence',
387
+ 'func.bind',
388
+ 'ref',
389
+ 'ref.eq',
390
+ 'ref.null',
391
+ 'ref.is_null',
392
+ 'ref.is_func',
393
+ 'ref.is_data',
394
+ 'ref.is_i31',
395
+ 'ref.as_func',
396
+ 'ref.as_non_null',
397
+ 'ref.as_data',
398
+ 'ref.as_i31',
399
+ 'ref.func',
400
+ 'ref.cast',
401
+ 'ref.cast_static',
402
+ 'ref.test',
403
+ 'ref.test_static',
404
+ 'table.get',
405
+ 'table.set',
406
+ 'table.size',
407
+ 'table.grow',
408
+ 'table.fill',
409
+ 'table.init',
410
+ 'table.copy',
411
+ 'throw',
412
+ 'rethrow',
413
+ 'i32.load',
414
+ 'i32.load8_s',
415
+ 'i32.load8_u',
416
+ 'i32.load16_s',
417
+ 'i32.load16_u',
418
+ 'i32.store',
419
+ 'i32.store8',
420
+ 'i32.store16',
421
+ 'i32.const',
422
+ 'i32.eqz',
423
+ 'i32.eq',
424
+ 'i32.ne',
425
+ 'i32.lt_s',
426
+ 'i32.lt_u',
427
+ 'i32.le_s',
428
+ 'i32.le_u',
429
+ 'i32.gt_s',
430
+ 'i32.gt_u',
431
+ 'i32.ge_s',
432
+ 'i32.ge_u',
433
+ 'i32.clz',
434
+ 'i32.ctz',
435
+ 'i32.popcnt',
436
+ 'i32.add',
437
+ 'i32.sub',
438
+ 'i32.mul',
439
+ 'i32.div_s',
440
+ 'i32.div_u',
441
+ 'i32.rem_s',
442
+ 'i32.rem_u',
443
+ 'i32.and',
444
+ 'i32.or',
445
+ 'i32.xor',
446
+ 'i32.shl',
447
+ 'i32.shr_s',
448
+ 'i32.shr_u',
449
+ 'i32.rotl',
450
+ 'i32.rotr',
451
+ 'i32.wrap_i64',
452
+ 'i32.trunc_f32_s',
453
+ 'i32.trunc_f32_u',
454
+ 'i32.trunc_f64_s',
455
+ 'i32.trunc_f64_u',
456
+ 'i32.reinterpret_f32',
457
+ 'i64.load',
458
+ 'i64.load8_s',
459
+ 'i64.load8_u',
460
+ 'i64.load16_s',
461
+ 'i64.load16_u',
462
+ 'i64.load32_s',
463
+ 'i64.load32_u',
464
+ 'i64.store',
465
+ 'i64.store8',
466
+ 'i64.store16',
467
+ 'i64.store32',
468
+ 'i64.const',
469
+ 'i64.eqz',
470
+ 'i64.eq',
471
+ 'i64.ne',
472
+ 'i64.lt_s',
473
+ 'i64.lt_u',
474
+ 'i64.le_s',
475
+ 'i64.le_u',
476
+ 'i64.gt_s',
477
+ 'i64.gt_u',
478
+ 'i64.ge_s',
479
+ 'i64.ge_u',
480
+ 'i64.clz',
481
+ 'i64.ctz',
482
+ 'i64.popcnt',
483
+ 'i64.add',
484
+ 'i64.sub',
485
+ 'i64.mul',
486
+ 'i64.div_s',
487
+ 'i64.div_u',
488
+ 'i64.rem_s',
489
+ 'i64.rem_u',
490
+ 'i64.and',
491
+ 'i64.or',
492
+ 'i64.xor',
493
+ 'i64.shl',
494
+ 'i64.shr_s',
495
+ 'i64.shr_u',
496
+ 'i64.rotl',
497
+ 'i64.rotr',
498
+ 'i64.extend_i32_s',
499
+ 'i64.extend_i32_u',
500
+ 'i64.trunc_f32_s',
501
+ 'i64.trunc_f32_u',
502
+ 'i64.trunc_f64_s',
503
+ 'i64.trunc_f64_u',
504
+ 'i64.reinterpret_f64',
505
+ 'f32.load',
506
+ 'f32.store',
507
+ 'f32.const',
508
+ 'f32.eq',
509
+ 'f32.ne',
510
+ 'f32.lt',
511
+ 'f32.le',
512
+ 'f32.gt',
513
+ 'f32.ge',
514
+ 'f32.abs',
515
+ 'f32.neg',
516
+ 'f32.ceil',
517
+ 'f32.floor',
518
+ 'f32.trunc',
519
+ 'f32.nearest',
520
+ 'f32.sqrt',
521
+ 'f32.add',
522
+ 'f32.sub',
523
+ 'f32.mul',
524
+ 'f32.div',
525
+ 'f32.min',
526
+ 'f32.max',
527
+ 'f32.copysign',
528
+ 'f32.convert_i32_s',
529
+ 'f32.convert_i32_u',
530
+ 'f32.convert_i64_s',
531
+ 'f32.convert_i64_u',
532
+ 'f32.demote_f64',
533
+ 'f32.reinterpret_i32',
534
+ 'f64.load',
535
+ 'f64.store',
536
+ 'f64.const',
537
+ 'f64.eq',
538
+ 'f64.ne',
539
+ 'f64.lt',
540
+ 'f64.le',
541
+ 'f64.gt',
542
+ 'f64.ge',
543
+ 'f64.abs',
544
+ 'f64.neg',
545
+ 'f64.ceil',
546
+ 'f64.floor',
547
+ 'f64.trunc',
548
+ 'f64.nearest',
549
+ 'f64.sqrt',
550
+ 'f64.add',
551
+ 'f64.sub',
552
+ 'f64.mul',
553
+ 'f64.div',
554
+ 'f64.min',
555
+ 'f64.max',
556
+ 'f64.copysign',
557
+ 'f64.convert_i32_s',
558
+ 'f64.convert_i32_u',
559
+ 'f64.convert_i64_s',
560
+ 'f64.convert_i64_u',
561
+ 'f64.promote_f32',
562
+ 'f64.reinterpret_i64',
563
+ 'i32.extend8_s',
564
+ 'i32.extend16_s',
565
+ 'i64.extend8_s',
566
+ 'i64.extend16_s',
567
+ 'i64.extend32_s',
568
+ 'i32.trunc_sat_f32_s',
569
+ 'i32.trunc_sat_f32_u',
570
+ 'i32.trunc_sat_f64_s',
571
+ 'i32.trunc_sat_f64_u',
572
+ 'i64.trunc_sat_f32_s',
573
+ 'i64.trunc_sat_f32_u',
574
+ 'i64.trunc_sat_f64_s',
575
+ 'i64.trunc_sat_f64_u',
576
+ 'memory.size',
577
+ 'memory.grow',
578
+ 'memory.copy',
579
+ 'memory.fill',
580
+ 'memory.init',
581
+ 'memory.atomic.notify',
582
+ 'memory.atomic.wait32',
583
+ 'memory.atomic.wait64',
584
+ 'i31.new',
585
+ 'i31.get_u',
586
+ 'i31.get_s',
587
+ 'array.new',
588
+ 'array.new_default',
589
+ 'array.init',
590
+ 'array.init_static',
591
+ 'array.get',
592
+ 'array.get_s',
593
+ 'array.get_u',
594
+ 'array.set',
595
+ 'array.len',
596
+ 'array.copy',
597
+ 'struct.new',
598
+ 'struct.new_default',
599
+ 'struct.new_with_rtt',
600
+ 'struct.new_default_with_rtt',
601
+ 'struct.get',
602
+ 'struct.get_s',
603
+ 'struct.get_u',
604
+ 'struct.set',
605
+ 'rtt.canon',
606
+ 'rtt.sub',
607
+ 'rtt.fresh_sub',
608
+ ],
609
+ controlInstructions: [
610
+ 'block',
611
+ 'loop',
612
+ 'if',
613
+ 'else',
614
+ 'then',
615
+ 'end',
616
+ 'do',
617
+ 'let',
618
+ 'br',
619
+ 'br_if',
620
+ 'br_table',
621
+ 'br_on_exn',
622
+ 'br_on_null',
623
+ 'br_on_non_null',
624
+ 'br_on_cast',
625
+ 'br_on_cast_static',
626
+ 'br_on_cast_fail',
627
+ 'br_on_cast_static_fail',
628
+ 'br_on_func',
629
+ 'br_on_non_func',
630
+ 'br_on_data',
631
+ 'br_on_non_data',
632
+ 'br_on_i31',
633
+ 'br_on_non_i31',
634
+ 'call',
635
+ 'call_indirect',
636
+ 'call_ref',
637
+ 'return',
638
+ 'return_call',
639
+ 'return_call_indirect',
640
+ 'return_call_ref',
641
+ 'try',
642
+ 'catch',
643
+ 'catch_all',
644
+ 'delegate',
645
+ 'unreachable',
646
+ ],
647
+
648
+ escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
649
+ digits: /\d+(_+\d+)*/,
650
+ octaldigits: /[0-7]+(_+[0-7]+)*/,
651
+ binarydigits: /[0-1]+(_+[0-1]+)*/,
652
+ hexdigits: /[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,
653
+
654
+ tokenizer: {
655
+ root: [
656
+ // whitespace
657
+ { include: '@whitespace' },
658
+
659
+ // strings
660
+ [/"([^"\\]|\\.)*$/, 'string.invalid'], // non-teminated string
661
+ [/"/, 'string', '@string'],
662
+
663
+ // numbers (not all of these are generated, but here to be sure)
664
+ [/(@digits)[eE]([\-+]?(@digits))?[fFdD]?/, 'number.float'],
665
+ [/(@digits)\.(@digits)([eE][\-+]?(@digits))?[fFdD]?/, 'number.float'],
666
+ [/0[xX](@hexdigits)[Ll]?/, 'number.hex'],
667
+ [/0(@octaldigits)[Ll]?/, 'number.octal'],
668
+ [/0[bB](@binarydigits)[Ll]?/, 'number.binary'],
669
+ [/(@digits)[fFdD]/, 'number.float'],
670
+ [/(@digits)[lL]?/, 'number'],
671
+
672
+ // variable names
673
+ [/\$[^\s\)]*/, { token: 'identifier' }],
674
+
675
+ // instructions and types
676
+ [
677
+ /[a-z0-9_]+(?:\.[a-z0-9_]+)*/,
678
+ {
679
+ cases: {
680
+ '@types': { token: 'type.$0' },
681
+ '@keywords': { token: 'keyword.$0' },
682
+ '@controlInstructions': { token: 'controlInstruction.$0' },
683
+ '@instructions': { token: 'instruction.$0' },
684
+ '@default': 'identifier',
685
+ },
686
+ },
687
+ ],
688
+ ],
689
+
690
+ // eslint-disable-next-line id-blacklist
691
+ string: [
692
+ [/[^\\"]+/, 'string'],
693
+ [/@escapes/, 'string.escape'],
694
+ [/\\./, 'string.escape.invalid'],
695
+ [/"/, 'string', '@pop'],
696
+ ],
697
+
698
+ whitespace: [
699
+ [/[ \t\r\n]+/, ''],
700
+ [/(;; )(ERROR |FAILURE )([^\n]*)/, ['comment', 'error', '']],
701
+ [/(;; )(WARNING )([^\n]*)/, ['comment', 'warning', '']],
702
+ [/(;; )(INFO )([^\n]*)/, ['comment', 'info', '']],
703
+ [/(;; )(PEDANTIC )([^\n]*)/, ['comment', 'pedantic', '']],
704
+ [/(;; +)(~+|\^)$/, ['comment', 'underline']],
705
+ [/(;; )([^\n]*)/, ['comment', '']],
706
+ [/;;[^\n]*/, 'comment'],
707
+ ],
708
+ },
709
+ },
710
+ };