]>
luflow.net public git repositories - flow-web.git/blob - static/highlight/languages/nsis.js
1 /*! `nsis` grammar compiled for Highlight.js 11.11.1 */
3 var hljsGrammar
= (function () {
8 Description: Nullsoft Scriptable Install System
9 Author: Jan T. Sott <jan.sott@gmail.com>
10 Website: https://nsis.sourceforge.io/Main_Page
16 const regex
= hljs
.regex
;
17 const LANGUAGE_CONSTANTS
= [
51 "RESOURCES_LOCALIZED",
66 "FILE_ATTRIBUTE_ARCHIVE",
67 "FILE_ATTRIBUTE_NORMAL",
68 "FILE_ATTRIBUTE_OFFLINE",
69 "FILE_ATTRIBUTE_READONLY",
70 "FILE_ATTRIBUTE_SYSTEM",
71 "FILE_ATTRIBUTE_TEMPORARY",
76 "HKEY_CURRENT_CONFIG",
80 "HKEY_PERFORMANCE_DATA",
92 "MB_ABORTRETRYIGNORE",
118 const COMPILER_FLAGS
= [
156 className: 'variable.constant',
157 begin: regex
.concat(/\$/, regex
.either(...LANGUAGE_CONSTANTS
))
162 className: 'variable',
163 begin: /\$+\{[\!\w.:-]+\}/
168 className: 'variable',
169 begin: /\$+\w[\w\.]*/,
174 // $(language_strings)
175 className: 'variable',
176 begin: /\$+\([\w^.:!-]+\)/
180 // command parameters
182 begin: regex
.either(...PARAM_NAMES
)
187 className: 'keyword',
190 regex
.either(...COMPILER_FLAGS
)
194 const ESCAPE_CHARS
= {
196 className: 'char.escape',
197 begin: /\$(\\[nrt]|\$)/
202 className: 'title.function',
236 "AllowRootDirInstall",
298 "GetDLLVersionLocal",
303 "GetFunctionAddress",
305 "GetKnownFolderPath",
317 "IfShellVarContextAll",
342 "LicenseForceSelection",
351 "ManifestLongPathAware",
352 "ManifestMaxVersionTested",
353 "ManifestSupportedOS",
362 "PEDllCharacteristics",
375 "RequestExecutionLevel",
381 "SectionGetInstTypes",
386 "SectionSetInstTypes",
394 "SetCompressorDictSize",
397 "SetDatablockOptimize",
409 "SetShellVarContext",
424 "UninstallButtonText",
427 "UninstallSubCaption",
503 const FUNCTION_DEFINITION
= {
507 regex
.concat(/(\.)?/, hljs
.IDENT_RE
)
515 // Var Custom.Variable.Name.Item
516 // Var /GLOBAL Custom.Variable.Name.Item
517 const VARIABLE_NAME_RE
= /[A-Za-z][\w.]*/;
518 const VARIABLE_DEFINITION
= {
534 case_insensitive: true,
540 hljs
.HASH_COMMENT_MODE
,
541 hljs
.C_BLOCK_COMMENT_MODE
,
549 { beginKeywords: 'Function PageEx Section SectionGroup FunctionEnd SectionEnd', },
566 hljs
.registerLanguage('nsis', hljsGrammar
);