summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--uscript/lex.c2
-rw-r--r--uscript/lex.h1
-rw-r--r--uscript/parser.c7
-rw-r--r--uscript/us_debug.c1
-rw-r--r--uscript/vm.c6
-rw-r--r--uscript/xbytecode.h1
6 files changed, 0 insertions, 18 deletions
diff --git a/uscript/lex.c b/uscript/lex.c
index cc41b2a..b89537d 100644
--- a/uscript/lex.c
+++ b/uscript/lex.c
@@ -201,8 +201,6 @@ struct token ident_token(struct lexer *lex)
kind = TOKEN_END;
else if (match_kw(lex, "global"))
kind = TOKEN_GLOBAL;
- else if (match_kw(lex, "print"))
- kind = TOKEN_PRINT;
return create_token(lex, kind);
}
diff --git a/uscript/lex.h b/uscript/lex.h
index 119b867..191997d 100644
--- a/uscript/lex.h
+++ b/uscript/lex.h
@@ -5,7 +5,6 @@
#include "val.h"
#define XTOKENS(_) \
- _(PRINT) \
_(BREAK) \
_(DIV_EQL) \
_(DO) \
diff --git a/uscript/parser.c b/uscript/parser.c
index 89a8883..043249e 100644
--- a/uscript/parser.c
+++ b/uscript/parser.c
@@ -886,13 +886,6 @@ void stat(struct parser *p)
} else if (consume(p, TOKEN_RET)) {
ret_stat(p);
consume(p, ';');
- } else if (consume(p, TOKEN_PRINT)) {
- // temp. only til functions get functioning
- expect(p, '(', "expected '('");
- expr(p);
- expect(p, ')', "expected ')'");
- parser_add_byte(p, BC_PRINT);
- consume(p, ';');
} else {
expr_stat(p);
}
diff --git a/uscript/us_debug.c b/uscript/us_debug.c
index 6b981a4..18be587 100644
--- a/uscript/us_debug.c
+++ b/uscript/us_debug.c
@@ -98,7 +98,6 @@ int print_instruction(struct us_proto *proto, int idx)
case BC_EQL:
case BC_NEQL:
case BC_CONCAT:
- case BC_PRINT:
case BC_RET:
putc('\n', stderr);
return idx + 1;
diff --git a/uscript/vm.c b/uscript/vm.c
index c01bb0f..26fccbe 100644
--- a/uscript/vm.c
+++ b/uscript/vm.c
@@ -382,12 +382,6 @@ void us_exec(struct us_func *func)
case BC_LOOP:
i -= read_short(func->proto, &i);
break;
- case BC_PRINT: {
- char *str = val_to_str(vm_pop(), NULL);
- olog(str);
- mem_free(str);
- break;
- }
case BC_CALL: {
int argc = read_byte();
struct us_val callee = vm.stacktop[-argc - 1];
diff --git a/uscript/xbytecode.h b/uscript/xbytecode.h
index 95f1440..34f7f43 100644
--- a/uscript/xbytecode.h
+++ b/uscript/xbytecode.h
@@ -32,6 +32,5 @@ BC(CONCAT)
BC(JMP)
BC(FALSEY_JMP)
BC(LOOP)
-BC(PRINT)
BC(CALL)
BC(RET)