highlight-ts
Version:
Highlight.JS in TypeScript (and ES6).
73 lines • 2.05 kB
JavaScript
;
/*
Language: Ini
Contributors: Guillaume Gomez <guillaume1.gomez@gmail.com>
Category: common, config
*/
Object.defineProperty(exports, "__esModule", { value: true });
var common_1 = require("../common");
var STRING = {
className: "string",
contains: [common_1.BACKSLASH_ESCAPE],
variants: [
{
begin: "'''", end: "'''",
relevance: 10
}, {
begin: '"""', end: '"""',
relevance: 10
}, {
begin: '"', end: '"'
}, {
begin: "'", end: "'"
}
]
};
exports.INI = {
name: 'ini',
aliases: ['toml'],
case_insensitive: true,
illegal: /\S/,
contains: [
common_1.COMMENT(';', '$'),
common_1.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: [
{
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_]+/
},
common_1.NUMBER_MODE
]
}
]
}
]
};
//# sourceMappingURL=ini.js.map