From d6ce4e22ad9b98ab06812506f5bec2d4226ee7d2 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Fri, 21 Jun 2024 16:23:03 +0100 Subject: mandelbrot --- com.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'com.c') diff --git a/com.c b/com.c index 6ffd7c2..45b1f80 100644 --- a/com.c +++ b/com.c @@ -57,6 +57,10 @@ static void compile_node(State *S, Chunk *ch, AstNode a) { CK(l.len == 2, "puts requires exactly 1 argument"); compile_node(S, ch, l.vals[1]); chunk_wbc(S, ch, OP_PUTS); + } else if (0 == strcmp(name, "print")) { + CK(l.len == 2, "print requires exactly 1 argument"); + compile_node(S, ch, l.vals[1]); + chunk_wbc(S, ch, OP_PRINT); } else if (0 == strcmp(name, "set")) { CK(l.len == 3, "set requires exactly 2 arguments"); AstNode ident = l.vals[1]; -- cgit v1.2.3