prism-armasm.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. Prism.languages.armasm = {
  2. 'comment': {
  3. pattern: /;.*/,
  4. greedy: true
  5. },
  6. 'string': {
  7. pattern: /"(?:[^"\r\n]|"")*"/,
  8. greedy: true,
  9. inside: {
  10. 'variable': {
  11. pattern: /((?:^|[^$])(?:\${2})*)\$\w+/,
  12. lookbehind: true
  13. }
  14. }
  15. },
  16. 'char': {
  17. pattern: /'(?:[^'\r\n]{0,4}|'')'/,
  18. greedy: true
  19. },
  20. 'version-symbol': {
  21. pattern: /\|[\w@]+\|/,
  22. greedy: true,
  23. alias: 'property'
  24. },
  25. 'boolean': /\b(?:FALSE|TRUE)\b/,
  26. 'directive': {
  27. 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/,
  28. alias: 'property'
  29. },
  30. 'instruction': {
  31. pattern: /((?:^|(?:^|[^\\])(?:\r\n?|\n))[ \t]*(?:(?:[A-Z][A-Z0-9_]*[a-z]\w*|[a-z]\w*|\d+)[ \t]+)?)\b[A-Z.]+\b/,
  32. lookbehind: true,
  33. alias: 'keyword'
  34. },
  35. 'variable': /\$\w+/,
  36. 'number': /(?:\b[2-9]_\d+|(?:\b\d+(?:\.\d+)?|\B\.\d+)(?:e-?\d+)?|\b0(?:[fd]_|x)[0-9a-f]+|&[0-9a-f]+)\b/i,
  37. 'register': {
  38. pattern: /\b(?:r\d|lr)\b/,
  39. alias: 'symbol'
  40. },
  41. 'operator': /<>|<<|>>|&&|\|\||[=!<>/]=?|[+\-*%#?&|^]|:[A-Z]+:/,
  42. 'punctuation': /[()[\],]/
  43. };
  44. Prism.languages['arm-asm'] = Prism.languages.armasm;