about summary refs log tree commit diff
path: root/boot/lex.c
diff options
context:
space:
mode:
authorMel <mel@rnrd.eu>2026-05-28 00:29:53 +0200
committerMel <mel@rnrd.eu>2026-05-28 00:29:53 +0200
commit7db79f43b431b94d525308699a87a3daeff31d92 (patch)
tree7b6a6d10dc064c5ae54791dc1b65c8d42233b97a /boot/lex.c
parentec2029cba68b1d25e1e1119d37318c1b0c581a83 (diff)
downloadcatskill-7db79f43b431b94d525308699a87a3daeff31d92.tar.zst
catskill-7db79f43b431b94d525308699a87a3daeff31d92.zip
Split endless and while loops into `loop` and `while`
Signed-off-by: Mel <mel@rnrd.eu>
Diffstat (limited to 'boot/lex.c')
-rw-r--r--boot/lex.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/boot/lex.c b/boot/lex.c
index 18f8690..e585e1a 100644
--- a/boot/lex.c
+++ b/boot/lex.c
@@ -31,6 +31,7 @@ enum Token_Kind
     TOKEN_WORD_ELSE,
     TOKEN_WORD_FOR,
     TOKEN_WORD_WHILE,
+    TOKEN_WORD_LOOP,
     TOKEN_WORD_BREAK,
     TOKEN_WORD_CONTINUE,
     TOKEN_WORD_DEFER,
@@ -133,6 +134,8 @@ token_kind_to_string(enum Token_Kind kind)
         return "WORD_FOR";
     case TOKEN_WORD_WHILE:
         return "WORD_WHILE";
+    case TOKEN_WORD_LOOP:
+        return "WORD_LOOP";
     case TOKEN_WORD_BREAK:
         return "WORD_BREAK";
     case TOKEN_WORD_CONTINUE:
@@ -766,8 +769,10 @@ lexer_word_from_name(struct Lexer* l, struct String word_or_name)
         return TOKEN_WORD_ELSE;
     case 2652874405: // "for"
         return TOKEN_WORD_FOR;
-    case 1327426133: // "loop"
+    case 1327426133: // "while"
         return TOKEN_WORD_WHILE;
+    case 1637870694: // "loop"
+        return TOKEN_WORD_LOOP;
     case 1007193266: // "break"
         return TOKEN_WORD_BREAK;
     case 1827824793: // "continue"