| 342 | return (u64_t)std::stoull(removeUnderscore(tok_.expect(TokenType::Integer).text), nullptr, 0); |
| 343 | } |
| 344 | f32_t ParseContext::parse_f32() { |
| 345 | std::string text = removeUnderscore(tok_.expect(TokenType::Float).text); |
| 346 | if (text.find("nan:0x") != std::string::npos) { |
| 347 | size_t pos = text.find("nan:0x"); |
| 348 | return (f32_t)std::nanf(text.substr(pos + 4).c_str()); |
| 349 | } |
| 350 | return (f32_t)std::stof(text); |
| 351 | } |
| 352 | f64_t ParseContext::parse_f64() { |
| 353 | std::string text = removeUnderscore(tok_.expect(TokenType::Float).text); |
| 354 | if (text.find("nan:0x") != std::string::npos) { |
nothing calls this directly
no test coverage detected