From bd3093e176a44072994460744120d0b2cb96e6e1 Mon Sep 17 00:00:00 2001 From: Mattias Gaertner Date: Wed, 18 Nov 2020 15:56:13 +0000 Subject: [PATCH] pastojs: added experimental target os electron git-svn-id: trunk@47445 - --- packages/pastojs/src/fppas2js.pp | 6 ++++-- packages/pastojs/src/pas2jscompiler.pp | 2 ++ packages/pastojs/src/pas2jsfiler.pp | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/pastojs/src/fppas2js.pp b/packages/pastojs/src/fppas2js.pp index 06e3006613..955886864f 100644 --- a/packages/pastojs/src/fppas2js.pp +++ b/packages/pastojs/src/fppas2js.pp @@ -1053,13 +1053,15 @@ type type TPasToJsPlatform = ( PlatformBrowser, - PlatformNodeJS + PlatformNodeJS, + PlatformElectron ); TPasToJsPlatforms = set of TPasToJsPlatform; const PasToJsPlatformNames: array[TPasToJsPlatform] of string = ( 'Browser', - 'NodeJS' + 'NodeJS', + 'Electron' ); type TPasToJsProcessor = ( diff --git a/packages/pastojs/src/pas2jscompiler.pp b/packages/pastojs/src/pas2jscompiler.pp index 30173e5bae..8559dc71aa 100644 --- a/packages/pastojs/src/pas2jscompiler.pp +++ b/packages/pastojs/src/pas2jscompiler.pp @@ -4762,6 +4762,7 @@ begin w(' -T : Set target platform'); w(' -Tbrowser: default'); w(' -Tnodejs : add pas.run(), includes -Jc'); + w(' -Telectron: experimental'); w(' -u : Undefines the symbol '); w(' -v : Be verbose. is a combination of the following letters:'); w(' e : Show errors (default)'); @@ -4941,6 +4942,7 @@ begin Log.LogPlain('Supported targets (targets marked with ''{*}'' are under development):'); Log.LogPlain([' ',PasToJsPlatformNames[PlatformBrowser],': webbrowser']); Log.LogPlain([' ',PasToJsPlatformNames[PlatformNodeJS],': Node.js']); + Log.LogPlain([' ',PasToJsPlatformNames[PlatformElectron],': Electron app']); Log.LogLn; Log.LogPlain('Supported CPU instruction sets:'); Log.LogPlain(' ECMAScript5, ECMAScript6'); diff --git a/packages/pastojs/src/pas2jsfiler.pp b/packages/pastojs/src/pas2jsfiler.pp index a0253e8457..d2a43ec6b0 100644 --- a/packages/pastojs/src/pas2jsfiler.pp +++ b/packages/pastojs/src/pas2jsfiler.pp @@ -262,7 +262,8 @@ const PCUDefaultTargetPlatform = PlatformBrowser; PCUTargetPlatformNames: array[TPasToJsPlatform] of string = ( 'Browser', - 'NodeJS' + 'NodeJS', + 'Electron' ); PCUDefaultTargetProcessor = ProcessorECMAScript5; @@ -3970,6 +3971,7 @@ var Templ: TPasGenericTemplateType; TemplObj: TJSONObject; begin + if Parent=nil then ; if (GenericTemplateTypes=nil) or (GenericTemplateTypes.Count=0) then exit; Arr:=TJSONArray.Create; Obj.Add('GenericTemplateTypes',Arr);