aboutsummaryrefslogtreecommitdiffstats
path: root/clox/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'clox/src/main.c')
-rw-r--r--clox/src/main.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/clox/src/main.c b/clox/src/main.c
index d2cb6bd..d1e747f 100644
--- a/clox/src/main.c
+++ b/clox/src/main.c
@@ -12,6 +12,18 @@ int main(int argc, const char *argv[]) {
int constant = addConstant(&chunk, 1.2);
writeChunk(&chunk, OP_CONSTANT, 123);
writeChunk(&chunk, constant, 123);
+
+ constant = addConstant(&chunk, 3.4);
+ writeChunk(&chunk, OP_CONSTANT, 123);
+ writeChunk(&chunk, constant, 123);
+
+ writeChunk(&chunk, OP_ADD, 123);
+
+ constant = addConstant(&chunk, 5.6);
+ writeChunk(&chunk, OP_CONSTANT, 123);
+ writeChunk(&chunk, constant, 123);
+
+ writeChunk(&chunk, OP_DIVIDE, 123);
writeChunk(&chunk, OP_NEGATE, 123);
writeChunk(&chunk, OP_RETURN, 123);