Hex literals

This commit is contained in:
Rafał Grodziński
2025-06-22 13:10:58 +09:00
parent 087a933772
commit 1ac2db1319
5 changed files with 57 additions and 15 deletions

View File

@@ -130,8 +130,12 @@ Expression(ExpressionKind::LITERAL, ValueType::NONE) {
boolValue = token->getLexme().compare("true") == 0;
valueType = ValueType::BOOL;
break;
case TokenKind::INTEGER:
sint32Value = stoi(token->getLexme());
case TokenKind::INTEGER_DEC:
sint32Value = stoi(token->getLexme(), nullptr, 10);
valueType = ValueType::SINT32;
break;
case TokenKind::INTEGER_HEX:
sint32Value = stoi(token->getLexme(), nullptr, 16);
valueType = ValueType::SINT32;
break;
case TokenKind::REAL: