Browse Source

+ dummy implementation of the code generator for the try..except node for WebAssembly

git-svn-id: branches/wasm@48216 -
nickysn 4 years ago
parent
commit
7a15157387
1 changed files with 25 additions and 0 deletions
  1. 25 0
      compiler/wasm32/nwasmflw.pas

+ 25 - 0
compiler/wasm32/nwasmflw.pas

@@ -49,6 +49,13 @@ interface
         procedure pass_generate_code;override;
       end;
 
+      { twasmtryexceptnode }
+
+      twasmtryexceptnode = class(tcgtryexceptnode)
+      public
+        procedure pass_generate_code;override;
+      end;
+
       { twasmtryfinallynode }
 
       twasmtryfinallynode = class(tcgtryfinallynode)
@@ -196,6 +203,23 @@ implementation
         flowcontrol := oldflowcontrol + (flowcontrol - [fc_inflowcontrol]);
       end;
 
+{*****************************************************************************
+                             twasmtryexceptnode
+*****************************************************************************}
+
+    procedure twasmtryexceptnode.pass_generate_code;
+      begin
+        location_reset(location,LOC_VOID,OS_NO);
+
+        current_asmdata.CurrAsmList.concat(tai_comment.Create(strpnew('TODO: try..except, try')));
+
+        secondpass(left);
+        //if codegenerror then
+        //  goto errorexit;
+
+        current_asmdata.CurrAsmList.concat(tai_comment.Create(strpnew('TODO: try..except, end')));
+      end;
+
 {*****************************************************************************
                              twasmtryfinallynode
 *****************************************************************************}
@@ -234,5 +258,6 @@ implementation
 initialization
   cifnode:=twasmifnode;
   cwhilerepeatnode:=twasmwhilerepeatnode;
+  ctryexceptnode:=twasmtryexceptnode;
   ctryfinallynode:=twasmtryfinallynode;
 end.