From ab6deb5eb1244f566c8a8b22022c68d50d5eb4d7 Mon Sep 17 00:00:00 2001 From: Ben Winston Date: Mon, 22 May 2023 20:26:27 -0400 Subject: make the REPL actually remember things --- vm.d | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'vm.d') diff --git a/vm.d b/vm.d index 5b69a23..ea6a1ae 100644 --- a/vm.d +++ b/vm.d @@ -457,13 +457,11 @@ class VM { } } -InterpretResult interpret(string source) { +InterpretResult interpret(string source, VM vm) { Parser parser = new Parser(source); Compiler compiler = new Compiler(ObjType.SCRIPT, &parser); Function func = compiler.compile(); - VM vm = new VM(); - // vm.globals[":int"] = makeTypeValue(":int"); vm.pushA(makeObjValue(func)); -- cgit v1.2.3