Browse Source

[PATCH 097/188] update parsing of number of idx

From 39d30d8e1632762592a1d9543a3283926dc6ca4b Mon Sep 17 00:00:00 2001
From: Dmitry Boyarintsev <[email protected]>
Date: Mon, 16 Mar 2020 16:43:00 -0400

git-svn-id: branches/wasm@46093 -
nickysn 5 years ago
parent
commit
4bd93b31db
1 changed files with 3 additions and 9 deletions
  1. 3 9
      utils/wasmbin/watparser.pas

+ 3 - 9
utils/wasmbin/watparser.pas

@@ -133,12 +133,6 @@ function ParseNumOfId(sc: TWatScanner; out num: integer; out id: string): Boolea
 begin
 begin
   num:=-1;
   num:=-1;
   id:='';
   id:='';
-  Result := sc.Next;
-  if not Result then begin
-    ErrorUnexpectedEof(sc);
-    Exit;
-  end;
-
   case sc.token of
   case sc.token of
     weNumber: num:=sc.resInt32;
     weNumber: num:=sc.resInt32;
     weIdent: id:=sc.resText;
     weIdent: id:=sc.resText;
@@ -205,10 +199,10 @@ var
 begin
 begin
   tk := sc.token;
   tk := sc.token;
   if tk = weType then begin
   if tk = weType then begin
-    if not ParseNumOfId(sc, nm, id) then begin
-      writeln('failed type');
+    sc.Next;
+    if not ParseNumOfId(sc, nm, id) then
       Exit;
       Exit;
-    end;
+
     if nm>=0 then dst.typeNum:=nm
     if nm>=0 then dst.typeNum:=nm
     else dst.typeIdx:=id;
     else dst.typeIdx:=id;
     ConsumeAnyOpenToken(sc, tk);
     ConsumeAnyOpenToken(sc, tk);