Skip to content

Commit b8d48ca

Browse files
committed
Add support for the GNU Prolog native code backend
1 parent c946927 commit b8d48ca

6 files changed

Lines changed: 18 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## [0.81.0]
44

5+
* Add support for the GNU Prolog native code backend
56
* Fix the "logtalk.executable.arguments" setting being ignored on Windows when the "logtalk.executable.path" setting is set to the empty string (its default value)
67

78
## [0.80.0]

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,7 @@ Example using the dictionary format for multiple backends (assuming a POSIX syst
614614
"logtalk.executable.arguments": {
615615
"cx": [ "-q" ],
616616
"gnu": [ "--quiet" ],
617+
"gnunc": [ "--quiet" ],
617618
"sicstus": [ "--noinfo" ],
618619
"swi": [ "-q" ],
619620
"trealla": [ "-q" ],

media/settings.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ The Prolog backend you intend to use, specified using its identifier:
1717
* CxProlog: `cx`
1818
* ECLiPSe: `eclipse`
1919
* GNU Prolog: `gnu`
20+
* GNU Prolog (native code): `gnunc`
2021
* SICStus Prolog: `sicstus`
2122
* SWI-Prolog: `swi`
2223
* Tau Prolog: `tau`

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,6 +1071,7 @@
10711071
"cx",
10721072
"eclipse",
10731073
"gnu",
1074+
"gnunc",
10741075
"sicstus",
10751076
"swi",
10761077
"tau",

src/features/terminal.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,9 @@ export default class LogtalkTerminal {
358358
case "gnu":
359359
script = "gplgt"
360360
break;
361+
case "gnunc":
362+
script = "gplgtnc"
363+
break;
361364
case "ji":
362365
script = "jiplgt"
363366
break;
@@ -385,13 +388,15 @@ export default class LogtalkTerminal {
385388
default:
386389
vscode.window.showErrorMessage("Configuration error: unknown logtalk.backend setting value!");
387390
}
388-
if (process.platform === 'win32') {
391+
if (logtalkBackend === "gnunc") {
392+
executable = script;
393+
} else if (process.platform === 'win32') {
389394
executable = LogtalkTerminal.expandEnvironmentVariables("${env:ProgramFiles}/PowerShell/7/pwsh.exe");
390395
args = ["-file", LogtalkTerminal.expandEnvironmentVariables("${env:SystemRoot}/" + script + ".ps1")].concat(args);
391396
} else {
392397
executable = path.join(logtalkHome, path.join("integration", script + ".sh"));
393398
executable = path.resolve(executable).split(path.sep).join("/");
394-
}
399+
}
395400
}
396401

397402
LogtalkTerminal._terminal = (<any>window).createTerminal({

src/utils/utils.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ export class Utils {
110110
case "gnu":
111111
Utils.script = "gplgt"
112112
break;
113+
case "gnunc":
114+
Utils.script = "gplgtnc"
115+
break;
113116
case "ji":
114117
Utils.script = "jiplgt"
115118
break;
@@ -137,13 +140,15 @@ export class Utils {
137140
default:
138141
vscode.window.showErrorMessage("Configuration error: unknown logtalk.backend setting value!");
139142
}
140-
if (process.platform === 'win32') {
143+
if (Utils.backend === "gnunc") {
144+
Utils.RUNTIMEPATH = Utils.script;
145+
} else if (process.platform === 'win32') {
141146
Utils.RUNTIMEPATH = path.join(process.env.PROGRAMFILES, "/PowerShell/7/pwsh.exe");
142147
Utils.RUNTIMEARGS = ["-file", path.join(process.env.SystemRoot, Utils.script + ".ps1")].concat(Utils.RUNTIMEARGS);
143148
} else {
144149
Utils.RUNTIMEPATH = path.join(Utils.logtalkHome, path.join("integration", Utils.script + ".sh"));
145150
Utils.RUNTIMEPATH = path.resolve(Utils.RUNTIMEPATH).split(path.sep).join("/");
146-
}
151+
}
147152
}
148153

149154
Utils.logger.debug(`Runtime configuration updated: RUNTIMEPATH=${Utils.RUNTIMEPATH}, RUNTIMEARGS=${JSON.stringify(Utils.RUNTIMEARGS)}`);

0 commit comments

Comments
 (0)