Browse Source

[PATCH 127/188] updating parsing of multiple parameters

From 4c3f1e9b8facadaca9aff02e64679f94f3ff4ecc Mon Sep 17 00:00:00 2001
From: Dmitry Boyarintsev <[email protected]>
Date: Mon, 23 Mar 2020 16:39:54 -0400

git-svn-id: branches/wasm@46123 -
nickysn 5 years ago
parent
commit
6419413641
1 changed files with 15 additions and 1 deletions
  1. 15 1
      utils/wasmbin/watparser.pas

+ 15 - 1
utils/wasmbin/watparser.pas

@@ -216,7 +216,21 @@ begin
   while tk = weParam do begin
   while tk = weParam do begin
     p:=dst.AddParam;
     p:=dst.AddParam;
     sc.Next;
     sc.Next;
-    ParseParam(sc, p.id, p.tp);
+
+    ParseParam(sc, p.id, p.tp, true, false);
+
+    // Text format specification:
+    // Abbreviations
+    // Multiple anonymous parameters or results may be combined into a single declaration
+    if (p.id = '') and (sc.token in [wei32, wei64, wef32, wef64]) then begin
+      while (sc.token in [wei32, wei64, wef32, wef64]) do begin
+        p:=dst.AddParam;
+        TokenTypeToValType(sc.token, p.tp);
+        sc.Next;
+      end;
+    end;
+    ConsumeToken(sc, weCloseBrace);
+
     ConsumeAnyOpenToken(sc, tk);
     ConsumeAnyOpenToken(sc, tk);
   end;
   end;