ParseErrorCode: fix typo (NumberTooBig)
This commit is contained in:
parent
a22f325ae4
commit
6b7f346437
@ -34,7 +34,7 @@ inline const RAPIDJSON_ERROR_CHARTYPE* GetParseError_En(ParseErrorCode parseErro
|
||||
case kParseErrorStringMissQuotationMark: return RAPIDJSON_ERROR_STRING("Missing a closing quotation mark in string.");
|
||||
case kParseErrorStringInvalidEncoding: return RAPIDJSON_ERROR_STRING("Invalid encoidng in string.");
|
||||
|
||||
case kParesErrorNumberTooBig: return RAPIDJSON_ERROR_STRING("Number too big to be stored in double.");
|
||||
case kParseErrorNumberTooBig: return RAPIDJSON_ERROR_STRING("Number too big to be stored in double.");
|
||||
case kParseErrorNumberMissFraction: return RAPIDJSON_ERROR_STRING("Miss fraction part in number.");
|
||||
case kParseErrorNumberMissExponent: return RAPIDJSON_ERROR_STRING("Miss exponent in number.");
|
||||
|
||||
|
@ -71,7 +71,7 @@ enum ParseErrorCode {
|
||||
kParseErrorStringMissQuotationMark, //!< Missing a closing quotation mark in string.
|
||||
kParseErrorStringInvalidEncoding, //!< Invalid encoidng in string.
|
||||
|
||||
kParesErrorNumberTooBig, //!< Number too big to be stored in double.
|
||||
kParseErrorNumberTooBig, //!< Number too big to be stored in double.
|
||||
kParseErrorNumberMissFraction, //!< Miss fraction part in number.
|
||||
kParseErrorNumberMissExponent //!< Miss exponent in number.
|
||||
};
|
||||
@ -643,7 +643,7 @@ private:
|
||||
d = (double)i64;
|
||||
while (s.Peek() >= '0' && s.Peek() <= '9') {
|
||||
if (d >= 1E307)
|
||||
RAPIDJSON_PARSE_ERROR(kParesErrorNumberTooBig, is.Tell());
|
||||
RAPIDJSON_PARSE_ERROR(kParseErrorNumberTooBig, is.Tell());
|
||||
d = d * 10 + (s.Take() - '0');
|
||||
}
|
||||
}
|
||||
@ -695,7 +695,7 @@ private:
|
||||
while (s.Peek() >= '0' && s.Peek() <= '9') {
|
||||
exp = exp * 10 + (s.Take() - '0');
|
||||
if (exp > 308)
|
||||
RAPIDJSON_PARSE_ERROR(kParesErrorNumberTooBig, is.Tell());
|
||||
RAPIDJSON_PARSE_ERROR(kParseErrorNumberTooBig, is.Tell());
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -171,9 +171,9 @@ TEST(Reader, ParseNumber_Error) {
|
||||
for (int i = 1; i < 310; i++)
|
||||
n1e309[i] = '0';
|
||||
n1e309[310] = '\0';
|
||||
TEST_NUMBER_ERROR(kParesErrorNumberTooBig, n1e309);
|
||||
TEST_NUMBER_ERROR(kParseErrorNumberTooBig, n1e309);
|
||||
}
|
||||
TEST_NUMBER_ERROR(kParesErrorNumberTooBig, "1e309");
|
||||
TEST_NUMBER_ERROR(kParseErrorNumberTooBig, "1e309");
|
||||
|
||||
// Miss fraction part in number.
|
||||
TEST_NUMBER_ERROR(kParseErrorNumberMissFraction, "1.");
|
||||
|
Loading…
x
Reference in New Issue
Block a user