prism-monkey.js 994 B

1234567891011121314151617181920212223242526272829
  1. Prism.languages.monkey = {
  2. 'comment': {
  3. pattern: /^#Rem\s[\s\S]*?^#End|'.+/im,
  4. greedy: true
  5. },
  6. 'string': {
  7. pattern: /"[^"\r\n]*"/,
  8. greedy: true,
  9. },
  10. 'preprocessor': {
  11. pattern: /(^[ \t]*)#.+/m,
  12. lookbehind: true,
  13. greedy: true,
  14. alias: 'property'
  15. },
  16. 'function': /\b\w+(?=\()/,
  17. 'type-char': {
  18. pattern: /\b[?%#$]/,
  19. alias: 'class-name'
  20. },
  21. 'number': {
  22. pattern: /((?:\.\.)?)(?:(?:\b|\B-\.?|\B\.)\d+(?:(?!\.\.)\.\d*)?|\$[\da-f]+)/i,
  23. lookbehind: true
  24. },
  25. 'keyword': /\b(?:Abstract|Array|Bool|Case|Catch|Class|Const|Continue|Default|Eachin|Else|ElseIf|End|EndIf|Exit|Extends|Extern|False|Field|Final|Float|For|Forever|Function|Global|If|Implements|Import|Inline|Int|Interface|Local|Method|Module|New|Next|Null|Object|Private|Property|Public|Repeat|Return|Select|Self|Step|Strict|String|Super|Then|Throw|To|True|Try|Until|Void|Wend|While)\b/i,
  26. 'operator': /\.\.|<[=>]?|>=?|:?=|(?:[+\-*\/&~|]|\b(?:Mod|Shl|Shr)\b)=?|\b(?:And|Not|Or)\b/i,
  27. 'punctuation': /[.,:;()\[\]]/
  28. };