1
0
Fork 0
management/front/dkha-web-sz-main/node_modules/highlight.js/lib/languages/roboconf.js

83 lines
1.5 KiB
JavaScript
Raw Normal View History

2024-01-16 21:26:16 +08:00
/*
Language: Roboconf
Author: Vincent Zurczak <vzurczak@linagora.com>
Description: Syntax highlighting for Roboconf's DSL
Website: http://roboconf.net
Category: config
*/
2023-12-18 13:12:25 +08:00
2024-01-16 21:26:16 +08:00
function roboconf(hljs) {
const IDENTIFIER = '[a-zA-Z-_][^\\n{]+\\{';
const PROPERTY = {
2023-12-18 13:12:25 +08:00
className: 'attribute',
2024-01-16 21:26:16 +08:00
begin: /[a-zA-Z-_]+/,
end: /\s*:/,
excludeEnd: true,
2023-12-18 13:12:25 +08:00
starts: {
end: ';',
relevance: 0,
contains: [
{
className: 'variable',
begin: /\.[a-zA-Z-_]+/
},
{
className: 'keyword',
begin: /\(optional\)/
}
]
}
};
return {
2024-01-16 21:26:16 +08:00
name: 'Roboconf',
aliases: [
'graph',
'instances'
],
2023-12-18 13:12:25 +08:00
case_insensitive: true,
keywords: 'import',
contains: [
// Facet sections
{
begin: '^facet ' + IDENTIFIER,
2024-01-16 21:26:16 +08:00
end: /\}/,
2023-12-18 13:12:25 +08:00
keywords: 'facet',
contains: [
PROPERTY,
hljs.HASH_COMMENT_MODE
]
},
// Instance sections
{
begin: '^\\s*instance of ' + IDENTIFIER,
2024-01-16 21:26:16 +08:00
end: /\}/,
2023-12-18 13:12:25 +08:00
keywords: 'name count channels instance-data instance-state instance of',
illegal: /\S/,
contains: [
'self',
PROPERTY,
hljs.HASH_COMMENT_MODE
]
},
// Component sections
{
begin: '^' + IDENTIFIER,
2024-01-16 21:26:16 +08:00
end: /\}/,
2023-12-18 13:12:25 +08:00
contains: [
PROPERTY,
hljs.HASH_COMMENT_MODE
]
},
// Comments
hljs.HASH_COMMENT_MODE
]
};
2024-01-16 21:26:16 +08:00
}
module.exports = roboconf;