diff options
| author | Armand Philippot <git@armandphilippot.com> | 2021-12-30 19:47:21 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2021-12-30 19:47:21 +0100 |
| commit | a98b5ea6fe8e8cc98a55e0fd793e6e8660ea31c1 (patch) | |
| tree | 542810ab5aef99150db228bb54fd58303dcb31c7 /public/prism/prism-nasm.js | |
| parent | ab355897a12b7bda1089a44de326d41455a0f7a3 (diff) | |
chore: add prismjs for syntax highlighting
Diffstat (limited to 'public/prism/prism-nasm.js')
| -rw-r--r-- | public/prism/prism-nasm.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/public/prism/prism-nasm.js b/public/prism/prism-nasm.js new file mode 100644 index 0000000..ea2f95e --- /dev/null +++ b/public/prism/prism-nasm.js @@ -0,0 +1,26 @@ +Prism.languages.nasm = { + comment: /;.*$/m, + string: /(["'`])(?:\\.|(?!\1)[^\\\r\n])*\1/, + label: { + pattern: /(^\s*)[A-Za-z._?$][\w.?$@~#]*:/m, + lookbehind: true, + alias: 'function', + }, + keyword: [ + /\[?BITS (?:16|32|64)\]?/, + { + pattern: /(^\s*)section\s*[a-z.]+:?/im, + lookbehind: true, + }, + /(?:extern|global)[^;\r\n]*/i, + /(?:CPU|DEFAULT|FLOAT).*$/m, + ], + register: { + pattern: + /\b(?:st\d|[xyz]mm\d\d?|[cdt]r\d|r\d\d?[bwd]?|[er]?[abcd]x|[abcd][hl]|[er]?(?:bp|di|si|sp)|[cdefgs]s)\b/i, + alias: 'variable', + }, + number: + /(?:\b|(?=\$))(?:0[hx](?:\.[\da-f]+|[\da-f]+(?:\.[\da-f]+)?)(?:p[+-]?\d+)?|\d[\da-f]+[hx]|\$\d[\da-f]*|0[oq][0-7]+|[0-7]+[oq]|0[by][01]+|[01]+[by]|0[dt]\d+|(?:\d+(?:\.\d+)?|\.\d+)(?:\.?e[+-]?\d+)?[dt]?)\b/i, + operator: /[\[\]*+\-\/%<>=&|$!]/, +}; |
