Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/languages/nsis.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ Author: Jan T. Sott <jan.sott@gmail.com>
Website: https://nsis.sourceforge.io/Main_Page
*/

import * as regex from '../lib/regex.js';

export default function(hljs) {
const regex = hljs.regex;
const LANGUAGE_CONSTANTS = [
Expand Down Expand Up @@ -107,7 +105,8 @@ export default function(hljs) {
"READONLY",
"SHCTX",
"SHELL_CONTEXT",
"SYSTEM|TEMPORARY",
"SYSTEM",
"TEMPORARY",
];

const COMPILER_FLAGS = [
Expand Down Expand Up @@ -348,7 +347,7 @@ export default function(hljs) {
"ManifestSupportedOS",
"MessageBox",
"MiscButtonText",
"Name|0",
"Name",
"Nop",
"OutFile",
"Page",
Expand Down
12 changes: 11 additions & 1 deletion test/markup/nsis/default.expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,23 @@
<span class="hljs-comment">; Defines</span>
<span class="hljs-keyword">!define</span> x64 <span class="hljs-string">&quot;true&quot;</span>

<span class="hljs-comment">; Macros</span>
<span class="hljs-keyword">!macro</span> Greeter Name
<span class="hljs-keyword">DetailPrint</span> <span class="hljs-string">&quot;Hello <span class="hljs-variable">${Name}</span>&quot;</span>
<span class="hljs-keyword">!macroend</span>

<span class="hljs-comment">; Runtime Condition</span>
<span class="hljs-keyword">!if</span> <span class="hljs-literal">true</span> == <span class="hljs-literal">false</span>
<span class="hljs-keyword">!error</span>
<span class="hljs-keyword">!endif</span>

<span class="hljs-comment">; Settings</span>
<span class="hljs-keyword">Name</span> <span class="hljs-string">&quot;installer_name&quot;</span>
<span class="hljs-keyword">OutFile</span> <span class="hljs-string">&quot;installer_name.exe&quot;</span>
<span class="hljs-keyword">RequestExecutionLevel</span> <span class="hljs-literal">user</span>
<span class="hljs-keyword">CRCCheck</span> <span class="hljs-literal">on</span>

<span class="hljs-keyword">!if</span>def <span class="hljs-variable">${x64}</span>
<span class="hljs-keyword">!ifdef</span> <span class="hljs-variable">${x64}</span>
<span class="hljs-keyword">InstallDir</span> <span class="hljs-string">&quot;<span class="hljs-variable constant_">$PROGRAMFILES64</span>\installer_name&quot;</span>
<span class="hljs-keyword">!else</span>
<span class="hljs-keyword">InstallDir</span> <span class="hljs-string">&quot;<span class="hljs-variable constant_">$PROGRAMFILES</span>\installer_name&quot;</span>
Expand Down
10 changes: 10 additions & 0 deletions test/markup/nsis/default.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@
; Defines
!define x64 "true"

; Macros
!macro Greeter Name
DetailPrint "Hello ${Name}"
!macroend

; Runtime Condition
!if true == false
!error
!endif

; Settings
Name "installer_name"
OutFile "installer_name.exe"
Expand Down