dsconfig.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. module.exports = function(hljs) {
  2. var QUOTED_PROPERTY = {
  3. className: 'string',
  4. begin: /"/, end: /"/
  5. };
  6. var APOS_PROPERTY = {
  7. className: 'string',
  8. begin: /'/, end: /'/
  9. };
  10. var UNQUOTED_PROPERTY = {
  11. className: 'string',
  12. begin: '[\\w-?]+:\\w+', end: '\\W',
  13. relevance: 0
  14. };
  15. var VALUELESS_PROPERTY = {
  16. className: 'string',
  17. begin: '\\w+-?\\w+', end: '\\W',
  18. relevance: 0
  19. };
  20. return {
  21. keywords: 'dsconfig',
  22. contains: [
  23. {
  24. className: 'keyword',
  25. begin: '^dsconfig', end: '\\s', excludeEnd: true,
  26. relevance: 10
  27. },
  28. {
  29. className: 'built_in',
  30. begin: '(list|create|get|set|delete)-(\\w+)', end: '\\s', excludeEnd: true,
  31. illegal: '!@#$%^&*()',
  32. relevance: 10
  33. },
  34. {
  35. className: 'built_in',
  36. begin: '--(\\w+)', end: '\\s', excludeEnd: true
  37. },
  38. QUOTED_PROPERTY,
  39. APOS_PROPERTY,
  40. UNQUOTED_PROPERTY,
  41. VALUELESS_PROPERTY,
  42. hljs.HASH_COMMENT_MODE
  43. ]
  44. };
  45. };