Fix debug_print_token

This commit is contained in:
ala89 2023-12-08 14:01:28 +01:00
parent 5be12fbf9e
commit 9e2fca94a1

View File

@ -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) << ")";