From ab6deb5eb1244f566c8a8b22022c68d50d5eb4d7 Mon Sep 17 00:00:00 2001 From: Ben Winston Date: Mon, 22 May 2023 20:26:27 -0400 Subject: make the REPL actually remember things --- compiler.d | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'compiler.d') diff --git a/compiler.d b/compiler.d index 76f6c04..4b7775e 100644 --- a/compiler.d +++ b/compiler.d @@ -50,12 +50,9 @@ class Compiler { } void compileAdd(Form[] args) { - writeln("compiling add"); int line = args[0].line; resolve(args[0]); - writeln("resolved the first argument"); func.chunk.writeOp(OpCode.OP_TYPE_CHECK_NUMBER, line); - writeln("wrote the typecheck op"); // (+ n) always returns n if (args.length == 1) { @@ -208,7 +205,6 @@ class Compiler { } void compileIf(Form form) { - writeln("compiling if..."); If if_ = cast(If)form; resolve(if_.cond); @@ -281,9 +277,7 @@ class Compiler { Block block = cast(Block)form; beginScope(); foreach (Form inner; block.blockBody) { - writeln("about to compile an inner form"); resolve(inner); - writeln("finished compiling inner form"); } endScope(); } @@ -314,7 +308,6 @@ class Compiler { } void compileFunc(Form form) { - writeln("compiling func"); Func f = cast(Func)form; // name the function @@ -335,8 +328,6 @@ class Compiler { } } - writeln("got the arguments"); - /* // compile each inner Form foreach (Form inner; f.funcBody) { @@ -350,8 +341,6 @@ class Compiler { b.blockBody = f.funcBody; compiler.compileBlock(b); - writeln("compiled the body"); - // write the function as a Value Function outFunc = compiler.finish(); func.chunk.writeOp(OpCode.OP_CONSTANT, f.line); -- cgit v1.2.3