From 2c007a8f94d65dc40f638b284db7e374a58b632f Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Thu, 8 Jul 2021 02:24:24 -0700 Subject: Chapter 14.1-6 --- clox/src/main.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 clox/src/main.c (limited to 'clox/src/main.c') diff --git a/clox/src/main.c b/clox/src/main.c new file mode 100644 index 0000000..9aeb8fd --- /dev/null +++ b/clox/src/main.c @@ -0,0 +1,18 @@ +#include "common.h" +#include "chunk.h" +#include "debug.h" + +int main(int argc, const char* argv[]) { + Chunk chunk; + initChunk(&chunk); + + int constant = addConstant(&chunk, 1.2); + writeChunk(&chunk, OP_CONSTANT, 123); + writeChunk(&chunk, constant, 123); + + writeChunk(&chunk, OP_RETURN, 123); + + disassembleChunk(&chunk, "test chunk"); + freeChunk(&chunk); + return 0; +} -- cgit v1.2.3-54-g00ecf