| 419 | } |
| 420 | |
| 421 | static bool largeInt(std::string_view str) { |
| 422 | bool isSigned = false; |
| 423 | size_t pos = str.find('\''); |
| 424 | if (pos != std::string::npos) { |
| 425 | if (str.find_first_of("sS") != std::string::npos) { |
| 426 | isSigned = true; |
| 427 | str = str.substr(pos + 3); |
| 428 | } else { |
| 429 | str = str.substr(pos + 2); |
| 430 | } |
| 431 | } |
| 432 | std::string value(str); |
| 433 | value = StringUtils::replaceAll(value, "_", ""); |
| 434 | bool isLarge = false; |
| 435 | if (value.size() > 20) { |
| 436 | isLarge = true; |
| 437 | } else if (value.size() == 20) { |
| 438 | if (isSigned) { |
| 439 | int64_t test = 0; |
| 440 | isLarge = NumUtils::parseInt64(value, &test) == nullptr; |
| 441 | } else { |
| 442 | uint64_t test = 0; |
| 443 | isLarge = NumUtils::parseUint64(value, &test) == nullptr; |
| 444 | } |
| 445 | } |
| 446 | return isLarge; |
| 447 | } |
| 448 | |
| 449 | constant *compileConst(const FileContent *fC, NodeId child, Serializer &s) { |
| 450 | VObjectType objtype = fC->Type(child); |
no test coverage detected