diff options
author | 2021-08-02 18:09:03 -0700 | |
---|---|---|
committer | 2021-08-02 18:09:03 -0700 | |
commit | b131e343bb8a2b126a5370138d826d87d74fce30 (patch) | |
tree | 06cd5d22c8eeac088e5393199357c4e8d34eb8f6 /clox/src/vm.c | |
parent | 9b60cf334cdb030759c54f700d5c122338c5b3a8 (diff) | |
download | crafting-interpreters-b131e343bb8a2b126a5370138d826d87d74fce30.tar.gz crafting-interpreters-b131e343bb8a2b126a5370138d826d87d74fce30.zip |
Chapter 16.1
Diffstat (limited to 'clox/src/vm.c')
-rw-r--r-- | clox/src/vm.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/clox/src/vm.c b/clox/src/vm.c index a775acb..d9e5248 100644 --- a/clox/src/vm.c +++ b/clox/src/vm.c @@ -1,6 +1,7 @@ #include <stdio.h> #include "common.h" +#include "compiler.h" #include "debug.h" #include "vm.h" @@ -79,8 +80,7 @@ static InterpretResult run() { #undef BINARY_OP } -InterpretResult interpret(Chunk *chunk) { - vm.chunk = chunk; - vm.ip = vm.chunk->code; - return run(); +InterpretResult interpret(const char *source) { + compile(source); + return INTERPRET_OK; } |