pastojs: added experimental target os electron

git-svn-id: trunk@47445 -
This commit is contained in:
Mattias Gaertner 2020-11-18 15:56:13 +00:00
parent f5acaf10ee
commit bd3093e176
3 changed files with 9 additions and 3 deletions

View File

@ -1053,13 +1053,15 @@ type
type type
TPasToJsPlatform = ( TPasToJsPlatform = (
PlatformBrowser, PlatformBrowser,
PlatformNodeJS PlatformNodeJS,
PlatformElectron
); );
TPasToJsPlatforms = set of TPasToJsPlatform; TPasToJsPlatforms = set of TPasToJsPlatform;
const const
PasToJsPlatformNames: array[TPasToJsPlatform] of string = ( PasToJsPlatformNames: array[TPasToJsPlatform] of string = (
'Browser', 'Browser',
'NodeJS' 'NodeJS',
'Electron'
); );
type type
TPasToJsProcessor = ( TPasToJsProcessor = (

View File

@ -4762,6 +4762,7 @@ begin
w(' -T<x> : Set target platform'); w(' -T<x> : Set target platform');
w(' -Tbrowser: default'); w(' -Tbrowser: default');
w(' -Tnodejs : add pas.run(), includes -Jc'); w(' -Tnodejs : add pas.run(), includes -Jc');
w(' -Telectron: experimental');
w(' -u<x> : Undefines the symbol <x>'); w(' -u<x> : Undefines the symbol <x>');
w(' -v<x> : Be verbose. <x> is a combination of the following letters:'); w(' -v<x> : Be verbose. <x> is a combination of the following letters:');
w(' e : Show errors (default)'); w(' e : Show errors (default)');
@ -4941,6 +4942,7 @@ begin
Log.LogPlain('Supported targets (targets marked with ''{*}'' are under development):'); Log.LogPlain('Supported targets (targets marked with ''{*}'' are under development):');
Log.LogPlain([' ',PasToJsPlatformNames[PlatformBrowser],': webbrowser']); Log.LogPlain([' ',PasToJsPlatformNames[PlatformBrowser],': webbrowser']);
Log.LogPlain([' ',PasToJsPlatformNames[PlatformNodeJS],': Node.js']); Log.LogPlain([' ',PasToJsPlatformNames[PlatformNodeJS],': Node.js']);
Log.LogPlain([' ',PasToJsPlatformNames[PlatformElectron],': Electron app']);
Log.LogLn; Log.LogLn;
Log.LogPlain('Supported CPU instruction sets:'); Log.LogPlain('Supported CPU instruction sets:');
Log.LogPlain(' ECMAScript5, ECMAScript6'); Log.LogPlain(' ECMAScript5, ECMAScript6');

View File

@ -262,7 +262,8 @@ const
PCUDefaultTargetPlatform = PlatformBrowser; PCUDefaultTargetPlatform = PlatformBrowser;
PCUTargetPlatformNames: array[TPasToJsPlatform] of string = ( PCUTargetPlatformNames: array[TPasToJsPlatform] of string = (
'Browser', 'Browser',
'NodeJS' 'NodeJS',
'Electron'
); );
PCUDefaultTargetProcessor = ProcessorECMAScript5; PCUDefaultTargetProcessor = ProcessorECMAScript5;
@ -3970,6 +3971,7 @@ var
Templ: TPasGenericTemplateType; Templ: TPasGenericTemplateType;
TemplObj: TJSONObject; TemplObj: TJSONObject;
begin begin
if Parent=nil then ;
if (GenericTemplateTypes=nil) or (GenericTemplateTypes.Count=0) then exit; if (GenericTemplateTypes=nil) or (GenericTemplateTypes.Count=0) then exit;
Arr:=TJSONArray.Create; Arr:=TJSONArray.Create;
Obj.Add('GenericTemplateTypes',Arr); Obj.Add('GenericTemplateTypes',Arr);