From fe230334d90f7c9f901a9c851d935807c7b694d5 Mon Sep 17 00:00:00 2001 From: Dirk Stolle Date: Sun, 14 Nov 2021 14:25:14 +0100 Subject: [PATCH] fix typos in documentation (#3140) * fix typos in documentation * revert changes to ChangeLog.md --- doc/mkdocs/docs/api/basic_json/binary_t.md | 2 +- doc/mkdocs/docs/api/basic_json/erase.md | 6 +++--- doc/mkdocs/docs/api/basic_json/insert.md | 8 ++++---- doc/mkdocs/docs/api/basic_json/items.md | 2 +- doc/mkdocs/docs/api/basic_json/update.md | 2 +- doc/mkdocs/docs/api/basic_json/value.md | 4 ++-- doc/mkdocs/docs/features/binary_values.md | 4 ++-- doc/mkdocs/docs/features/iterators.md | 2 +- doc/mkdocs/docs/features/types/number_handling.md | 2 +- doc/mkdocs/docs/home/exceptions.md | 2 +- doc/mkdocs/docs/home/releases.md | 6 +++--- test/src/unit-regression2.cpp | 2 +- 12 files changed, 21 insertions(+), 21 deletions(-) diff --git a/doc/mkdocs/docs/api/basic_json/binary_t.md b/doc/mkdocs/docs/api/basic_json/binary_t.md index f7da1ece0..a129b7246 100644 --- a/doc/mkdocs/docs/api/basic_json/binary_t.md +++ b/doc/mkdocs/docs/api/basic_json/binary_t.md @@ -55,7 +55,7 @@ type `#!cpp binary_t*` must be dereferenced. - MessagePack - If a subtype is given and the binary array contains exactly 1, 2, 4, 8, or 16 elements, the fixext family (fixext1, fixext2, fixext4, fixext8) is used. For other sizes, the ext family (ext8, ext16, ext32) is used. The subtype is - then added as singed 8-bit integer. + then added as signed 8-bit integer. - If no subtype is given, the bin family (bin8, bin16, bin32) is used. - BSON diff --git a/doc/mkdocs/docs/api/basic_json/erase.md b/doc/mkdocs/docs/api/basic_json/erase.md index 3d80f5bfd..85530588e 100644 --- a/doc/mkdocs/docs/api/basic_json/erase.md +++ b/doc/mkdocs/docs/api/basic_json/erase.md @@ -68,7 +68,7 @@ void erase(const size_type idx); - Throws [`invalid_iterator.205`](../../home/exceptions.md#jsonexceptioninvalid_iterator205) if called on a primitive type with invalid iterator (i.e., any iterator which is not `begin()`); example: `"iterator out of range"` -2. The function can throw thw following exceptions: +2. The function can throw the following exceptions: - Throws [`type_error.307`](../../home/exceptions.md#jsonexceptiontype_error307) if called on a `null` value; example: `"cannot use erase() with null"` - Throws [`invalid_iterator.203`](../../home/exceptions.md#jsonexceptioninvalid_iterator203) if called on iterators @@ -76,10 +76,10 @@ void erase(const size_type idx); - Throws [`invalid_iterator.204`](../../home/exceptions.md#jsonexceptioninvalid_iterator204) if called on a primitive type with invalid iterators (i.e., if `first != begin()` and `last != end()`); example: `"iterators out of range"` -3. The function can throw thw following exceptions: +3. The function can throw the following exceptions: - Throws [`type_error.307`](../../home/exceptions.md#jsonexceptiontype_error307) when called on a type other than JSON object; example: `"cannot use erase() with null"` -4. The function can throw thw following exceptions: +4. The function can throw the following exceptions: - Throws [`type_error.307`](../../home/exceptions.md#jsonexceptiontype_error307) when called on a type other than JSON object; example: `"cannot use erase() with null"` - Throws [`out_of_range.401`](../../home/exceptions.md#jsonexceptionout_of_range401) when `idx >= size()`; example: diff --git a/doc/mkdocs/docs/api/basic_json/insert.md b/doc/mkdocs/docs/api/basic_json/insert.md index fbd466852..d1e14d5de 100644 --- a/doc/mkdocs/docs/api/basic_json/insert.md +++ b/doc/mkdocs/docs/api/basic_json/insert.md @@ -59,12 +59,12 @@ void insert(const_iterator first, const_iterator last); arrays; example: `"cannot use insert() with string"` - Throws [`invalid_iterator.202`](../../home/exceptions.md#jsonexceptioninvalid_iterator202) if called on an iterator which does not belong to the current JSON value; example: `"iterator does not fit current value"` -2. The function can throw thw following exceptions: +2. The function can throw the following exceptions: - Throws [`type_error.309`](../../home/exceptions.md#jsonexceptiontype_error309) if called on JSON values other than arrays; example: `"cannot use insert() with string"` - Throws [`invalid_iterator.202`](../../home/exceptions.md#jsonexceptioninvalid_iterator202) if called on an iterator which does not belong to the current JSON value; example: `"iterator does not fit current value"` -3. The function can throw thw following exceptions: +3. The function can throw the following exceptions: - Throws [`type_error.309`](../../home/exceptions.md#jsonexceptiontype_error309) if called on JSON values other than arrays; example: `"cannot use insert() with string"` - Throws [`invalid_iterator.202`](../../home/exceptions.md#jsonexceptioninvalid_iterator202) if called on an @@ -73,12 +73,12 @@ void insert(const_iterator first, const_iterator last); do not belong to the same JSON value; example: `"iterators do not fit"` - Throws [`invalid_iterator.211`](../../home/exceptions.md#jsonexceptioninvalid_iterator211) if `first` or `last` are iterators into container for which insert is called; example: `"passed iterators may not belong to container"` -4. The function can throw thw following exceptions: +4. The function can throw the following exceptions: - Throws [`type_error.309`](../../home/exceptions.md#jsonexceptiontype_error309) if called on JSON values other than arrays; example: `"cannot use insert() with string"` - Throws [`invalid_iterator.202`](../../home/exceptions.md#jsonexceptioninvalid_iterator202) if called on an iterator which does not belong to the current JSON value; example: `"iterator does not fit current value"` -5. The function can throw thw following exceptions: +5. The function can throw the following exceptions: - Throws [`type_error.309`](../../home/exceptions.md#jsonexceptiontype_error309) if called on JSON values other than objects; example: `"cannot use insert() with string"` - Throws [`invalid_iterator.202`](../../home/exceptions.md#jsonexceptioninvalid_iterator202) if called on an diff --git a/doc/mkdocs/docs/api/basic_json/items.md b/doc/mkdocs/docs/api/basic_json/items.md index d5c711364..f680ff60b 100644 --- a/doc/mkdocs/docs/api/basic_json/items.md +++ b/doc/mkdocs/docs/api/basic_json/items.md @@ -65,7 +65,7 @@ When iterating over an array, `key()` will return the index of the element as st !!! warning - Using `items()` on temporary objects is dangerous. Make sure the object's lifetime exeeds the iteration. See + Using `items()` on temporary objects is dangerous. Make sure the object's lifetime exceeds the iteration. See for more information. ## Example diff --git a/doc/mkdocs/docs/api/basic_json/update.md b/doc/mkdocs/docs/api/basic_json/update.md index 851417e87..ae9d19808 100644 --- a/doc/mkdocs/docs/api/basic_json/update.md +++ b/doc/mkdocs/docs/api/basic_json/update.md @@ -37,7 +37,7 @@ function. 1. The function can throw the following exceptions: - Throws [`type_error.312`](../../home/exceptions.md#jsonexceptiontype_error312) if called on JSON values other than objects; example: `"cannot use update() with string"` -2. The function can throw thw following exceptions: +2. The function can throw the following exceptions: - Throws [`type_error.312`](../../home/exceptions.md#jsonexceptiontype_error312) if called on JSON values other than objects; example: `"cannot use update() with string"` - Throws [`invalid_iterator.202`](../../home/exceptions.md#jsonexceptioninvalid_iterator202) if called on an diff --git a/doc/mkdocs/docs/api/basic_json/value.md b/doc/mkdocs/docs/api/basic_json/value.md index 8fdbc238f..d12209060 100644 --- a/doc/mkdocs/docs/api/basic_json/value.md +++ b/doc/mkdocs/docs/api/basic_json/value.md @@ -69,12 +69,12 @@ changes to any JSON value. ## Exceptions -1. The function can throw thw following exceptions: +1. The function can throw the following exceptions: - Throws [`type_error.302`](../../home/exceptions.md#jsonexceptiontype_error302) if `default_value` does not match the type of the value at `key` - Throws [`type_error.306`](../../home/exceptions.md#jsonexceptiontype_error306) if the JSON value is not an object; in that case, using `value()` with a key makes no sense. -2. The function can throw thw following exceptions: +2. The function can throw the following exceptions: - Throws [`type_error.302`](../../home/exceptions.md#jsonexceptiontype_error302) if `default_value` does not match the type of the value at `ptr` - Throws [`type_error.306`](../../home/exceptions.md#jsonexceptiontype_error306) if the JSON value is not an object; diff --git a/doc/mkdocs/docs/features/binary_values.md b/doc/mkdocs/docs/features/binary_values.md index 66e721688..c58834c05 100644 --- a/doc/mkdocs/docs/features/binary_values.md +++ b/doc/mkdocs/docs/features/binary_values.md @@ -198,7 +198,7 @@ JSON does not have a binary type, and this library does not introduce a new type ### MessagePack -[MessagePack](binary_formats/messagepack.md) supports binary values and subtypes. If a subtype is given, the ext family is used. The library will choose the smallest representation among fixext1, fixext2, fixext4, fixext8, ext8, ext16, and ext32. The subtype is then added as singed 8-bit integer. +[MessagePack](binary_formats/messagepack.md) supports binary values and subtypes. If a subtype is given, the ext family is used. The library will choose the smallest representation among fixext1, fixext2, fixext4, fixext8, ext8, ext16, and ext32. The subtype is then added as signed 8-bit integer. If no subtype is given, the bin family (bin8, bin16, bin32) is used. @@ -282,7 +282,7 @@ If no subtype is given, the bin family (bin8, bin16, bin32) is used. 0x23 0x69 0x01 // '#' i 1 number of object elements 0x69 0x06 // i 6 (length of the key) 0x62 0x69 0x6E 0x61 0x72 0x79 // "binary" - 0x24 0x55 // '$' 'U' type of the array elements: unsinged integers + 0x24 0x55 // '$' 'U' type of the array elements: unsigned integers 0x23 0x69 0x04 // '#' i 4 number of array elements 0xCA 0xFE 0xBA 0xBE // content ``` diff --git a/doc/mkdocs/docs/features/iterators.md b/doc/mkdocs/docs/features/iterators.md index fd9d6791a..0013d4cbc 100644 --- a/doc/mkdocs/docs/features/iterators.md +++ b/doc/mkdocs/docs/features/iterators.md @@ -100,7 +100,7 @@ for (auto& [key, val] : j_object.items()) !!! warning - Using `items()` on temporary objects is dangerous. Make sure the object's lifetime exeeds the iteration. See for more information. + Using `items()` on temporary objects is dangerous. Make sure the object's lifetime exceeds the iteration. See for more information. ### Reverse iteration order diff --git a/doc/mkdocs/docs/features/types/number_handling.md b/doc/mkdocs/docs/features/types/number_handling.md index aa8df7ad8..7080faaa1 100644 --- a/doc/mkdocs/docs/features/types/number_handling.md +++ b/doc/mkdocs/docs/features/types/number_handling.md @@ -128,7 +128,7 @@ That is, `-0` is stored as a signed integer, but the serialization does not repr - The serialization can be in scientific notation even if the input is not: `#!c 0.0000972439793401814` will be serialized as `#!c 9.72439793401814e-05`. The reverse can also be true: `#!c 12345E-5` will be serialized as `#!c 0.12345`. - - Conversions from `#!c float` to `#!c double` can also introduce rouding errors: + - Conversions from `#!c float` to `#!c double` can also introduce rounding errors: ```cpp float f = 0.3; json j = f; diff --git a/doc/mkdocs/docs/home/exceptions.md b/doc/mkdocs/docs/home/exceptions.md index a04b60f86..ea0c85c9e 100644 --- a/doc/mkdocs/docs/home/exceptions.md +++ b/doc/mkdocs/docs/home/exceptions.md @@ -177,7 +177,7 @@ This error indicates a syntax error while deserializing a JSON text. The error m !!! tip - - Make sure the input is correctly read. Try to write the input to standard output to check if, for instance, the input file was successfully openened. + - Make sure the input is correctly read. Try to write the input to standard output to check if, for instance, the input file was successfully opened. - Paste the input to a JSON validator like or a tool like [jq](https://stedolan.github.io/jq/). ### json.exception.parse_error.102 diff --git a/doc/mkdocs/docs/home/releases.md b/doc/mkdocs/docs/home/releases.md index 298c3772b..2cf5b3c66 100644 --- a/doc/mkdocs/docs/home/releases.md +++ b/doc/mkdocs/docs/home/releases.md @@ -468,7 +468,7 @@ This release further fixes several bugs in the library. All changes are backward - allow compare user-defined string types (#1130) - better support for algorithms using iterators from `items()` (#1045, #1134) - added parameter to avoid compilation error with MSVC 2015 debug builds (#1114) -- re-added accidentially skipped unit tests (#1176) +- re-added accidentally skipped unit tests (#1176) - fixed MSVC issue with `std::swap` (#1168) ### :zap: Improvements @@ -1008,7 +1008,7 @@ This release fixes a few bugs in the JSON parser found in the [Parsing JSON is a This release fixes the semantics of `operator[]` for JSON Pointers (see below). This fix is backwards compatible. ### Changes -- **`operator[]` for JSON Pointers** now behaves like the other versions of `operator[]` and transforms `null` values into objects or arrays if required. This allows to created nested structues like `j["/foo/bar/2"] = 17` (yielding `{"foo": "bar": [null, null, 17]}`) without problems. +- **`operator[]` for JSON Pointers** now behaves like the other versions of `operator[]` and transforms `null` values into objects or arrays if required. This allows to created nested structures like `j["/foo/bar/2"] = 17` (yielding `{"foo": "bar": [null, null, 17]}`) without problems. - overworked a helper SFINAE function - fixed some documentation issues - fixed the CMake files to allow to run the test suite outside the main project directory @@ -1093,7 +1093,7 @@ This release combines a lot of small fixes and improvements. The release is back ### Changes - The **parser** has been overworked, and a lot of small issues have been fixed: - Improved parser performance by avoiding recursion and using move semantics for the return value. - - Unescaped control charaters `\x10`-`\x1f` are not accepted any more. + - Unescaped control characters `\x10`-`\x1f` are not accepted any more. - Fixed a bug in the parser when reading from an input stream. - Improved test case coverage for UTF-8 parsing: now, all valid Unicode code points are tested both escaped and unescaped. - The precision of output streams is now preserved by the parser. diff --git a/test/src/unit-regression2.cpp b/test/src/unit-regression2.cpp index b2f2a7dc3..3ae73ce18 100644 --- a/test/src/unit-regression2.cpp +++ b/test/src/unit-regression2.cpp @@ -532,7 +532,7 @@ TEST_CASE("regression tests 2") auto val2 = j.value("y", defval); } - SECTION("issue #2293 - eof doesnt cause parsing to stop") + SECTION("issue #2293 - eof doesn't cause parsing to stop") { std::vector data = {