about summary refs log tree commit diff
path: root/boot/lex.c
diff options
context:
space:
mode:
authorMel <mel@rnrd.eu>2025-06-24 20:31:13 +0200
committerMel <mel@rnrd.eu>2025-06-24 20:31:13 +0200
commit3d983097329607cc89b63425e97527c5ec0390c8 (patch)
treec1d50be52948ce26ac6134843093c0d4bec60f64 /boot/lex.c
parent7b3117e92393f1d62991f55aa4ee8178e358689a (diff)
downloadcatskill-3d983097329607cc89b63425e97527c5ec0390c8.tar.zst
catskill-3d983097329607cc89b63425e97527c5ec0390c8.zip
Parse Maybe (?) type
Signed-off-by: Mel <mel@rnrd.eu>
Diffstat (limited to 'boot/lex.c')
-rw-r--r--boot/lex.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/boot/lex.c b/boot/lex.c
index 30ccd85..f210abd 100644
--- a/boot/lex.c
+++ b/boot/lex.c
@@ -116,6 +116,7 @@ enum Token_Kind
     TOKEN_DOT,
     TOKEN_DOT_DOT,
     TOKEN_BANG,
+    TOKEN_QUESTION,
     TOKEN_PERCENT,
     TOKEN_PIPE,
     TOKEN_TILDE,
@@ -237,6 +238,8 @@ token_kind_to_string(enum Token_Kind kind)
         return "DOT_DOT";
     case TOKEN_BANG:
         return "BANG";
+    case TOKEN_QUESTION:
+        return "QUESTION";
     case TOKEN_PERCENT:
         return "PERCENT";
     case TOKEN_PIPE:
@@ -616,6 +619,8 @@ lexer_symbol_token(struct Lexer* l, struct Lexer_Char current)
         if (a.got_match) RET{ TOKEN_NOT_EQUAL, 2 };
         RET{ TOKEN_BANG, 1 };
     }
+    case '?':
+        RET{ TOKEN_QUESTION, 1 };
     case '%': {
         a = lexer_match_char(l, '=');
         if (a.got_match) RET{ TOKEN_ASSIGN_PERCENT, 2 };