]>
luflow.net public git repositories - flow-web.git/blob - static/highlight/languages/ini.js
1 /*! `ini` grammar compiled for Highlight.js 11.11.1 */
3 var hljsGrammar
= (function () {
7 Language: TOML, also INI
8 Description: TOML aims to be a minimal configuration file format that's easy to read due to obvious semantics.
9 Contributors: Guillaume Gomez <guillaume1.gomez@gmail.com>
10 Category: common, config
11 Website: https://github.com/toml-lang/toml
15 const regex
= hljs
.regex
;
20 { begin: /([+-]+)?[\d]+_[\d_]+/ },
21 { begin: hljs
.NUMBER_RE
}
24 const COMMENTS
= hljs
.COMMENT();
36 className: 'variable',
38 { begin: /\$[\w\d"][\w\d_]*/ },
39 { begin: /\$\{(.*?)\}/ }
44 begin: /\bon|off|true|false|yes|no\b/
48 contains: [ hljs
.BACKSLASH_ESCAPE
],
84 const BARE_KEY
= /[A-Za-z0-9_-]+/;
85 const QUOTED_KEY_DOUBLE_QUOTE
= /"(\\"|[^"])*"/;
86 const QUOTED_KEY_SINGLE_QUOTE
= /'[^']*'/;
87 const ANY_KEY
= regex
.either(
88 BARE_KEY
, QUOTED_KEY_DOUBLE_QUOTE
, QUOTED_KEY_SINGLE_QUOTE
90 const DOTTED_KEY
= regex
.concat(
91 ANY_KEY
, '(\\s*\\.\\s*', ANY_KEY
, ')*',
92 regex
.lookahead(/\s*=\s*[^#\s]/)
96 name: 'TOML, also INI',
98 case_insensitive: true,
103 className: 'section',
130 hljs
.registerLanguage('ini', hljsGrammar
);