From 03b4987afc5e32ec560fac6f74c153d592f75259 Mon Sep 17 00:00:00 2001 From: Ben Winston Date: Sun, 21 May 2023 23:50:04 -0400 Subject: functionsgit add *.d! --- chunk.d | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'chunk.d') diff --git a/chunk.d b/chunk.d index c512f14..96e4f76 100644 --- a/chunk.d +++ b/chunk.d @@ -19,11 +19,11 @@ class Function : Obj { string name; ObjType type; - this(ObjType type) { + this(ObjType type, string name = "") { this.type = type; this.chunk = new Chunk(); this.arity = 0; - this.name = ""; + this.name = name; } override string toString() { @@ -56,6 +56,8 @@ enum OpCode { OP_JUMP, OP_JUMP_IF_FALSE, OP_JUMP_IF_TRUE, + + OP_CALL, } class Chunk { -- cgit v1.2.3