From b44683eb40df4920e51d927088823d29d44faee6 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 25 Jun 2023 15:46:25 +0100 Subject: Add WASM code gen for push-int 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 b6e2a09f..443393d1 100644 --- a/src/main/java/org/shedlang/compiler/backends/wasm/WasmCodeGen.java +++ b/src/main/java/org/shedlang/compiler/backends/wasm/WasmCodeGen.java @@ -30,9 +30,9 @@ public class WasmCodeGen { case PushBoolInstruction pushBool -> context.addInstruction(new WasmI32Const(pushBool.value() ? 1 : 0)); - case PushIntInstruction pushIntInstruction -> { - throw new UnsupportedOperationException("TODO"); - } + case PushIntInstruction pushInt -> + context.addInstruction(new WasmI32Const(pushInt.value().intValueExact())); + case PushStringInstruction pushStringInstruction -> { throw new UnsupportedOperationException("TODO"); } -- cgit v1.2.3