[PATCH 177/188] update parsing of module level elements

From ee529729a987fda74c312a4e49e8246f127920ce Mon Sep 17 00:00:00 2001
From: Dmitry Boyarintsev <skalogryz.lists@gmail.com>
Date: Wed, 8 Apr 2020 11:58:48 -0400

git-svn-id: branches/wasm@46173 -
This commit is contained in:
nickysn 2020-08-03 13:02:08 +00:00
parent 2168969b3f
commit cdc7401d91

View File

@ -593,13 +593,9 @@ begin
if sc.token = weElem then sc.Next;
if parseIdOffset then begin
if sc.token<>weIdent then
ErrorExpectButFound(sc, 'identifier');
dst.tableIdx := sc.resInt32;
sc.Next;
ParseId(sc, dst.tableId);
if (sc.token = weOpenBrace) then begin
sc.Next;
ParseInstrList(sc, dst.AddOffset);
ConsumeToken(sc, weCloseBrace);
end;
@ -679,6 +675,7 @@ var
imp : TWasmImport;
m : TWasmMemory;
g : TWasmGlobal;
e : TWasmElement;
begin
if not ConsumeOpenToken(sc, weModule) then
ErrorExpectButFound(sc, 'module');
@ -732,6 +729,11 @@ begin
symlist.Clear;
ParseGlobal(sc, g);
end;
weElem: begin
e:=dst.AddElement;
symlist.Clear;
ParseElem(sc, e, true);
end;
else
ErrorExpectButFound(sc, 'func', TokenStr[sc.token]);
end;