From 3c4abe6920253f63621a314890878b6037335a73 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 25 Jun 2023 15:47:47 +0100 Subject: Add WASM code gen for push-unit instruction --- src/main/java/org/shedlang/compiler/backends/wasm/WasmCodeGen.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/org/shedlang/compiler/backends/wasm/WasmCodeGen.java b/src/main/java/org/shedlang/compiler/backends/wasm/WasmCodeGen.java index 443393d1..e71d1f15 100644 --- a/src/main/java/org/shedlang/compiler/backends/wasm/WasmCodeGen.java +++ b/src/main/java/org/shedlang/compiler/backends/wasm/WasmCodeGen.java @@ -36,9 +36,9 @@ public class WasmCodeGen { case PushStringInstruction pushStringInstruction -> { throw new UnsupportedOperationException("TODO"); } - case PushUnitInstruction pushUnitInstruction -> { - throw new UnsupportedOperationException("TODO"); - } + case PushUnitInstruction pushUnit -> + context.addInstruction(new WasmI32Const(0)); + case ReturnInstruction returnInstruction -> { throw new UnsupportedOperationException("TODO"); } -- cgit v1.2.3