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

Function AddOctInteger

NULLC/Callbacks.cpp:659–673  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

657}
658
659void AddOctInteger(const char* pos, const char* end)
660{
661 pos++;
662 // skip leading zeros
663 while(*pos == '0')
664 pos++;
665 if(int(end - pos) > 22 || (int(end - pos) > 21 && *pos != '1'))
666 ThrowError(pos, "ERROR: overflow in octal constant");
667 long long num = parseLong(pos, end, 8);
668 // If number overflows integer number, create long number
669 if(int(num) == num)
670 CodeInfo::nodeList.push_back(new NodeNumber(int(num), typeInt));
671 else
672 CodeInfo::nodeList.push_back(new NodeNumber(num, typeLong));
673}
674
675void AddBinInteger(const char* pos, const char* end)
676{

Callers 1

ParseNumberFunction · 0.85

Calls 3

ThrowErrorFunction · 0.85
parseLongFunction · 0.85
push_backMethod · 0.45

Tested by

no test coverage detected