extended single char tokens

This commit is contained in:
Karma Riuk
2025-06-30 00:27:30 +02:00
parent dec93f8272
commit 5cc7147909
3 changed files with 102 additions and 1 deletions

View File

@@ -17,6 +17,18 @@ namespace lexer {
return {token::type::ASSIGN, c};
case '+':
return {token::type::PLUS, c};
case '-':
return {token::type::MINUS, c};
case '!':
return {token::type::BANG, c};
case '*':
return {token::type::ASTERISK, c};
case '/':
return {token::type::SLASH, c};
case '<':
return {token::type::LT, c};
case '>':
return {token::type::GT, c};
case ',':
return {token::type::COMMA, c};
case ';':

View File

@@ -12,6 +12,12 @@ namespace token {
X(INT, "INT") \
X(ASSIGN, "=") \
X(PLUS, "+") \
X(MINUS, "-") \
X(BANG, "!") \
X(ASTERISK, "*") \
X(SLASH, "/") \
X(LT, "<") \
X(GT, ">") \
X(COMMA, ",") \
X(SEMICOLON, ";") \
X(LPAREN, "(") \