diff --git a/mx b/mx index 7a8be2b..3adb443 100755 Binary files a/mx and b/mx differ diff --git a/src/Parser.cpp b/src/Parser.cpp index 80e4153..54988d3 100644 --- a/src/Parser.cpp +++ b/src/Parser.cpp @@ -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"); diff --git a/test.mx b/test.mx index 5954cd4..116f4a7 100644 --- a/test.mx +++ b/test.mx @@ -2,5 +2,4 @@ print "dingusify"; let str bingus "heheheha its bingusing time"; print bingus; print 1 + 1; -let dec myInt 3; -myInt += 69; \ No newline at end of file +let int myInt 3; \ No newline at end of file