summaryrefslogtreecommitdiff
path: root/com.c
diff options
context:
space:
mode:
Diffstat (limited to 'com.c')
-rw-r--r--com.c4
1 files changed, 4 insertions, 0 deletions
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];