Merge pull request #1923 from Coeur/typos

Some typos
This commit is contained in:
Niels Lohmann 2020-02-02 14:48:07 +01:00 committed by GitHub
commit 973c52dd4a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 24 additions and 24 deletions

2
.github/CODEOWNERS vendored
View file

@ -1,6 +1,6 @@
# JSON for Modern C++ has been originally written by Niels Lohmann. # JSON for Modern C++ has been originally written by Niels Lohmann.
# Since 2013 over 140 contributors have helped to improve the library. # Since 2013 over 140 contributors have helped to improve the library.
# This CODEOWNERS file is only to make sure that @nlohmann is requsted # This CODEOWNERS file is only to make sure that @nlohmann is requested
# for a code review in case of a pull request. # for a code review in case of a pull request.
* @nlohmann * @nlohmann

View file

@ -56,7 +56,7 @@ To make changes, you need to edit the following files:
- The C++11 support varies between different **compilers** and versions. Please note the [list of supported compilers](https://github.com/nlohmann/json/blob/master/README.md#supported-compilers). Some compilers like GCC 4.7 (and earlier), Clang 3.3 (and earlier), or Microsoft Visual Studio 13.0 and earlier are known not to work due to missing or incomplete C++11 support. Please refrain from proposing changes that work around these compiler's limitations with `#ifdef`s or other means. - The C++11 support varies between different **compilers** and versions. Please note the [list of supported compilers](https://github.com/nlohmann/json/blob/master/README.md#supported-compilers). Some compilers like GCC 4.7 (and earlier), Clang 3.3 (and earlier), or Microsoft Visual Studio 13.0 and earlier are known not to work due to missing or incomplete C++11 support. Please refrain from proposing changes that work around these compiler's limitations with `#ifdef`s or other means.
- Specifically, I am aware of compilation problems with **Microsoft Visual Studio** (there even is an [issue label](https://github.com/nlohmann/json/issues?utf8=✓&q=label%3A%22visual+studio%22+) for these kind of bugs). I understand that even in 2016, complete C++11 support isn't there yet. But please also understand that I do not want to drop features or uglify the code just to make Microsoft's sub-standard compiler happy. The past has shown that there are ways to express the functionality such that the code compiles with the most recent MSVC - unfortunately, this is not the main objective of the project. - Specifically, I am aware of compilation problems with **Microsoft Visual Studio** (there even is an [issue label](https://github.com/nlohmann/json/issues?utf8=✓&q=label%3A%22visual+studio%22+) for these kind of bugs). I understand that even in 2016, complete C++11 support isn't there yet. But please also understand that I do not want to drop features or uglify the code just to make Microsoft's sub-standard compiler happy. The past has shown that there are ways to express the functionality such that the code compiles with the most recent MSVC - unfortunately, this is not the main objective of the project.
- Please refrain from proposing changes that would **break [JSON](http://json.org) conformance**. If you propose a conformant extension of JSON to be supported by the library, please motivate this extension. - Please refrain from proposing changes that would **break [JSON](https://json.org) conformance**. If you propose a conformant extension of JSON to be supported by the library, please motivate this extension.
- We shall not extend the library to **support comments**. There is quite some [controversy](https://www.reddit.com/r/programming/comments/4v6chu/why_json_doesnt_support_comments_douglas_crockford/) around this topic, and there were quite some [issues](https://github.com/nlohmann/json/issues/376) on this. We believe that JSON is fine without comments. - We shall not extend the library to **support comments**. There is quite some [controversy](https://www.reddit.com/r/programming/comments/4v6chu/why_json_doesnt_support_comments_douglas_crockford/) around this topic, and there were quite some [issues](https://github.com/nlohmann/json/issues/376) on this. We believe that JSON is fine without comments.
- We do not preserve the **insertion order of object elements**. The [JSON standard](https://tools.ietf.org/html/rfc7159.html) defines objects as "an unordered collection of zero or more name/value pairs". To this end, this library does not preserve insertion order of name/value pairs. (In fact, keys will be traversed in alphabetical order as `std::map` with `std::less` is used by default.) Note this behavior conforms to the standard, and we shall not change it to any other order. If you do want to preserve the insertion order, you can specialize the object type with containers like [`tsl::ordered_map`](https://github.com/Tessil/ordered-map) or [`nlohmann::fifo_map`](https://github.com/nlohmann/fifo_map). - We do not preserve the **insertion order of object elements**. The [JSON standard](https://tools.ietf.org/html/rfc7159.html) defines objects as "an unordered collection of zero or more name/value pairs". To this end, this library does not preserve insertion order of name/value pairs. (In fact, keys will be traversed in alphabetical order as `std::map` with `std::less` is used by default.) Note this behavior conforms to the standard, and we shall not change it to any other order. If you do want to preserve the insertion order, you can specialize the object type with containers like [`tsl::ordered_map`](https://github.com/Tessil/ordered-map) or [`nlohmann::fifo_map`](https://github.com/nlohmann/fifo_map).

View file

@ -15,5 +15,5 @@ Read the [Contribution Guidelines](https://github.com/nlohmann/json/blob/develop
- The C++11 support varies between different **compilers** and versions. Please note the [list of supported compilers](https://github.com/nlohmann/json/blob/master/README.md#supported-compilers). Some compilers like GCC 4.7 (and earlier), Clang 3.3 (and earlier), or Microsoft Visual Studio 13.0 and earlier are known not to work due to missing or incomplete C++11 support. Please refrain from proposing changes that work around these compiler's limitations with `#ifdef`s or other means. - The C++11 support varies between different **compilers** and versions. Please note the [list of supported compilers](https://github.com/nlohmann/json/blob/master/README.md#supported-compilers). Some compilers like GCC 4.7 (and earlier), Clang 3.3 (and earlier), or Microsoft Visual Studio 13.0 and earlier are known not to work due to missing or incomplete C++11 support. Please refrain from proposing changes that work around these compiler's limitations with `#ifdef`s or other means.
- Specifically, I am aware of compilation problems with **Microsoft Visual Studio** (there even is an [issue label](https://github.com/nlohmann/json/issues?utf8=✓&q=label%3A%22visual+studio%22+) for these kind of bugs). I understand that even in 2016, complete C++11 support isn't there yet. But please also understand that I do not want to drop features or uglify the code just to make Microsoft's sub-standard compiler happy. The past has shown that there are ways to express the functionality such that the code compiles with the most recent MSVC - unfortunately, this is not the main objective of the project. - Specifically, I am aware of compilation problems with **Microsoft Visual Studio** (there even is an [issue label](https://github.com/nlohmann/json/issues?utf8=✓&q=label%3A%22visual+studio%22+) for these kind of bugs). I understand that even in 2016, complete C++11 support isn't there yet. But please also understand that I do not want to drop features or uglify the code just to make Microsoft's sub-standard compiler happy. The past has shown that there are ways to express the functionality such that the code compiles with the most recent MSVC - unfortunately, this is not the main objective of the project.
- Please refrain from proposing changes that would **break [JSON](http://json.org) conformance**. If you propose a conformant extension of JSON to be supported by the library, please motivate this extension. - Please refrain from proposing changes that would **break [JSON](https://json.org) conformance**. If you propose a conformant extension of JSON to be supported by the library, please motivate this extension.
- Please do not open pull requests that address **multiple issues**. - Please do not open pull requests that address **multiple issues**.

View file

@ -45,7 +45,7 @@
## Design goals ## Design goals
There are myriads of [JSON](http://json.org) libraries out there, and each may even have its reason to exist. Our class had these design goals: There are myriads of [JSON](https://json.org) libraries out there, and each may even have its reason to exist. Our class had these design goals:
- **Intuitive syntax**. In languages such as Python, JSON feels like a first class data type. We used all the operator magic of modern C++ to achieve the same feeling in your code. Check out the [examples below](#examples) and you'll know what I mean. - **Intuitive syntax**. In languages such as Python, JSON feels like a first class data type. We used all the operator magic of modern C++ to achieve the same feeling in your code. Check out the [examples below](#examples) and you'll know what I mean.
@ -1318,7 +1318,7 @@ The library itself consists of a single header file licensed under the MIT licen
- [**AppVeyor**](https://www.appveyor.com) for [continuous integration](https://ci.appveyor.com/project/nlohmann/json) on Windows - [**AppVeyor**](https://www.appveyor.com) for [continuous integration](https://ci.appveyor.com/project/nlohmann/json) on Windows
- [**Artistic Style**](http://astyle.sourceforge.net) for automatic source code indentation - [**Artistic Style**](http://astyle.sourceforge.net) for automatic source code indentation
- [**CircleCI**](http://circleci.com) for [continuous integration](https://circleci.com/gh/nlohmann/json). - [**CircleCI**](http://circleci.com) for [continuous integration](https://circleci.com/gh/nlohmann/json).
- [**Clang**](http://clang.llvm.org) for compilation with code sanitizers - [**Clang**](https://clang.llvm.org) for compilation with code sanitizers
- [**CMake**](https://cmake.org) for build automation - [**CMake**](https://cmake.org) for build automation
- [**Codacity**](https://www.codacy.com) for further [code analysis](https://www.codacy.com/app/nlohmann/json) - [**Codacity**](https://www.codacy.com) for further [code analysis](https://www.codacy.com/app/nlohmann/json)
- [**Coveralls**](https://coveralls.io) to measure [code coverage](https://coveralls.io/github/nlohmann/json) - [**Coveralls**](https://coveralls.io) to measure [code coverage](https://coveralls.io/github/nlohmann/json)

View file

@ -80,8 +80,8 @@ Note that this table only lists those exceptions thrown due to the type. For ins
<table> <table>
<tr> <tr>
<th rowspan="2">group</td> <th rowspan="2">group</th>
<th rowspan="2">function</td> <th rowspan="2">function</th>
<th colspan="6">JSON value type</th> <th colspan="6">JSON value type</th>
</tr> </tr>
<tr> <tr>

View file

@ -24,7 +24,7 @@ import urllib2
# Strips C and C++ comments from the given string. # Strips C and C++ comments from the given string.
# #
# Copied from http://stackoverflow.com/a/241506/627587. # Copied from https://stackoverflow.com/a/241506/627587.
def strip_comments(text): def strip_comments(text):
def replacer(match): def replacer(match):
s = match.group(0) s = match.group(0)

View file

@ -123,7 +123,7 @@ class binary_reader
@return true if and only if system's byte order is little endian @return true if and only if system's byte order is little endian
@note from http://stackoverflow.com/a/1001328/266378 @note from https://stackoverflow.com/a/1001328/266378
*/ */
static constexpr bool little_endianess(int num = 1) noexcept static constexpr bool little_endianess(int num = 1) noexcept
{ {

View file

@ -387,7 +387,7 @@ class input_adapter
{ {
#ifndef NDEBUG #ifndef NDEBUG
// assertion to check that the iterator range is indeed contiguous, // assertion to check that the iterator range is indeed contiguous,
// see http://stackoverflow.com/a/35008842/266378 for more discussion // see https://stackoverflow.com/a/35008842/266378 for more discussion
const auto is_contiguous = std::accumulate( const auto is_contiguous = std::accumulate(
first, last, std::pair<bool, int>(true, 0), first, last, std::pair<bool, int>(true, 0),
[&first](std::pair<bool, int> res, decltype(*first) val) [&first](std::pair<bool, int> res, decltype(*first) val)

View file

@ -4,7 +4,7 @@
#include <nlohmann/detail/meta/void_t.hpp> #include <nlohmann/detail/meta/void_t.hpp>
// http://en.cppreference.com/w/cpp/experimental/is_detected // https://en.cppreference.com/w/cpp/experimental/is_detected
namespace nlohmann namespace nlohmann
{ {
namespace detail namespace detail

View file

@ -48,7 +48,7 @@ enum class value_t : std::uint8_t
number_integer, ///< number value (signed integer) number_integer, ///< number value (signed integer)
number_unsigned, ///< number value (unsigned integer) number_unsigned, ///< number value (unsigned integer)
number_float, ///< number value (floating-point) number_float, ///< number value (floating-point)
discarded ///< discarded by the the parser callback function discarded ///< discarded by the parser callback function
}; };
/*! /*!

View file

@ -151,7 +151,7 @@ relationship:
The invariants are checked by member function assert_invariant(). The invariants are checked by member function assert_invariant().
@internal @internal
@note ObjectType trick from http://stackoverflow.com/a/9860911 @note ObjectType trick from https://stackoverflow.com/a/9860911
@endinternal @endinternal
@see [RFC 7159: The JavaScript Object Notation (JSON) Data Interchange @see [RFC 7159: The JavaScript Object Notation (JSON) Data Interchange
@ -7335,7 +7335,7 @@ class basic_json
Uses a JSON pointer to retrieve a reference to the respective JSON value. Uses a JSON pointer to retrieve a reference to the respective JSON value.
No bound checking is performed. The function does not change the JSON No bound checking is performed. The function does not change the JSON
value; no `null` values are created. In particular, the the special value value; no `null` values are created. In particular, the special value
`-` yields an exception. `-` yields an exception.
@param[in] ptr JSON pointer to the desired element @param[in] ptr JSON pointer to the desired element

View file

@ -2328,7 +2328,7 @@ struct iterator_traits<T*, enable_if_t<std::is_object<T>::value>>
// #include <nlohmann/detail/meta/void_t.hpp> // #include <nlohmann/detail/meta/void_t.hpp>
// http://en.cppreference.com/w/cpp/experimental/is_detected // https://en.cppreference.com/w/cpp/experimental/is_detected
namespace nlohmann namespace nlohmann
{ {
namespace detail namespace detail
@ -2861,7 +2861,7 @@ enum class value_t : std::uint8_t
number_integer, ///< number value (signed integer) number_integer, ///< number value (signed integer)
number_unsigned, ///< number value (unsigned integer) number_unsigned, ///< number value (unsigned integer)
number_float, ///< number value (floating-point) number_float, ///< number value (floating-point)
discarded ///< discarded by the the parser callback function discarded ///< discarded by the parser callback function
}; };
/*! /*!
@ -4250,7 +4250,7 @@ class input_adapter
{ {
#ifndef NDEBUG #ifndef NDEBUG
// assertion to check that the iterator range is indeed contiguous, // assertion to check that the iterator range is indeed contiguous,
// see http://stackoverflow.com/a/35008842/266378 for more discussion // see https://stackoverflow.com/a/35008842/266378 for more discussion
const auto is_contiguous = std::accumulate( const auto is_contiguous = std::accumulate(
first, last, std::pair<bool, int>(true, 0), first, last, std::pair<bool, int>(true, 0),
[&first](std::pair<bool, int> res, decltype(*first) val) [&first](std::pair<bool, int> res, decltype(*first) val)
@ -5263,7 +5263,7 @@ class binary_reader
@return true if and only if system's byte order is little endian @return true if and only if system's byte order is little endian
@note from http://stackoverflow.com/a/1001328/266378 @note from https://stackoverflow.com/a/1001328/266378
*/ */
static constexpr bool little_endianess(int num = 1) noexcept static constexpr bool little_endianess(int num = 1) noexcept
{ {
@ -14694,7 +14694,7 @@ relationship:
The invariants are checked by member function assert_invariant(). The invariants are checked by member function assert_invariant().
@internal @internal
@note ObjectType trick from http://stackoverflow.com/a/9860911 @note ObjectType trick from https://stackoverflow.com/a/9860911
@endinternal @endinternal
@see [RFC 7159: The JavaScript Object Notation (JSON) Data Interchange @see [RFC 7159: The JavaScript Object Notation (JSON) Data Interchange
@ -21878,7 +21878,7 @@ class basic_json
Uses a JSON pointer to retrieve a reference to the respective JSON value. Uses a JSON pointer to retrieve a reference to the respective JSON value.
No bound checking is performed. The function does not change the JSON No bound checking is performed. The function does not change the JSON
value; no `null` values are created. In particular, the the special value value; no `null` values are created. In particular, the special value
`-` yields an exception. `-` yields an exception.
@param[in] ptr JSON pointer to the desired element @param[in] ptr JSON pointer to the desired element

View file

@ -1426,7 +1426,7 @@ TEST_CASE("parser class")
SECTION("tests found by mutate++") SECTION("tests found by mutate++")
{ {
// test case to make sure no comma preceeds the first key // test case to make sure no comma precedes the first key
CHECK_THROWS_AS(parser_helper("{,\"key\": false}"), json::parse_error&); CHECK_THROWS_AS(parser_helper("{,\"key\": false}"), json::parse_error&);
CHECK_THROWS_WITH(parser_helper("{,\"key\": false}"), CHECK_THROWS_WITH(parser_helper("{,\"key\": false}"),
"[json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing object key - unexpected ','; expected string literal"); "[json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing object key - unexpected ','; expected string literal");

View file

@ -36,7 +36,7 @@ using nlohmann::json;
TEST_CASE("compliance tests from json.org") TEST_CASE("compliance tests from json.org")
{ {
// test cases are from http://json.org/JSON_checker/ // test cases are from https://json.org/JSON_checker/
SECTION("expected failures") SECTION("expected failures")
{ {
@ -349,7 +349,7 @@ TEST_CASE("test suite from json-test-suite")
TEST_CASE("json.org examples") TEST_CASE("json.org examples")
{ {
// here, we list all JSON values from http://json.org/example // here, we list all JSON values from https://json.org/example
SECTION("1.json") SECTION("1.json")
{ {
@ -1361,7 +1361,7 @@ namespace
{ {
std::string trim(const std::string& str); std::string trim(const std::string& str);
// from http://stackoverflow.com/a/25829178/266378 // from https://stackoverflow.com/a/25829178/266378
std::string trim(const std::string& str) std::string trim(const std::string& str)
{ {
size_t first = str.find_first_not_of(' '); size_t first = str.find_first_not_of(' ');