Parse a number. The initial character of the string is a decimal digit.
| 1367 | |
| 1368 | // Parse a number. The initial character of the string is a decimal digit. |
| 1369 | void ExpressionParser::ParseNumber(ExpressionValue& rslt) noexcept |
| 1370 | { |
| 1371 | NumericConverter conv; |
| 1372 | conv.Accumulate(CurrentCharacter(), NumericConverter::AcceptSignedFloat | NumericConverter::AcceptHex, [this]()->char { AdvancePointer(); return CurrentCharacter(); }); // must succeed because CurrentCharacter is a decimal digit |
| 1373 | |
| 1374 | if (conv.FitsInInt32()) |
| 1375 | { |
| 1376 | rslt.SetInt(conv.GetInt32()); |
| 1377 | } |
| 1378 | else if (conv.FitsInUint32()) |
| 1379 | { |
| 1380 | rslt.SetUnsigned(conv.GetUint32()); |
| 1381 | } |
| 1382 | else |
| 1383 | { |
| 1384 | rslt.SetFloat(conv.GetFloat(), constrain<unsigned int>(conv.GetDigitsAfterPoint(), 1, MaxFloatDigitsDisplayedAfterPoint)); |
| 1385 | } |
| 1386 | } |
| 1387 | |
| 1388 | static void SetStrStrResult(ExpressionValue& e, const char *_ecv_array s1, const char *_ecv_array s2) noexcept |
| 1389 | { |
nothing calls this directly
no test coverage detected