about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/bootstrap/tokenizer.src8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/bootstrap/tokenizer.src b/src/bootstrap/tokenizer.src
index 3716e79..814a377 100644
--- a/src/bootstrap/tokenizer.src
+++ b/src/bootstrap/tokenizer.src
@@ -17,6 +17,7 @@ let TOKEN_BREAK      = 7;
 let TOKEN_CONTINUE   = 8;
 let TOKEN_ARROW      = 9;
 let TOKEN_STRUCT     = 10;
+let TOKEN_TYPE       = 34;
 
 /* Identifiers */
 let TOKEN_IDENTIFIER = 11;
@@ -97,6 +98,9 @@ let print_tokens = (ts: *token, ts_len: i64) => i64 {
 		if (to.type == TOKEN_STRUCT) {
 			printf("Struct\n");
 		};
+		if (to.type == TOKEN_TYPE) {
+			printf("Type\n");
+		};
 		if (to.type == TOKEN_IDENTIFIER) {
 			printf("Identifier: %s\n", cast(*i8, to.data));
 		};
@@ -390,6 +394,10 @@ let tokenizer_next = (t: *tokenizer) => *token {
 	    (*to).type = TOKEN_STRUCT;
 	    return to;
 	};
+	if tokenizer_accept_string(t, "newtype") {
+	    (*to).type = TOKEN_TYPE;
+	    return to;
+	};
 
 	if tokenizer_accept_string(t, "=>") {
 	    (*to).type = TOKEN_ARROW;