monkey.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. module.exports = function(hljs) {
  2. var NUMBER = {
  3. className: 'number', relevance: 0,
  4. variants: [
  5. {
  6. begin: '[$][a-fA-F0-9]+'
  7. },
  8. hljs.NUMBER_MODE
  9. ]
  10. };
  11. return {
  12. case_insensitive: true,
  13. keywords: {
  14. keyword: 'public private property continue exit extern new try catch ' +
  15. 'eachin not abstract final select case default const local global field ' +
  16. 'end if then else elseif endif while wend repeat until forever for ' +
  17. 'to step next return module inline throw import',
  18. built_in: 'DebugLog DebugStop Error Print ACos ACosr ASin ASinr ATan ATan2 ATan2r ATanr Abs Abs Ceil ' +
  19. 'Clamp Clamp Cos Cosr Exp Floor Log Max Max Min Min Pow Sgn Sgn Sin Sinr Sqrt Tan Tanr Seed PI HALFPI TWOPI',
  20. literal: 'true false null and or shl shr mod'
  21. },
  22. illegal: /\/\*/,
  23. contains: [
  24. hljs.COMMENT('#rem', '#end'),
  25. hljs.COMMENT(
  26. "'",
  27. '$',
  28. {
  29. relevance: 0
  30. }
  31. ),
  32. {
  33. className: 'function',
  34. beginKeywords: 'function method', end: '[(=:]|$',
  35. illegal: /\n/,
  36. contains: [
  37. hljs.UNDERSCORE_TITLE_MODE
  38. ]
  39. },
  40. {
  41. className: 'class',
  42. beginKeywords: 'class interface', end: '$',
  43. contains: [
  44. {
  45. beginKeywords: 'extends implements'
  46. },
  47. hljs.UNDERSCORE_TITLE_MODE
  48. ]
  49. },
  50. {
  51. className: 'built_in',
  52. begin: '\\b(self|super)\\b'
  53. },
  54. {
  55. className: 'meta',
  56. begin: '\\s*#', end: '$',
  57. keywords: {'meta-keyword': 'if else elseif endif end then'}
  58. },
  59. {
  60. className: 'meta',
  61. begin: '^\\s*strict\\b'
  62. },
  63. {
  64. beginKeywords: 'alias', end: '=',
  65. contains: [hljs.UNDERSCORE_TITLE_MODE]
  66. },
  67. hljs.QUOTE_STRING_MODE,
  68. NUMBER
  69. ]
  70. }
  71. };