This repository has been archived on 2024-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
keksAccountGUI/node_modulesOLD/highlight.js/lib/languages/ini.js
2019-08-11 20:48:02 +02:00

67 lines
No EOL
1.5 KiB
JavaScript

module.exports = function(hljs) {
var STRING = {
className: "string",
contains: [hljs.BACKSLASH_ESCAPE],
variants: [
{
begin: "'''", end: "'''",
relevance: 10
}, {
begin: '"""', end: '"""',
relevance: 10
}, {
begin: '"', end: '"'
}, {
begin: "'", end: "'"
}
]
};
return {
aliases: ['toml'],
case_insensitive: true,
illegal: /\S/,
contains: [
hljs.COMMENT(';', '$'),
hljs.HASH_COMMENT_MODE,
{
className: 'section',
begin: /^\s*\[+/, end: /\]+/
},
{
begin: /^[a-z0-9\[\]_\.-]+\s*=\s*/, end: '$',
returnBegin: true,
contains: [
{
className: 'attr',
begin: /[a-z0-9\[\]_\.-]+/
},
{
begin: /=/, endsWithParent: true,
relevance: 0,
contains: [
hljs.COMMENT(';', '$'),
hljs.HASH_COMMENT_MODE,
{
className: 'literal',
begin: /\bon|off|true|false|yes|no\b/
},
{
className: 'variable',
variants: [
{begin: /\$[\w\d"][\w\d_]*/},
{begin: /\$\{(.*?)}/}
]
},
STRING,
{
className: 'number',
begin: /([\+\-]+)?[\d]+_[\d_]+/
},
hljs.NUMBER_MODE
]
}
]
}
]
};
};