diff --git a/include/rapidjson/error/en.h b/include/rapidjson/error/en.h index 45017d3..81637ee 100644 --- a/include/rapidjson/error/en.h +++ b/include/rapidjson/error/en.h @@ -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."); diff --git a/include/rapidjson/reader.h b/include/rapidjson/reader.h index 76fed8d..c87e7d8 100644 --- a/include/rapidjson/reader.h +++ b/include/rapidjson/reader.h @@ -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 diff --git a/test/unittest/readertest.cpp b/test/unittest/readertest.cpp index 4b5162b..264f7ba 100644 --- a/test/unittest/readertest.cpp +++ b/test/unittest/readertest.cpp @@ -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.");