Fix int stuff

This commit is contained in:
Maxwell 2025-04-24 20:14:28 +10:00
parent 73939b3668
commit 96f93ceb49
3 changed files with 7 additions and 10 deletions

BIN
mx

Binary file not shown.

View File

@ -124,17 +124,15 @@ void Parser::processLines() {
else {
token.keyword = keywords::VALUE;
// Convert the value based on its type
if (canDec(ct)) {
token.type = valtype::DEC;
token.value.type = valtype::DEC;
token.value.value = stod(ct);
}
else if (canInt(ct)) {
if (canInt(ct)) {
token.type = valtype::INT;
token.value.type = valtype::INT;
token.value.value = stoi(ct);
}
else if (ct == "true" || ct == "false") {
}else if (canDec(ct)) {
token.type = valtype::DEC;
token.value.type = valtype::DEC;
token.value.value = stod(ct);
} else if (ct == "true" || ct == "false") {
token.type = valtype::BOOL;
token.value.type = valtype::BOOL;
token.value.value = (ct == "true");

View File

@ -2,5 +2,4 @@ print "dingusify";
let str bingus "heheheha its bingusing time";
print bingus;
print 1 + 1;
let dec myInt 3;
myInt += 69;
let int myInt 3;