mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-22 06:49:27 +02:00
[PATCH 011/188] updating wasm tool
From 4d7dd3df4d47130a435e7d9f9b3ff97b7d0f0020 Mon Sep 17 00:00:00 2001 From: Dmitry Boyarintsev <skalogryz.lists@gmail.com> Date: Thu, 26 Sep 2019 09:37:52 -0400 git-svn-id: branches/wasm@46007 -
This commit is contained in:
parent
d4f8da8112
commit
24acc96458
@ -20,20 +20,77 @@ begin
|
||||
writeln(' --symbolflag @inputfile');
|
||||
end;
|
||||
|
||||
type
|
||||
|
||||
{ TToolActions }
|
||||
|
||||
TToolActions = class(TObject)
|
||||
action : string; // action to take place
|
||||
inputFn : string; // input file name
|
||||
constructor Create(const aaction, afilename: string);
|
||||
end;
|
||||
|
||||
procedure ProcessParams(acts: TList; const inputFn: string);
|
||||
begin
|
||||
|
||||
end;
|
||||
|
||||
var
|
||||
symfn : string;
|
||||
acts: TList = nil;
|
||||
inputFn: string = '';
|
||||
|
||||
procedure ParseParams;
|
||||
var
|
||||
i : integer;
|
||||
s : string;
|
||||
ls : string;
|
||||
fn : string;
|
||||
begin
|
||||
i:=1;
|
||||
while i<=ParamCount do begin
|
||||
s := ParamStr(i);
|
||||
ls := AnsiLowerCase(s);
|
||||
inc(i);
|
||||
if Pos('--',ls)=1 then begin
|
||||
inc(i);
|
||||
if i<=ParamCount then
|
||||
fn:=ParamStr(i)
|
||||
else
|
||||
fn := '';
|
||||
if fn <> '' then
|
||||
acts.Add( TToolActions.Create(ls, fn));
|
||||
end else begin
|
||||
if inputFn ='' then
|
||||
inputFn:=s;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
{ TToolActions }
|
||||
|
||||
constructor TToolActions.Create(const aaction, afilename: string);
|
||||
begin
|
||||
action := aaction;
|
||||
inputFn := afilename;
|
||||
end;
|
||||
|
||||
var
|
||||
i : integer;
|
||||
begin
|
||||
if ParamCount=0 then begin
|
||||
PrintHelp;
|
||||
|
||||
exit;
|
||||
Exit;
|
||||
end;
|
||||
symfn:='';
|
||||
if ParamCount>1 then symfn:=ParamStr(2);
|
||||
|
||||
//ReadWasmFile(ParamStr(1));
|
||||
//ProcessWasmFile(ParamStr(1), symfn);
|
||||
ProcessWasmSection(ParamStr(1), symfn);
|
||||
ParseParams;
|
||||
acts := TList.Create;
|
||||
try
|
||||
ParseParams;
|
||||
ProcessParams(acts, inputFn);
|
||||
finally
|
||||
for i:=0 to acts.Count-1 do
|
||||
TObject(acts[i]).Free;
|
||||
acts.Free;
|
||||
end;
|
||||
end.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user