]>
luflow.net public git repositories - flow-web.git/blob - static/highlight/es/languages/wasm.js
1 /*! `wasm` grammar compiled for Highlight.js 11.11.1 */
2 var hljsGrammar
= ( function () {
7 Website: https://webassembly.org
8 Description: Wasm is designed as a portable compilation target for programming languages, enabling deployment on the web for client and server applications.
13 /** @type LanguageFn */
16 const BLOCK_COMMENT
= hljs
. COMMENT ( /\(;/ , /;\)/ );
17 BLOCK_COMMENT
. contains
. push ( "self" );
18 const LINE_COMMENT
= hljs
. COMMENT ( /;;/ , /$/);
68 const FUNCTION_REFERENCE
= {
70 /(?:func|call|call_indirect)/ ,
81 className : "variable" ,
86 match : /(\((?!;)|\))+/ ,
87 className : "punctuation" ,
94 // borrowed from Prism, TODO: split out into variants
95 match : /[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/
99 // look-ahead prevents us from gobbling up opcodes
100 match : /(i32|i64|f32|f64)(?!\.)/ ,
104 const MATH_OPERATIONS
= {
105 className : "keyword" ,
106 // borrowed from Prism, TODO: split out into variants
107 match : /\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/
110 const OFFSET_ALIGN
= {
135 hljs
. QUOTE_STRING_MODE
,
147 export default hljsGrammar
;