site/node_modules/shiki/dist/langs/wasm.mjs

7 lines
16 KiB
JavaScript
Raw Permalink Normal View History

2024-10-14 06:09:33 +00:00
const lang = Object.freeze({ "displayName": "WebAssembly", "name": "wasm", "patterns": [{ "include": "#comments" }, { "include": "#strings" }, { "include": "#instructions" }, { "include": "#types" }, { "include": "#modules" }, { "include": "#constants" }, { "include": "#invalid" }], "repository": { "comments": { "patterns": [{ "captures": { "1": { "name": "punctuation.definition.comment.wat" } }, "comment": "Line comment", "match": "(;;).*$", "name": "comment.line.wat" }, { "begin": "\\(;", "beginCaptures": { "0": { "name": "punctuation.definition.comment.wat" } }, "comment": "Block comment", "end": ";\\)", "endCaptures": { "0": { "name": "punctuation.definition.comment.wat" } }, "name": "comment.block.wat" }] }, "constants": { "patterns": [{ "comment": "Fixed-width SIMD", "patterns": [{ "captures": { "1": { "name": "support.type.wat" } }, "comment": "Vector literal (i8x16) [simd]", "match": "\\b(i8x16)(?:\\s+0x[0-9a-fA-F]{1,2}){16}\\b", "name": "constant.numeric.vector.wat" }, { "captures": { "1": { "name": "support.type.wat" } }, "comment": "Vector literal (i16x8) [simd]", "match": "\\b(i16x8)(?:\\s+0x[0-9a-fA-F]{1,4}){8}\\b", "name": "constant.numeric.vector.wat" }, { "captures": { "1": { "name": "support.type.wat" } }, "comment": "Vector literal (i32x4) [simd]", "match": "\\b(i32x4)(?:\\s+0x[0-9a-fA-F]{1,8}){4}\\b", "name": "constant.numeric.vector.wat" }, { "captures": { "1": { "name": "support.type.wat" } }, "comment": "Vector literal (i64x2) [simd]", "match": "\\b(i64x2)(?:\\s+0x[0-9a-fA-F]{1,16}){2}\\b", "name": "constant.numeric.vector.wat" }] }, { "comment": "MVP", "patterns": [{ "comment": "Floating point literal", "match": "[+-]?\\b[0-9][0-9]*(?:\\.[0-9][0-9]*)?(?:[eE][+-]?[0-9]+)?\\b", "name": "constant.numeric.float.wat" }, { "comment": "Floating point hexadecimal literal", "match": "[+-]?\\b0x([0-9a-fA-F]*\\.[0-9a-fA-F]+|[0-9a-fA-F]+\\.?)[Pp][+-]?[0-9]+\\b", "name": "constant.numeric.float.wat" }, { "comment": "Floating point infinity", "match": "[+-]?\\binf\\b", "name": "constant.numeric.float.wat" }, { "comment": "Floating point literal (NaN)", "match": "[+-]?\\bnan:0x[0-9a-fA-F][0-9a-fA-F]*\\b", "name": "constant.numeric.float.wat" }, { "comment": "Integer literal", "match": "[+-]?\\b(?:0x[0-9a-fA-F][0-9a-fA-F]*|\\d[\\d]*)\\b", "name": "constant.numeric.integer.wat" }] }] }, "instructions": { "patterns": [{ "comment": "Non-trapping float-to-int conversions", "patterns": [{ "captures": { "1": { "name": "support.class.wat" } }, "comment": "Conversion instruction [nontrapping-float-to-int-conversions]", "match": "\\b(i32|i64)\\.trunc_sat_f(?:32|64)_[su]\\b", "name": "keyword.operator.word.wat" }] }, { "comment": "Sign-extension operators", "patterns": [{ "captures": { "1": { "name": "support.class.wat" } }, "comment": "Numeric instruction (i32) [sign-extension-ops]", "match": "\\b(i32)\\.(?:extend(?:8|16)_s)\\b", "name": "keyword.operator.word.wat" }, { "captures": { "1": { "name": "support.class.wat" } }, "comment": "Numeric instruction (i64) [sign-extension-ops]", "match": "\\b(i64)\\.(?:extend(?:8|16|32)_s)\\b", "name": "keyword.operator.word.wat" }] }, { "comment": "Bulk memory operations", "patterns": [{ "captures": { "1": { "name": "support.class.wat" } }, "comment": "Memory instruction [bulk-memory-operations]", "match": "\\b(memory)\\.(?:copy|fill|init|drop)\\b", "name": "keyword.operator.word.wat" }] }, { "comment": "Fixed-width SIMD", "patterns": [{ "captures": { "1": { "name": "support.class.wat" } }, "comment": "Vector instruction (v128) [simd]", "match": "\\b(v128)\\.(?:const|and|or|xor|not|andnot|bitselect|load|store)\\b", "name": "keyword.operator.word.wat" }, { "captures": { "1": { "name": "support.class.wat" } }, "comment": "Vector instruction (i8x16) [simd]", "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", "name": "keyword.operator.word.wat" }, { "captures": { "1": { "name": "support.class.
var wasm = [
lang
];
export { wasm as default };