aboutsummaryrefslogtreecommitdiff
path: root/vm.d
diff options
context:
space:
mode:
authorBen Winston2023-05-22 20:26:27 -0400
committerBen Winston2023-05-22 20:26:27 -0400
commitab6deb5eb1244f566c8a8b22022c68d50d5eb4d7 (patch)
tree58295e80efb472836e8c226f10e00ffd16468b68 /vm.d
parentb7fba62e9f1f9f7a5a67fd64d4aed55646d1b58e (diff)
make the REPL actually remember things
Diffstat (limited to 'vm.d')
-rw-r--r--vm.d4
1 files changed, 1 insertions, 3 deletions
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));