|
@@ -130,6 +130,19 @@ type
|
|
function AddFunc: TWasmFunc;
|
|
function AddFunc: TWasmFunc;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+ { TWasmId }
|
|
|
|
+
|
|
|
|
+ TWasmId = record
|
|
|
|
+ idNum : integer;
|
|
|
|
+ id : string;
|
|
|
|
+ end;
|
|
|
|
+
|
|
|
|
+ { TWasmTable }
|
|
|
|
+
|
|
|
|
+ TWasmTable = class(TObject)
|
|
|
|
+ id : TWasmId;
|
|
|
|
+ end;
|
|
|
|
+
|
|
{ TWasmModule }
|
|
{ TWasmModule }
|
|
|
|
|
|
TWasmModule = class(TObject)
|
|
TWasmModule = class(TObject)
|
|
@@ -138,10 +151,15 @@ type
|
|
types : TList;
|
|
types : TList;
|
|
funcs : TList;
|
|
funcs : TList;
|
|
exp : TList;
|
|
exp : TList;
|
|
|
|
+ tables : TList;
|
|
public
|
|
public
|
|
constructor Create;
|
|
constructor Create;
|
|
destructor Destroy; override;
|
|
destructor Destroy; override;
|
|
|
|
|
|
|
|
+ function AddTable: TWasmTable;
|
|
|
|
+ function GetTable(i: integer): TWasmTable;
|
|
|
|
+ function TableCount: Integer;
|
|
|
|
+
|
|
function AddImport: TWasmImport;
|
|
function AddImport: TWasmImport;
|
|
function GetImport(i: integer): TWasmImport;
|
|
function GetImport(i: integer): TWasmImport;
|
|
function ImportCount: Integer;
|
|
function ImportCount: Integer;
|
|
@@ -401,10 +419,13 @@ begin
|
|
funcs := TList.Create;
|
|
funcs := TList.Create;
|
|
exp := TList.Create;
|
|
exp := TList.Create;
|
|
imports := TList.Create;
|
|
imports := TList.Create;
|
|
|
|
+ tables := TList.Create;
|
|
end;
|
|
end;
|
|
|
|
|
|
destructor TWasmModule.Destroy;
|
|
destructor TWasmModule.Destroy;
|
|
begin
|
|
begin
|
|
|
|
+ ClearList(tables);
|
|
|
|
+ tables.Free;
|
|
ClearList(imports);
|
|
ClearList(imports);
|
|
imports.Free;
|
|
imports.Free;
|
|
ClearList(exp);
|
|
ClearList(exp);
|
|
@@ -416,6 +437,25 @@ begin
|
|
inherited Destroy;
|
|
inherited Destroy;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+function TWasmModule.AddTable: TWasmTable;
|
|
|
|
+begin
|
|
|
|
+ Result:=TWasmTable.Create;
|
|
|
|
+ tables.Add(Result);
|
|
|
|
+end;
|
|
|
|
+
|
|
|
|
+function TWasmModule.GetTable(i: integer): TWasmTable;
|
|
|
|
+begin
|
|
|
|
+ if (i>=0) and (i<tables.Count) then
|
|
|
|
+ Result:=TWasmTable(tables[i])
|
|
|
|
+ else
|
|
|
|
+ Result:=nil;
|
|
|
|
+end;
|
|
|
|
+
|
|
|
|
+function TWasmModule.TableCount: Integer;
|
|
|
|
+begin
|
|
|
|
+ Result:=tables.Count;
|
|
|
|
+end;
|
|
|
|
+
|
|
function TWasmModule.AddImport: TWasmImport;
|
|
function TWasmModule.AddImport: TWasmImport;
|
|
begin
|
|
begin
|
|
Result:=TWasmImport.Create;
|
|
Result:=TWasmImport.Create;
|