text/js/highlight/ini.js.map

1 строка
5.0 KiB
Plaintext

{"version":3,"sources":["webpack:///./node_modules/highlight.js/lib/languages/ini.js"],"names":["source","re","concat","args","joined","map","x","join","module","exports","hljs","NUMBERS","className","relevance","variants","begin","NUMBER_RE","COMMENTS","COMMENT","end","VARIABLES","LITERALS","STRINGS","contains","BACKSLASH_ESCAPE","ARRAY","ANY_KEY","either","name","aliases","case_insensitive","illegal","starts"],"mappings":"mGASA,SAASA,EAAOC,GACd,OAAKA,EACa,iBAAPA,EAAwBA,EAE5BA,EAAGD,OAHM,KAkBlB,SAASE,IAAgB,2BAANC,EAAM,yBAANA,EAAM,gBACvB,IAAMC,EAASD,EAAKE,KAAI,SAACC,GAAD,OAAON,EAAOM,MAAIC,KAAK,IAC/C,OAAOH,EA8ITI,EAAOC,QAvHP,SAAaC,GACX,IAAMC,EAAU,CACdC,UAAW,SACXC,UAAW,EACXC,SAAU,CACR,CACEC,MAAO,wBAET,CACEA,MAAOL,EAAKM,aAIZC,EAAWP,EAAKQ,UACtBD,EAASH,SAAW,CAClB,CACEC,MAAO,IACPI,IAAK,KAEP,CACEJ,MAAO,IACPI,IAAK,MAGT,IAAMC,EAAY,CAChBR,UAAW,WACXE,SAAU,CACR,CACEC,MAAO,qBAET,CACEA,MAAO,iBAIPM,EAAW,CACfT,UAAW,UACXG,MAAO,gCAEHO,EAAU,CACdV,UAAW,SACXW,SAAU,CAACb,EAAKc,kBAChBV,SAAU,CACR,CACEC,MAAO,MACPI,IAAK,MACLN,UAAW,IAEb,CACEE,MAAO,MACPI,IAAK,MACLN,UAAW,IAEb,CACEE,MAAO,IACPI,IAAK,KAEP,CACEJ,MAAO,IACPI,IAAK,OAILM,EAAQ,CACZV,MAAO,KACPI,IAAK,KACLI,SAAU,CACRN,EACAI,EACAD,EACAE,EACAX,EACA,QAEFE,UAAW,GAMPa,EA7FR,WAAyB,2BAANvB,EAAM,yBAANA,EAAM,gBACvB,IAAMC,EAAS,IAAMD,EAAKE,KAAI,SAACC,GAAD,OAAON,EAAOM,MAAIC,KAAK,KAAO,IAC5D,OAAOH,EA2FSuB,CAHC,iBACe,gBACA,WAShC,MAAO,CACLC,KAAM,iBACNC,QAAS,CAAC,QACVC,kBAAkB,EAClBC,QAAS,KACTR,SAAU,CACRN,EACA,CACEL,UAAW,UACXG,MAAO,MACPI,IAAK,OAEP,CACEJ,MAlBab,EACjBwB,EAAS,eAAgBA,EAAS,KApH7BxB,EAAO,MAqHF,gBArHa,MAsInBU,UAAW,OACXoB,OAAQ,CACNb,IAAK,IACLI,SAAU,CACRN,EACAQ,EACAJ,EACAD,EACAE,EACAX","file":"highlight/ini.js?v=5e12e12b6fd88b7b9921","sourcesContent":["/**\n * @param {string} value\n * @returns {RegExp}\n * */\n\n/**\n * @param {RegExp | string } re\n * @returns {string}\n */\nfunction source(re) {\n if (!re) return null;\n if (typeof re === \"string\") return re;\n\n return re.source;\n}\n\n/**\n * @param {RegExp | string } re\n * @returns {string}\n */\nfunction lookahead(re) {\n return concat('(?=', re, ')');\n}\n\n/**\n * @param {...(RegExp | string) } args\n * @returns {string}\n */\nfunction concat(...args) {\n const joined = args.map((x) => source(x)).join(\"\");\n return joined;\n}\n\n/**\n * Any of the passed expresssions may match\n *\n * Creates a huge this | this | that | that match\n * @param {(RegExp | string)[] } args\n * @returns {string}\n */\nfunction either(...args) {\n const joined = '(' + args.map((x) => source(x)).join(\"|\") + \")\";\n return joined;\n}\n\n/*\nLanguage: TOML, also INI\nDescription: TOML aims to be a minimal configuration file format that's easy to read due to obvious semantics.\nContributors: Guillaume Gomez <guillaume1.gomez@gmail.com>\nCategory: common, config\nWebsite: https://github.com/toml-lang/toml\n*/\n\nfunction ini(hljs) {\n const NUMBERS = {\n className: 'number',\n relevance: 0,\n variants: [\n {\n begin: /([+-]+)?[\\d]+_[\\d_]+/\n },\n {\n begin: hljs.NUMBER_RE\n }\n ]\n };\n const COMMENTS = hljs.COMMENT();\n COMMENTS.variants = [\n {\n begin: /;/,\n end: /$/\n },\n {\n begin: /#/,\n end: /$/\n }\n ];\n const VARIABLES = {\n className: 'variable',\n variants: [\n {\n begin: /\\$[\\w\\d\"][\\w\\d_]*/\n },\n {\n begin: /\\$\\{(.*?)\\}/\n }\n ]\n };\n const LITERALS = {\n className: 'literal',\n begin: /\\bon|off|true|false|yes|no\\b/\n };\n const STRINGS = {\n className: \"string\",\n contains: [hljs.BACKSLASH_ESCAPE],\n variants: [\n {\n begin: \"'''\",\n end: \"'''\",\n relevance: 10\n },\n {\n begin: '\"\"\"',\n end: '\"\"\"',\n relevance: 10\n },\n {\n begin: '\"',\n end: '\"'\n },\n {\n begin: \"'\",\n end: \"'\"\n }\n ]\n };\n const ARRAY = {\n begin: /\\[/,\n end: /\\]/,\n contains: [\n COMMENTS,\n LITERALS,\n VARIABLES,\n STRINGS,\n NUMBERS,\n 'self'\n ],\n relevance: 0\n };\n\n const BARE_KEY = /[A-Za-z0-9_-]+/;\n const QUOTED_KEY_DOUBLE_QUOTE = /\"(\\\\\"|[^\"])*\"/;\n const QUOTED_KEY_SINGLE_QUOTE = /'[^']*'/;\n const ANY_KEY = either(\n BARE_KEY, QUOTED_KEY_DOUBLE_QUOTE, QUOTED_KEY_SINGLE_QUOTE\n );\n const DOTTED_KEY = concat(\n ANY_KEY, '(\\\\s*\\\\.\\\\s*', ANY_KEY, ')*',\n lookahead(/\\s*=\\s*[^#\\s]/)\n );\n\n return {\n name: 'TOML, also INI',\n aliases: ['toml'],\n case_insensitive: true,\n illegal: /\\S/,\n contains: [\n COMMENTS,\n {\n className: 'section',\n begin: /\\[+/,\n end: /\\]+/\n },\n {\n begin: DOTTED_KEY,\n className: 'attr',\n starts: {\n end: /$/,\n contains: [\n COMMENTS,\n ARRAY,\n LITERALS,\n VARIABLES,\n STRINGS,\n NUMBERS\n ]\n }\n }\n ]\n };\n}\n\nmodule.exports = ini;\n"],"sourceRoot":""}