monkey.js 1.9 KB

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