Fix debug_print_token
This commit is contained in:
parent
5be12fbf9e
commit
9e2fca94a1
@ -41,7 +41,12 @@ vector<tuple<string, TokenType>> simpleTokens = {
|
||||
void _debug_print_token(Token token) {
|
||||
switch (token.type) {
|
||||
case TokenType::Litteral:
|
||||
cout << "Litteral(" << "tmp" << ")";
|
||||
if (holds_alternative<int>(token.data)) {
|
||||
cout << "Litteral(" << get<int>(token.data) << ")";
|
||||
}
|
||||
else if (holds_alternative<double>(token.data)) {
|
||||
cout << "Litteral(" << get<double>(token.data) << ")";
|
||||
}
|
||||
break;
|
||||
case TokenType::Identifier:
|
||||
cout << "Identifier(" << get<string>(token.data) << ")";
|
||||
|
Loading…
x
Reference in New Issue
Block a user