MCPcopy Create free account
hub / github.com/WheretIB/nullc / AddHexInteger

Function AddHexInteger

NULLC/Callbacks.cpp:643–657  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

641}
642
643void AddHexInteger(const char* pos, const char* end)
644{
645 pos += 2;
646 // skip leading zeros
647 while(*pos == '0')
648 pos++;
649 if(int(end - pos) > 16)
650 ThrowError(pos, "ERROR: overflow in hexadecimal constant");
651 long long num = parseLong(pos, end, 16);
652 // If number overflows integer number, create long number
653 if(int(num) == num)
654 CodeInfo::nodeList.push_back(new NodeNumber(int(num), typeInt));
655 else
656 CodeInfo::nodeList.push_back(new NodeNumber(num, typeLong));
657}
658
659void AddOctInteger(const char* pos, const char* end)
660{

Callers 1

ParseNumberFunction · 0.85

Calls 3

ThrowErrorFunction · 0.85
parseLongFunction · 0.85
push_backMethod · 0.45

Tested by

no test coverage detected