|
@@ -347,6 +347,19 @@ begin
|
|
ConsumeToken(sc, weCloseBrace);
|
|
ConsumeToken(sc, weCloseBrace);
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+procedure ParseMemory(sc: TWatScanner; dst: TWasmMemory);
|
|
|
|
+begin
|
|
|
|
+ if sc.token=weMemory then sc.Next;
|
|
|
|
+
|
|
|
|
+ if sc.token in [weIdent, weNumber] then
|
|
|
|
+ ParseId(sc, dst.id);
|
|
|
|
+
|
|
|
|
+ // todo: parsing of ImportInfo
|
|
|
|
+ // todo: parsing of ExportInfo
|
|
|
|
+
|
|
|
|
+ ConsumeToken(sc, weCloseBrace);
|
|
|
|
+end;
|
|
|
|
+
|
|
procedure ParseExport(sc: TWatScanner; dst: TWasmExport);
|
|
procedure ParseExport(sc: TWatScanner; dst: TWasmExport);
|
|
begin
|
|
begin
|
|
if sc.token=weExport then
|
|
if sc.token=weExport then
|
|
@@ -433,6 +446,7 @@ var
|
|
symlist : TAsmSymList;
|
|
symlist : TAsmSymList;
|
|
f : TWasmFunc;
|
|
f : TWasmFunc;
|
|
imp : TWasmImport;
|
|
imp : TWasmImport;
|
|
|
|
+ m : TWasmMemory;
|
|
begin
|
|
begin
|
|
if not ConsumeOpenToken(sc, weModule) then
|
|
if not ConsumeOpenToken(sc, weModule) then
|
|
ErrorExpectButFound(sc, 'module');
|
|
ErrorExpectButFound(sc, 'module');
|
|
@@ -457,8 +471,16 @@ begin
|
|
weFunc: begin
|
|
weFunc: begin
|
|
f:=dst.AddFunc;
|
|
f:=dst.AddFunc;
|
|
symlist.ToLinkInfo(f.LinkInfo);
|
|
symlist.ToLinkInfo(f.LinkInfo);
|
|
|
|
+ symlist.Clear;
|
|
ParseFunc(sc, f);
|
|
ParseFunc(sc, f);
|
|
|
|
+ end;
|
|
|
|
+ weMemory:
|
|
|
|
+ begin
|
|
|
|
+ writeln('trying to parse memory');
|
|
|
|
+ m:=dst.AddMemory;
|
|
|
|
+ symlist.ToLinkInfo(f.LinkInfo);
|
|
symlist.Clear;
|
|
symlist.Clear;
|
|
|
|
+ ParseMemory(sc, m);
|
|
end;
|
|
end;
|
|
weExport:
|
|
weExport:
|
|
begin
|
|
begin
|