travel/admin/node_modules/highlight.js/lib/languages/dsconfig.js

67 lines
1.3 KiB
JavaScript
Raw Normal View History

2024-06-24 11:28:18 +08:00
/*
Language: dsconfig
Description: dsconfig batch configuration language for LDAP directory servers
Contributors: Jacob Childress <jacobc@gmail.com>
Category: enterprise, config
*/
/** @type LanguageFn */
function dsconfig(hljs) {
const QUOTED_PROPERTY = {
className: 'string',
begin: /"/,
end: /"/
};
const APOS_PROPERTY = {
className: 'string',
begin: /'/,
end: /'/
};
const UNQUOTED_PROPERTY = {
className: 'string',
begin: /[\w\-?]+:\w+/,
end: /\W/,
relevance: 0
};
const VALUELESS_PROPERTY = {
className: 'string',
begin: /\w+(\-\w+)*/,
end: /(?=\W)/,
relevance: 0
};
return {
keywords: 'dsconfig',
contains: [
{
className: 'keyword',
begin: '^dsconfig',
end: /\s/,
excludeEnd: true,
relevance: 10
},
{
className: 'built_in',
begin: /(list|create|get|set|delete)-(\w+)/,
end: /\s/,
excludeEnd: true,
illegal: '!@#$%^&*()',
relevance: 10
},
{
className: 'built_in',
begin: /--(\w+)/,
end: /\s/,
excludeEnd: true
},
QUOTED_PROPERTY,
APOS_PROPERTY,
UNQUOTED_PROPERTY,
VALUELESS_PROPERTY,
hljs.HASH_COMMENT_MODE
]
};
}
module.exports = dsconfig;