prism-autoit.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. Prism.languages.autoit = {
  2. 'comment': [
  3. /;.*/,
  4. {
  5. // The multi-line comments delimiters can actually be commented out with ";"
  6. pattern: /(^[\t ]*)#(?:comments-start|cs)[\s\S]*?^[ \t]*#(?:ce|comments-end)/m,
  7. lookbehind: true
  8. }
  9. ],
  10. 'url': {
  11. pattern: /(^[\t ]*#include\s+)(?:<[^\r\n>]+>|"[^\r\n"]+")/m,
  12. lookbehind: true
  13. },
  14. 'string': {
  15. pattern: /(["'])(?:\1\1|(?!\1)[^\r\n])*\1/,
  16. greedy: true,
  17. inside: {
  18. 'variable': /([%$@])\w+\1/
  19. }
  20. },
  21. 'directive': {
  22. pattern: /(^[\t ]*)#[\w-]+/m,
  23. lookbehind: true,
  24. alias: 'keyword'
  25. },
  26. 'function': /\b\w+(?=\()/,
  27. // Variables and macros
  28. 'variable': /[$@]\w+/,
  29. 'keyword': /\b(?:Case|Const|Continue(?:Case|Loop)|Default|Dim|Do|Else(?:If)?|End(?:Func|If|Select|Switch|With)|Enum|Exit(?:Loop)?|For|Func|Global|If|In|Local|Next|Null|ReDim|Select|Static|Step|Switch|Then|To|Until|Volatile|WEnd|While|With)\b/i,
  30. 'number': /\b(?:0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)\b/i,
  31. 'boolean': /\b(?:False|True)\b/i,
  32. 'operator': /<[=>]?|[-+*\/=&>]=?|[?^]|\b(?:And|Not|Or)\b/i,
  33. 'punctuation': /[\[\]().,:]/
  34. };