main
Last change
on this file since d24f17c was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
1.5 KB
|
Rev | Line | |
---|
[d24f17c] | 1 | 'use strict'
|
---|
| 2 |
|
---|
| 3 | module.exports = wasm
|
---|
| 4 | wasm.displayName = 'wasm'
|
---|
| 5 | wasm.aliases = []
|
---|
| 6 | function wasm(Prism) {
|
---|
| 7 | Prism.languages.wasm = {
|
---|
| 8 | comment: [
|
---|
| 9 | /\(;[\s\S]*?;\)/,
|
---|
| 10 | {
|
---|
| 11 | pattern: /;;.*/,
|
---|
| 12 | greedy: true
|
---|
| 13 | }
|
---|
| 14 | ],
|
---|
| 15 | string: {
|
---|
| 16 | pattern: /"(?:\\[\s\S]|[^"\\])*"/,
|
---|
| 17 | greedy: true
|
---|
| 18 | },
|
---|
| 19 | keyword: [
|
---|
| 20 | {
|
---|
| 21 | pattern: /\b(?:align|offset)=/,
|
---|
| 22 | inside: {
|
---|
| 23 | operator: /=/
|
---|
| 24 | }
|
---|
| 25 | },
|
---|
| 26 | {
|
---|
| 27 | pattern:
|
---|
| 28 | /\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|neg?|nearest|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|sqrt|store(?:8|16|32)?|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))?|memory\.(?:grow|size))\b/,
|
---|
| 29 | inside: {
|
---|
| 30 | punctuation: /\./
|
---|
| 31 | }
|
---|
| 32 | },
|
---|
| 33 | /\b(?:anyfunc|block|br(?:_if|_table)?|call(?:_indirect)?|data|drop|elem|else|end|export|func|get_(?:global|local)|global|if|import|local|loop|memory|module|mut|nop|offset|param|result|return|select|set_(?:global|local)|start|table|tee_local|then|type|unreachable)\b/
|
---|
| 34 | ],
|
---|
| 35 | variable: /\$[\w!#$%&'*+\-./:<=>?@\\^`|~]+/,
|
---|
| 36 | number:
|
---|
| 37 | /[+-]?\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/,
|
---|
| 38 | punctuation: /[()]/
|
---|
| 39 | }
|
---|
| 40 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.