From 3eee515ce1f9894e2c96bfc00cd463279376bf13 Mon Sep 17 00:00:00 2001 From: Karl Nilsson Date: Fri, 27 Aug 2021 19:52:45 -0400 Subject: [PATCH] Spelling fixes --- README.md | 14 +++++++------- toml/combinator.hpp | 2 +- toml/comments.hpp | 2 +- toml/lexer.hpp | 2 +- toml/parser.hpp | 12 ++++++------ toml/serializer.hpp | 6 +++--- toml/types.hpp | 2 +- toml/value.hpp | 4 ++-- 8 files changed, 22 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 4257bf5..99e6bbb 100644 --- a/README.md +++ b/README.md @@ -251,7 +251,7 @@ See also [underlying types](#underlying-types). **NOTE**: For some technical reason, automatic conversion between `integer` and `floating` is not supported. If you want to get a floating value even if a value has integer value, you need to convert it manually after obtaining a value, -like the followings. +like the following. ```cpp const auto vx = toml::find(data, "x"); @@ -905,7 +905,7 @@ toml::visit([](const auto& val) -> void { ``` The function object that would be passed to `toml::visit` must be able to -recieve all the possible TOML types. Also, the result types should be the same +receive all the possible TOML types. Also, the result types should be the same each other. ## Constructing a toml::value @@ -988,7 +988,7 @@ or macro definition. This feature is controlled by template parameter in `toml::basic_value<...>`. `toml::value` is an alias of `toml::basic_value<...>`. -If template paramter is explicitly specified, the return value of `toml::parse` +If template parameter is explicitly specified, the return value of `toml::parse` will be `toml::basic_value`. If the macro is defined, the alias `toml::value` will be `toml::basic_value`. @@ -1618,7 +1618,7 @@ it uses [ANSI escape code](https://en.wikipedia.org/wiki/ANSI_escape_code). Without `TOML11_COLORIZE_ERROR_MESSAGE`, you can still colorize user-defined error message by passing `true` to the `toml::format_error` function. If you define `TOML11_COLORIZE_ERROR_MESSAGE`, the value is `true` by default. -If not, the defalut value would be `false`. +If not, the default value would be `false`. ```cpp std::cerr << toml::format_error("[error] value should be positive", @@ -1719,7 +1719,7 @@ const std::string fmt = toml::format(v); ``` To control the width and precision, `toml::format` receives optional second and -third arguments to set them. By default, the witdh is 80 and the precision is +third arguments to set them. By default, the width is 80 and the precision is `std::numeric_limits::max_digit10`. ```cpp @@ -1755,7 +1755,7 @@ flag that represents a kind of a string, `string_t::basic` and `string_t::litera Although `std::string` is not an exact toml type, still you can get a reference that points to internal `std::string` by using `toml::get()` for convenience. The most important difference between `std::string` and `toml::string` is that -`toml::string` will be formatted as a TOML string when outputed with `ostream`. +`toml::string` will be formatted as a TOML string when outputted with `ostream`. This feature is introduced to make it easy to write a custom serializer. `Datetime` variants are `struct` that are defined in this library. @@ -1906,7 +1906,7 @@ I appreciate the help of the contributors who introduced the great feature to th - Intel Compiler support - Quentin Khan (@xaxousis) - Found & Fixed a bug around ODR - - Improved error messages for invaild keys to show the location where the parser fails + - Improved error messages for invalid keys to show the location where the parser fails - Petr Beneš (@wbenny) - Fixed warnings on MSVC - Ivan Shynkarenka (@chronoxor) diff --git a/toml/combinator.hpp b/toml/combinator.hpp index e250188..5d86c19 100644 --- a/toml/combinator.hpp +++ b/toml/combinator.hpp @@ -29,7 +29,7 @@ namespace detail // to output character as an error message. inline std::string show_char(const char c) { - // It supress an error that occurs only in Debug mode of MSVC++ on Windows. + // It suppresses an error that occurs only in Debug mode of MSVC++ on Windows. // I'm not completely sure but they check the value of char to be in the // range [0, 256) and some of the COMPLETELY VALID utf-8 character sometimes // has negative value (if char has sign). So here it re-interprets c as diff --git a/toml/comments.hpp b/toml/comments.hpp index b9ce806..ec25041 100644 --- a/toml/comments.hpp +++ b/toml/comments.hpp @@ -346,7 +346,7 @@ operator+(const empty_iterator& lhs, typename empty_iterator::differ // // Why this is chose as the default type is because the last version (2.x.y) // does not contain any comments in a value. To minimize the impact on the -// efficiency, this is choosed as a default. +// efficiency, this is chosen as a default. // // To reduce the memory footprint, later we can try empty base optimization (EBO). struct discard_comments diff --git a/toml/lexer.hpp b/toml/lexer.hpp index 046cdf7..ea5050b 100644 --- a/toml/lexer.hpp +++ b/toml/lexer.hpp @@ -166,7 +166,7 @@ using lex_basic_string = sequence parse(const std::string& fname) // Without this, both parse(std::string) and parse(std::filesystem::path) // matches to parse("filename.toml"). This breaks the existing code. // -// This function exactly matches to the invokation with c-string. +// This function exactly matches to the invocation with c-string. // So this function is preferred than others and the ambiguity disappears. template class Table = std::unordered_map, diff --git a/toml/serializer.hpp b/toml/serializer.hpp index 392f387..d7987c0 100644 --- a/toml/serializer.hpp +++ b/toml/serializer.hpp @@ -854,7 +854,7 @@ template std::basic_ostream& nocomment(std::basic_ostream& os) { - // by default, it is zero. and by defalut, it shows comments. + // by default, it is zero. and by default, it shows comments. os.iword(detail::comment_index(os)) = 1; return os; } @@ -863,7 +863,7 @@ template std::basic_ostream& showcomment(std::basic_ostream& os) { - // by default, it is zero. and by defalut, it shows comments. + // by default, it is zero. and by default, it shows comments. os.iword(detail::comment_index(os)) = 0; return os; } @@ -880,7 +880,7 @@ operator<<(std::basic_ostream& os, const basic_value& v) const int fprec = static_cast(os.precision()); os.width(0); - // by defualt, iword is initialized byl 0. And by default, toml11 outputs + // by default, iword is initialized by 0. And by default, toml11 outputs // comments. So `0` means showcomment. 1 means nocommnet. const bool no_comment = (1 == os.iword(detail::comment_index(os))); diff --git a/toml/types.hpp b/toml/types.hpp index 7bf4b2e..1e420e7 100644 --- a/toml/types.hpp +++ b/toml/types.hpp @@ -28,7 +28,7 @@ using key = std::string; using boolean = bool; using integer = std::int64_t; -using floating = double; // "float" is a keyward, cannot use it here. +using floating = double; // "float" is a keyword, cannot use it here. // the following stuffs are structs defined here, so aliases are not needed. // - string // - offset_datetime diff --git a/toml/value.hpp b/toml/value.hpp index 7c68514..ecae2c3 100644 --- a/toml/value.hpp +++ b/toml/value.hpp @@ -101,7 +101,7 @@ throw_key_not_found_error(const Value& v, const key& ky) // ```toml // a = {b = "c"} // ``` - // toml11 consideres the inline table body as the table region. Here, + // toml11 considers the inline table body as the table region. Here, // `{b = "c"}` is the region of the table "a". The size of the region // is 9, not 1. The shotest inline table still has two characters, `{` // and `}`. The size cannot be 1. @@ -110,7 +110,7 @@ throw_key_not_found_error(const Value& v, const key& ky) // ```toml // [a] // ``` - // toml11 consideres the whole table key as the table region. Here, + // toml11 considers the whole table key as the table region. Here, // `[a]` is the table region. The size is 3, not 1. // throw std::out_of_range(format_underline(concat_to_string(