dsconfig.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. Language: dsconfig
  3. Description: dsconfig batch configuration language for LDAP directory servers
  4. Contributors: Jacob Childress <jacobc@gmail.com>
  5. Category: enterprise, config
  6. */
  7. /** @type LanguageFn */
  8. function dsconfig(hljs) {
  9. const QUOTED_PROPERTY = {
  10. className: 'string',
  11. begin: /"/,
  12. end: /"/
  13. };
  14. const APOS_PROPERTY = {
  15. className: 'string',
  16. begin: /'/,
  17. end: /'/
  18. };
  19. const UNQUOTED_PROPERTY = {
  20. className: 'string',
  21. begin: /[\w\-?]+:\w+/,
  22. end: /\W/,
  23. relevance: 0
  24. };
  25. const VALUELESS_PROPERTY = {
  26. className: 'string',
  27. begin: /\w+(\-\w+)*/,
  28. end: /(?=\W)/,
  29. relevance: 0
  30. };
  31. return {
  32. keywords: 'dsconfig',
  33. contains: [
  34. {
  35. className: 'keyword',
  36. begin: '^dsconfig',
  37. end: /\s/,
  38. excludeEnd: true,
  39. relevance: 10
  40. },
  41. {
  42. className: 'built_in',
  43. begin: /(list|create|get|set|delete)-(\w+)/,
  44. end: /\s/,
  45. excludeEnd: true,
  46. illegal: '!@#$%^&*()',
  47. relevance: 10
  48. },
  49. {
  50. className: 'built_in',
  51. begin: /--(\w+)/,
  52. end: /\s/,
  53. excludeEnd: true
  54. },
  55. QUOTED_PROPERTY,
  56. APOS_PROPERTY,
  57. UNQUOTED_PROPERTY,
  58. VALUELESS_PROPERTY,
  59. hljs.HASH_COMMENT_MODE
  60. ]
  61. };
  62. }
  63. module.exports = dsconfig;