Skip to content

Commit

Permalink
Use stoull and uint64_t for for integer parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
quantumsheep committed Aug 10, 2020
1 parent 40f4306 commit ddf2144
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/grammar/Visitor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
#include <limits>
#include <regex>
#include <tuple>
#include <cstdint>

namespace Sand
{
Expand Down Expand Up @@ -3322,14 +3323,14 @@ class Visitor
str.erase(std::remove(str.begin(), str.end(), '_'), str.end());
str.erase(std::remove(str.begin(), str.end(), '\''), str.end());

unsigned long integer = 0;
uint64_t integer = 0;
std::string name = "";
Type *type = nullptr;
bool is_signed = true;

try
{
integer = std::stoul(str, nullptr, base);
integer = std::stoull(str, nullptr, base);
}
catch (std::out_of_range &)
{
Expand Down

0 comments on commit ddf2144

Please sign in to comment.