|
@@ -64,7 +64,7 @@ Unit rawasmtext;
|
|
|
procedure HandleInstruction;
|
|
|
procedure HandleFoldedInstruction;
|
|
|
function HandlePlainInstruction: TWasmInstruction;
|
|
|
- procedure HandleBlockInstruction;virtual;abstract;
|
|
|
+ procedure HandleBlockInstruction;
|
|
|
public
|
|
|
function Assemble: tlinkedlist;override;
|
|
|
end;
|
|
@@ -908,6 +908,29 @@ Unit rawasmtext;
|
|
|
end;
|
|
|
|
|
|
|
|
|
+ procedure twasmreader.HandleBlockInstruction;
|
|
|
+ var
|
|
|
+ instr: TWasmInstruction;
|
|
|
+ begin
|
|
|
+ if actasmtoken<>AS_OPCODE then
|
|
|
+ internalerror(2024071601);
|
|
|
+ case actopcode of
|
|
|
+ a_if,
|
|
|
+ a_block,
|
|
|
+ a_loop:
|
|
|
+ begin
|
|
|
+ instr:=TWasmInstruction.create(TWasmOperand);
|
|
|
+ instr.opcode:=actopcode;
|
|
|
+ Consume(AS_OPCODE);
|
|
|
+ {TODO: implement the rest}
|
|
|
+ internalerror(2024071699);
|
|
|
+ end;
|
|
|
+ else
|
|
|
+ internalerror(2024071602);
|
|
|
+ end;
|
|
|
+ end;
|
|
|
+
|
|
|
+
|
|
|
function twasmreader.Assemble: tlinkedlist;
|
|
|
begin
|
|
|
Message1(asmr_d_start_reading,'WebAssembly');
|