about summary refs log tree commit diff
path: root/boot/lex.c
diff options
context:
space:
mode:
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 };