diff options
| author | Armand Philippot <git@armandphilippot.com> | 2023-10-13 19:32:56 +0200 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2023-11-11 18:14:41 +0100 |
| commit | 006b15b467a5cd835a6eab1b49023100bdc8f2e6 (patch) | |
| tree | 949c7295c2e206f42357f135bab4696ddf6576ec /public/prism/prism-armasm.min.js | |
| parent | 00f147a7a687d5772bcc538bc606cfff972178cd (diff) | |
refactor(components): rewrite Code component and usePrism hook
* move Prism styles to Sass placeholders to avoid repeats
* let usePrism consumer define its plugins (remove default ones)
* remove `plugins` prop from Code component
* add new props to Code component to let consumer configure plugins
(and handle plugin list from the given options)
However there are some problems with Prism plugins: line-highlight and
treeview does not seems to be loaded. I don't want to use Babel instead
of SWC so I have no solution for now.
Diffstat (limited to 'public/prism/prism-armasm.min.js')
| -rw-r--r-- | public/prism/prism-armasm.min.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/public/prism/prism-armasm.min.js b/public/prism/prism-armasm.min.js new file mode 100644 index 0000000..8e6f2cc --- /dev/null +++ b/public/prism/prism-armasm.min.js @@ -0,0 +1,31 @@ +(Prism.languages.armasm = { + comment: { pattern: /;.*/, greedy: !0 }, + string: { + pattern: /"(?:[^"\r\n]|"")*"/, + greedy: !0, + inside: { + variable: { pattern: /((?:^|[^$])(?:\${2})*)\$\w+/, lookbehind: !0 }, + }, + }, + char: { pattern: /'(?:[^'\r\n]{0,4}|'')'/, greedy: !0 }, + 'version-symbol': { pattern: /\|[\w@]+\|/, greedy: !0, alias: 'property' }, + boolean: /\b(?:FALSE|TRUE)\b/, + directive: { + pattern: + /\b(?:ALIAS|ALIGN|AREA|ARM|ASSERT|ATTR|CN|CODE|CODE16|CODE32|COMMON|CP|DATA|DCB|DCD|DCDO|DCDU|DCFD|DCFDU|DCI|DCQ|DCQU|DCW|DCWU|DN|ELIF|ELSE|END|ENDFUNC|ENDIF|ENDP|ENTRY|EQU|EXPORT|EXPORTAS|EXTERN|FIELD|FILL|FN|FUNCTION|GBLA|GBLL|GBLS|GET|GLOBAL|IF|IMPORT|INCBIN|INCLUDE|INFO|KEEP|LCLA|LCLL|LCLS|LTORG|MACRO|MAP|MEND|MEXIT|NOFP|OPT|PRESERVE8|PROC|QN|READONLY|RELOC|REQUIRE|REQUIRE8|RLIST|ROUT|SETA|SETL|SETS|SN|SPACE|SUBT|THUMB|THUMBX|TTL|WEND|WHILE)\b/, + alias: 'property', + }, + instruction: { + pattern: + /((?:^|(?:^|[^\\])(?:\r\n?|\n))[ \t]*(?:(?:[A-Z][A-Z0-9_]*[a-z]\w*|[a-z]\w*|\d+)[ \t]+)?)\b[A-Z.]+\b/, + lookbehind: !0, + alias: 'keyword', + }, + variable: /\$\w+/, + number: + /(?:\b[2-9]_\d+|(?:\b\d+(?:\.\d+)?|\B\.\d+)(?:e-?\d+)?|\b0(?:[fd]_|x)[0-9a-f]+|&[0-9a-f]+)\b/i, + register: { pattern: /\b(?:r\d|lr)\b/, alias: 'symbol' }, + operator: /<>|<<|>>|&&|\|\||[=!<>/]=?|[+\-*%#?&|^]|:[A-Z]+:/, + punctuation: /[()[\],]/, +}), + (Prism.languages['arm-asm'] = Prism.languages.armasm); |
