PluginProbe
Code Block Pro – Beautiful Syntax Highlighting / 1.27.4
Code Block Pro – Beautiful Syntax Highlighting v1.27.4
1.27.1 1.27.2 1.27.3 1.27.4 1.27.5 1.27.6 1.27.7 1.28.0 1.3.0 1.4.0 1.5.0 1.5.1 1.5.2 1.6.0 1.7.0 1.8.0 1.9.0 1.9.1 1.9.2 1.9.3 trunk 1.1.0 1.10.0 1.11.0 1.11.1 All 63 releases
code-block-pro / build / shiki / languages / wasm.tmLanguage.json

wasm.tmLanguage.json in Code Block Pro – Beautiful Syntax Highlighting 1.27.4, at build/shiki/languages/wasm.tmLanguage.json

831 lines 26.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 {
2 "name": "wasm",
3 "scopeName": "source.wat",
4 "patterns": [
5 {
6 "include": "#comments"
7 },
8 {
9 "include": "#strings"
10 },
11 {
12 "include": "#instructions"
13 },
14 {
15 "include": "#types"
16 },
17 {
18 "include": "#modules"
19 },
20 {
21 "include": "#constants"
22 },
23 {
24 "include": "#invalid"
25 }
26 ],
27 "repository": {
28 "comments": {
29 "patterns": [
30 {
31 "comment": "Line comment",
32 "name": "comment.line.wat",
33 "match": "(;;).*$",
34 "captures": {
35 "1": {
36 "name": "punctuation.definition.comment.wat"
37 }
38 }
39 },
40 {
41 "comment": "Block comment",
42 "name": "comment.block.wat",
43 "begin": "\\(;",
44 "beginCaptures": {
45 "0": {
46 "name": "punctuation.definition.comment.wat"
47 }
48 },
49 "end": ";\\)",
50 "endCaptures": {
51 "0": {
52 "name": "punctuation.definition.comment.wat"
53 }
54 }
55 }
56 ]
57 },
58 "strings": {
59 "comment": "String literal",
60 "name": "string.quoted.double.wat",
61 "begin": "\"",
62 "end": "\"",
63 "beginCaptures": {
64 "0": {
65 "name": "punctuation.definition.string.begin"
66 }
67 },
68 "endCaptures": {
69 "0": {
70 "name": "punctuation.definition.string.end"
71 }
72 },
73 "patterns": [
74 {
75 "name": "constant.character.escape.wat",
76 "match": "\\\\(n|t|\\\\|'|\"|[0-9a-fA-F]{2})"
77 }
78 ]
79 },
80 "instructions": {
81 "patterns": [
82 {
83 "comment": "Non-trapping float-to-int conversions",
84 "patterns": [
85 {
86 "comment": "Conversion instruction [nontrapping-float-to-int-conversions]",
87 "name": "keyword.operator.word.wat",
88 "match": "\\b(i32|i64)\\.trunc_sat_f(?:32|64)_[su]\\b",
89 "captures": {
90 "1": {
91 "name": "support.class.wat"
92 }
93 }
94 }
95 ]
96 },
97 {
98 "comment": "Sign-extension operators",
99 "patterns": [
100 {
101 "comment": "Numeric instruction (i32) [sign-extension-ops]",
102 "name": "keyword.operator.word.wat",
103 "match": "\\b(i32)\\.(?:extend(?:8|16)_s)\\b",
104 "captures": {
105 "1": {
106 "name": "support.class.wat"
107 }
108 }
109 },
110 {
111 "comment": "Numeric instruction (i64) [sign-extension-ops]",
112 "name": "keyword.operator.word.wat",
113 "match": "\\b(i64)\\.(?:extend(?:8|16|32)_s)\\b",
114 "captures": {
115 "1": {
116 "name": "support.class.wat"
117 }
118 }
119 }
120 ]
121 },
122 {
123 "comment": "Bulk memory operations",
124 "patterns": [
125 {
126 "comment": "Memory instruction [bulk-memory-operations]",
127 "name": "keyword.operator.word.wat",
128 "match": "\\b(memory)\\.(?:copy|fill|init|drop)\\b",
129 "captures": {
130 "1": {
131 "name": "support.class.wat"
132 }
133 }
134 }
135 ]
136 },
137 {
138 "comment": "Fixed-width SIMD",
139 "patterns": [
140 {
141 "comment": "Vector instruction (v128) [simd]",
142 "name": "keyword.operator.word.wat",
143 "match": "\\b(v128)\\.(?:const|and|or|xor|not|andnot|bitselect|load|store)\\b",
144 "captures": {
145 "1": {
146 "name": "support.class.wat"
147 }
148 }
149 },
150 {
151 "comment": "Vector instruction (i8x16) [simd]",
152 "name": "keyword.operator.word.wat",
153 "match": "\\b(i8x16)\\.(?:shuffle|swizzle|splat|replace_lane|add|sub|mul|neg|shl|shr_[su]|eq|ne|lt_[su]|le_[su]|gt_[su]|ge_[su]|min_[su]|max_[su]|any_true|all_true|extract_lane_[su]|add_saturate_[su]|sub_saturate_[su]|avgr_u|narrow_i16x8_[su])\\b",
154 "captures": {
155 "1": {
156 "name": "support.class.wat"
157 }
158 }
159 },
160 {
161 "comment": "Vector instruction (i16x8) [simd]",
162 "name": "keyword.operator.word.wat",
163 "match": "\\b(i16x8)\\.(?:splat|replace_lane|add|sub|mul|neg|shl|shr_[su]|eq|ne|lt_[su]|le_[su]|gt_[su]|ge_[su]|min_[su]|max_[su]|any_true|all_true|extract_lane_[su]|add_saturate_[su]|sub_saturate_[su]|avgr_u|load8x8_[su]|narrow_i32x4_[su]|widen_(low|high)_i8x16_[su])\\b",
164 "captures": {
165 "1": {
166 "name": "support.class.wat"
167 }
168 }
169 },
170 {
171 "comment": "Vector instruction (i32x4) [simd]",
172 "name": "keyword.operator.word.wat",
173 "match": "\\b(i32x4)\\.(?:splat|replace_lane|add|sub|mul|neg|shl|shr_[su]|eq|ne|lt_[su]|le_[su]|gt_[su]|ge_[su]|min_[su]|max_[su]|any_true|all_true|extract_lane|load16x4_[su]|trunc_sat_f32x4_[su]|widen_(low|high)_i16x8_[su])\\b",
174 "captures": {
175 "1": {
176 "name": "support.class.wat"
177 }
178 }
179 },
180 {
181 "comment": "Vector instruction (i64x2) [simd]",
182 "name": "keyword.operator.word.wat",
183 "match": "\\b(i64x2)\\.(?:splat|replace_lane|add|sub|mul|neg|shl|shr_[su]|extract_lane|load32x2_[su])\\b",
184 "captures": {
185 "1": {
186 "name": "support.class.wat"
187 }
188 }
189 },
190 {
191 "comment": "Vector instruction (f32x4) [simd]",
192 "name": "keyword.operator.word.wat",
193 "match": "\\b(f32x4)\\.(?:splat|replace_lane|add|sub|mul|neg|extract_lane|eq|ne|lt|le|gt|ge|abs|min|max|div|sqrt|convert_i32x4_[su])\\b",
194 "captures": {
195 "1": {
196 "name": "support.class.wat"
197 }
198 }
199 },
200 {
201 "comment": "Vector instruction (f64x2) [simd]",
202 "name": "keyword.operator.word.wat",
203 "match": "\\b(f64x2)\\.(?:splat|replace_lane|add|sub|mul|neg|extract_lane|eq|ne|lt|le|gt|ge|abs|min|max|div|sqrt)\\b",
204 "captures": {
205 "1": {
206 "name": "support.class.wat"
207 }
208 }
209 },
210 {
211 "comment": "Vector instruction (v8x16) [simd]",
212 "name": "keyword.operator.word.wat",
213 "match": "\\b(v8x16)\\.(?:load_splat|shuffle|swizzle)\\b",
214 "captures": {
215 "1": {
216 "name": "support.class.wat"
217 }
218 }
219 },
220 {
221 "comment": "Vector instruction (v16x8) [simd]",
222 "name": "keyword.operator.word.wat",
223 "match": "\\b(v16x8)\\.load_splat\\b",
224 "captures": {
225 "1": {
226 "name": "support.class.wat"
227 }
228 }
229 },
230 {
231 "comment": "Vector instruction (v32x4) [simd]",
232 "name": "keyword.operator.word.wat",
233 "match": "\\b(v32x4)\\.load_splat\\b",
234 "captures": {
235 "1": {
236 "name": "support.class.wat"
237 }
238 }
239 },
240 {
241 "comment": "Vector instruction (v64x2) [simd]",
242 "name": "keyword.operator.word.wat",
243 "match": "\\b(v64x2)\\.load_splat\\b",
244 "captures": {
245 "1": {
246 "name": "support.class.wat"
247 }
248 }
249 }
250 ]
251 },
252 {
253 "comment": "Threads",
254 "patterns": [
255 {
256 "comment": "Atomic instruction (i32) [threads]",
257 "name": "keyword.operator.word.wat",
258 "match": "\\b(i32)\\.(atomic)\\.(?:load(?:8_u|16_u)?|store(?:8|16)?|wait|(rmw)\\.(?:add|sub|and|or|xor|xchg|cmpxchg)|(rmw8|rmw16)\\.(?:add_u|sub_u|and_u|or_u|xor_u|xchg_u|cmpxchg_u))\\b",
259 "captures": {
260 "1": {
261 "name": "support.class.wat"
262 },
263 "2": {
264 "name": "support.class.wat"
265 },
266 "3": {
267 "name": "support.class.wat"
268 },
269 "4": {
270 "name": "support.class.wat"
271 }
272 }
273 },
274 {
275 "comment": "Atomic instruction (i64) [threads]",
276 "name": "keyword.operator.word.wat",
277 "match": "\\b(i64)\\.(atomic)\\.(?:load(?:8_u|16_u|32_u)?|store(?:8|16|32)?|wait|(rmw)\\.(?:add|sub|and|or|xor|xchg|cmpxchg)|(rmw8|rmw16|rmw32)\\.(?:add_u|sub_u|and_u|or_u|xor_u|xchg_u|cmpxchg_u))\\b",
278 "captures": {
279 "1": {
280 "name": "support.class.wat"
281 },
282 "2": {
283 "name": "support.class.wat"
284 },
285 "3": {
286 "name": "support.class.wat"
287 },
288 "4": {
289 "name": "support.class.wat"
290 }
291 }
292 },
293 {
294 "comment": "Atomic instruction [threads]",
295 "name": "keyword.operator.word.wat",
296 "match": "\\b(atomic)\\.(?:notify|fence)\\b",
297 "captures": {
298 "1": {
299 "name": "support.class.wat"
300 }
301 }
302 },
303 {
304 "comment": "Shared modifier [threads]",
305 "name": "storage.modifier.wat",
306 "match": "\\bshared\\b"
307 }
308 ]
309 },
310 {
311 "comment": "Reference types",
312 "patterns": [
313 {
314 "comment": "Reference instruction [reference-types]",
315 "name": "keyword.operator.word.wat",
316 "match": "\\b(ref)\\.(?:null|is_null|func|extern)\\b",
317 "captures": {
318 "1": {
319 "name": "support.class.wat"
320 }
321 }
322 },
323 {
324 "comment": "Table instruction [reference-types]",
325 "name": "keyword.operator.word.wat",
326 "match": "\\b(table)\\.(?:get|size|grow|fill|init|copy)\\b",
327 "captures": {
328 "1": {
329 "name": "support.class.wat"
330 }
331 }
332 },
333 {
334 "comment": "Type name [reference-types]",
335 "name": "entity.name.type.wat",
336 "match": "\\b(?:externref|funcref|nullref)\\b"
337 }
338 ]
339 },
340 {
341 "comment": "Tail Call",
342 "patterns": [
343 {
344 "comment": "Control instruction [tail-call]",
345 "name": "keyword.control.wat",
346 "match": "\\breturn_call(?:_indirect)?\\b"
347 }
348 ]
349 },
350 {
351 "comment": "Exception handling",
352 "patterns": [
353 {
354 "comment": "Control instruction [exception-handling]",
355 "name": "keyword.control.wat",
356 "match": "\\b(?:try|catch|throw|rethrow|br_on_exn)\\b"
357 },
358 {
359 "comment": "Module element [exception-handling]",
360 "name": "storage.type.wat",
361 "match": "(?<=\\()event\\b"
362 }
363 ]
364 },
365 {
366 "comment": "Binaryen extensions",
367 "patterns": [
368 {
369 "comment": "Pseudo stack instruction [binaryen]",
370 "name": "keyword.operator.word.wat",
371 "match": "\\b(i32|i64|f32|f64|externref|funcref|nullref|exnref)\\.(?:push|pop)\\b",
372 "captures": {
373 "1": {
374 "name": "support.class.wat"
375 }
376 }
377 }
378 ]
379 },
380 {
381 "comment": "MVP",
382 "patterns": [
383 {
384 "comment": "Memory instruction (i32) [mvp]",
385 "name": "keyword.operator.word.wat",
386 "match": "\\b(i32)\\.(?:load|load(?:8|16)(?:_[su])?|store(?:8|16)?)\\b",
387 "captures": {
388 "1": {
389 "name": "support.class.type.wat"
390 }
391 }
392 },
393 {
394 "comment": "Memory instruction (i64) [mvp]",
395 "name": "keyword.operator.word.wat",
396 "match": "\\b(i64)\\.(?:load|load(?:8|16|32)(?:_[su])?|store(?:8|16|32)?)\\b",
397 "captures": {
398 "1": {
399 "name": "support.class.type.wat"
400 }
401 }
402 },
403 {
404 "comment": "Memory instruction (f32/f64) [mvp]",
405 "name": "keyword.operator.word.wat",
406 "match": "\\b(f32|f64)\\.(?:load|store)\\b",
407 "captures": {
408 "1": {
409 "name": "support.class.type.wat"
410 }
411 }
412 },
413 {
414 "comment": "Memory instruction [mvp]",
415 "name": "keyword.operator.word.wat",
416 "match": "\\b(memory)\\.(?:size|grow)\\b",
417 "captures": {
418 "1": {
419 "name": "support.class.memory.wat"
420 }
421 }
422 },
423 {
424 "comment": "Memory instruction attribute [mvp]",
425 "match": "\\b(offset|align)=\\b",
426 "captures": {
427 "1": {
428 "name": "entity.other.attribute-name.wat"
429 }
430 }
431 },
432 {
433 "comment": "Variable instruction (local) [mvp]",
434 "name": "keyword.operator.word.wat",
435 "match": "\\b(local)\\.(?:get|set|tee)\\b",
436 "captures": {
437 "1": {
438 "name": "support.class.local.wat"
439 }
440 }
441 },
442 {
443 "comment": "Variable instruction (global) [mvp]",
444 "name": "keyword.operator.word.wat",
445 "match": "\\b(global)\\.(?:get|set)\\b",
446 "captures": {
447 "1": {
448 "name": "support.class.global.wat"
449 }
450 }
451 },
452 {
453 "comment": "Numeric instruction (i32/i64) [mvp]",
454 "name": "keyword.operator.word.wat",
455 "match": "\\b(i32|i64)\\.(const|eqz|eq|ne|lt_[su]|gt_[su]|le_[su]|ge_[su]|clz|ctz|popcnt|add|sub|mul|div_[su]|rem_[su]|and|or|xor|shl|shr_[su]|rotl|rotr)\\b",
456 "captures": {
457 "1": {
458 "name": "support.class.type.wat"
459 }
460 }
461 },
462 {
463 "comment": "Numeric instruction (f32/f64) [mvp]",
464 "name": "keyword.operator.word.wat",
465 "match": "\\b(f32|f64)\\.(const|eq|ne|lt|gt|le|ge|abs|neg|ceil|floor|trunc|nearest|sqrt|add|sub|mul|div|min|max|copysign)\\b",
466 "captures": {
467 "1": {
468 "name": "support.class.type.wat"
469 }
470 }
471 },
472 {
473 "comment": "Conversion instruction (i32) [mvp]",
474 "name": "keyword.operator.word.wat",
475 "match": "\\b(i32)\\.(wrap_i64|trunc_(f32|f64)_[su]|reinterpret_f32)\\b",
476 "captures": {
477 "1": {
478 "name": "support.class.type.wat"
479 }
480 }
481 },
482 {
483 "comment": "Conversion instruction (i64) [mvp]",
484 "name": "keyword.operator.word.wat",
485 "match": "\\b(i64)\\.(extend_i32_[su]|trunc_f(32|64)_[su]|reinterpret_f64)\\b",
486 "captures": {
487 "1": {
488 "name": "support.class.type.wat"
489 }
490 }
491 },
492 {
493 "comment": "Conversion instruction (f32) [mvp]",
494 "name": "keyword.operator.word.wat",
495 "match": "\\b(f32)\\.(convert_i(32|64)_[su]|demote_f64|reinterpret_i32)\\b",
496 "captures": {
497 "1": {
498 "name": "support.class.type.wat"
499 }
500 }
501 },
502 {
503 "comment": "Conversion instruction (f64) [mvp]",
504 "name": "keyword.operator.word.wat",
505 "match": "\\b(f64)\\.(convert_i(32|64)_[su]|promote_f32|reinterpret_i64)\\b",
506 "captures": {
507 "1": {
508 "name": "support.class.type.wat"
509 }
510 }
511 },
512 {
513 "comment": "Control instruction [mvp]",
514 "name": "keyword.control.wat",
515 "match": "\\b(?:unreachable|nop|block|loop|if|then|else|end|br|br_if|br_table|return|call|call_indirect)\\b"
516 },
517 {
518 "comment": "Parametric instruction [mvp]",
519 "name": "keyword.operator.word.wat",
520 "match": "\\b(?:drop|select)\\b"
521 }
522 ]
523 },
524 {
525 "comment": "GC Instructions",
526 "patterns": [
527 {
528 "comment": "Reference Instructions [GC]",
529 "name": "keyword.operator.word.wat",
530 "match": "\\b(ref)\\.(?:eq|test|cast)\\b",
531 "captures": {
532 "1": {
533 "name": "support.class.wat"
534 }
535 }
536 },
537 {
538 "comment": "Struct Instructions [GC]",
539 "name": "keyword.operator.word.wat",
540 "match": "\\b(struct)\\.(?:new_canon|new_canon_default|get|get_s|get_u|set)\\b",
541 "captures": {
542 "1": {
543 "name": "support.class.wat"
544 }
545 }
546 },
547 {
548 "comment": "Array Instructions [GC]",
549 "name": "keyword.operator.word.wat",
550 "match": "\\b(array)\\.(?:new_canon|new_canon_default|get|get_s|get_u|set|len|new_canon_fixed|new_canon_data|new_canon_elem)\\b",
551 "captures": {
552 "1": {
553 "name": "support.class.wat"
554 }
555 }
556 },
557 {
558 "comment": "i31 Instructions [GC]",
559 "name": "keyword.operator.word.wat",
560 "match": "\\b(i31)\\.(?:new|get_s|get_u)\\b",
561 "captures": {
562 "1": {
563 "name": "support.class.wat"
564 }
565 }
566 },
567 {
568 "comment": "Branch Instructions [GC]",
569 "name": "keyword.operator.word.wat",
570 "match": "\\b(?:br_on_non_null|br_on_cast|br_on_cast_fail)\\b",
571 "captures": {
572 "1": {
573 "name": "support.class.wat"
574 }
575 }
576 },
577 {
578 "comment": "Reference Instructions [GC]",
579 "name": "keyword.operator.word.wat",
580 "match": "\\b(extern)\\.(?:internalize|externalize)\\b",
581 "captures": {
582 "1": {
583 "name": "support.class.wat"
584 }
585 }
586 }
587 ]
588 }
589 ]
590 },
591 "types": {
592 "patterns": [
593 {
594 "comment": "Fixed-width SIMD",
595 "patterns": [
596 {
597 "comment": "Type name [simd]",
598 "name": "entity.name.type.wat",
599 "match": "\\bv128\\b(?!\\.)"
600 }
601 ]
602 },
603 {
604 "comment": "Reference types",
605 "patterns": [
606 {
607 "comment": "Type name [reference-types]",
608 "name": "entity.name.type.wat",
609 "match": "\\b(?:externref|funcref|nullref)\\b(?!\\.)"
610 }
611 ]
612 },
613 {
614 "comment": "Exception handling",
615 "patterns": [
616 {
617 "comment": "Type name [exception-handling]",
618 "name": "entity.name.type.wat",
619 "match": "\\bexnref\\b(?!\\.)"
620 }
621 ]
622 },
623 {
624 "comment": "MVP",
625 "patterns": [
626 {
627 "comment": "Type name [mvp]",
628 "name": "entity.name.type.wat",
629 "match": "\\b(?:i32|i64|f32|f64)\\b(?!\\.)"
630 }
631 ]
632 },
633 {
634 "comment": "GC Types",
635 "patterns": [
636 {
637 "comment": "Type name [GC]",
638 "name": "entity.name.type.wat",
639 "match": "\\b(?:i8|i16|ref|funcref|externref|anyref|eqref|i31ref|nullfuncref|nullexternref|structref|arrayref|nullref)\\b(?!\\.)"
640 }
641 ]
642 },
643 {
644 "comment": "GC Heap Types",
645 "patterns": [
646 {
647 "comment": "Type name [GC]",
648 "name": "entity.name.type.wat",
649 "match": "\\b(?:type|func|extern|any|eq|nofunc|noextern|struct|array|none)\\b(?!\\.)"
650 }
651 ]
652 },
653 {
654 "comment": "GC Structured and sub Types",
655 "patterns": [
656 {
657 "comment": "Type name [GC]",
658 "name": "entity.name.type.wat",
659 "match": "\\b(?:struct|array|sub|final|rec|field|mut)\\b(?!\\.)"
660 }
661 ]
662 }
663 ]
664 },
665 "modules": {
666 "patterns": [
667 {
668 "comment": "Bulk memory operations",
669 "patterns": [
670 {
671 "comment": "Passive modifier [bulk-memory-operations]",
672 "match": "(?<=\\(data)\\s+(passive)\\b",
673 "captures": {
674 "1": {
675 "name": "storage.modifier.wat"
676 }
677 }
678 }
679 ]
680 },
681 {
682 "comment": "MVP",
683 "patterns": [
684 {
685 "comment": "Module element [mvp]",
686 "name": "storage.type.wat",
687 "match": "(?<=\\()(?:module|import|export|memory|data|table|elem|start|func|type|param|result|global|local)\\b"
688 },
689 {
690 "comment": "Mutable global modifier [mvp]",
691 "name": "storage.modifier.wat",
692 "match": "(?<=\\()\\s*(mut)\\b",
693 "captures": {
694 "1": {
695 "name": "storage.modifier.wat"
696 }
697 }
698 },
699 {
700 "comment": "Function name [mvp]",
701 "match": "(?<=\\(func|\\(start|call|return_call|ref\\.func)\\s+(\\$[0-9A-Za-z!#$%&'*+\\-./:<=>?@\\\\^_`|~]*)",
702 "captures": {
703 "1": {
704 "name": "entity.name.function.wat"
705 }
706 }
707 },
708 {
709 "comment": "Function name(s) (elem) [mvp]",
710 "begin": "\\)\\s+(\\$[0-9A-Za-z!#$%&'*+\\-./:<=>?@\\\\^_`|~]*)",
711 "beginCaptures": {
712 "1": {
713 "name": "entity.name.function.wat"
714 }
715 },
716 "end": "\\)",
717 "patterns": [
718 {
719 "name": "entity.name.function.wat",
720 "match": "(?<=\\s)\\$[0-9A-Za-z!#$%&'*+\\-./:<=>?@\\\\^_`|~]*"
721 }
722 ]
723 },
724 {
725 "comment": "Function type [mvp]",
726 "match": "(?<=\\(type)\\s+(\\$[0-9A-Za-z!#$%&'*+\\-./:<=>?@\\\\^_`|~]*)",
727 "captures": {
728 "1": {
729 "name": "support.type.function.wat"
730 }
731 }
732 },
733 {
734 "comment": "Variable name or branch label [mvp]",
735 "name": "variable.other.wat",
736 "match": "\\$[0-9A-Za-z!#$%&'*+\\-./:<=>?@\\\\^_`|~]*\\b"
737 }
738 ]
739 }
740 ]
741 },
742 "constants": {
743 "patterns": [
744 {
745 "comment": "Fixed-width SIMD",
746 "patterns": [
747 {
748 "comment": "Vector literal (i8x16) [simd]",
749 "name": "constant.numeric.vector.wat",
750 "match": "\\b(i8x16)(?:\\s+0x[0-9a-fA-F]{1,2}){16}\\b",
751 "captures": {
752 "1": {
753 "name": "support.type.wat"
754 }
755 }
756 },
757 {
758 "comment": "Vector literal (i16x8) [simd]",
759 "name": "constant.numeric.vector.wat",
760 "match": "\\b(i16x8)(?:\\s+0x[0-9a-fA-F]{1,4}){8}\\b",
761 "captures": {
762 "1": {
763 "name": "support.type.wat"
764 }
765 }
766 },
767 {
768 "comment": "Vector literal (i32x4) [simd]",
769 "name": "constant.numeric.vector.wat",
770 "match": "\\b(i32x4)(?:\\s+0x[0-9a-fA-F]{1,8}){4}\\b",
771 "captures": {
772 "1": {
773 "name": "support.type.wat"
774 }
775 }
776 },
777 {
778 "comment": "Vector literal (i64x2) [simd]",
779 "name": "constant.numeric.vector.wat",
780 "match": "\\b(i64x2)(?:\\s+0x[0-9a-fA-F]{1,16}){2}\\b",
781 "captures": {
782 "1": {
783 "name": "support.type.wat"
784 }
785 }
786 }
787 ]
788 },
789 {
790 "comment": "MVP",
791 "patterns": [
792 {
793 "comment": "Floating point literal",
794 "name": "constant.numeric.float.wat",
795 "match": "[+-]?\\b[0-9][0-9]*(?:\\.[0-9][0-9]*)?(?:[eE][+-]?[0-9]+)?\\b"
796 },
797 {
798 "comment": "Floating point hexadecimal literal",
799 "name": "constant.numeric.float.wat",
800 "match": "[+-]?\\b0x([0-9a-fA-F]*\\.[0-9a-fA-F]+|[0-9a-fA-F]+\\.?)[Pp][+-]?[0-9]+\\b"
801 },
802 {
803 "comment": "Floating point infinity",
804 "name": "constant.numeric.float.wat",
805 "match": "[+-]?\\binf\\b"
806 },
807 {
808 "comment": "Floating point literal (NaN)",
809 "name": "constant.numeric.float.wat",
810 "match": "[+-]?\\bnan:0x[0-9a-fA-F][0-9a-fA-F]*\\b"
811 },
812 {
813 "comment": "Integer literal",
814 "name": "constant.numeric.integer.wat",
815 "match": "[+-]?\\b(?:0x[0-9a-fA-F][0-9a-fA-F]*|\\d[\\d]*)\\b"
816 }
817 ]
818 }
819 ]
820 },
821 "invalid": {
822 "patterns": [
823 {
824 "name": "invalid.wat",
825 "match": "[^\\s()]+"
826 }
827 ]
828 }
829 }
830 }
831