extended single char tokens
This commit is contained in:
@@ -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 ';':
|
||||
|
@@ -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, "(") \
|
||||
|
Reference in New Issue
Block a user