Spelling fixes

This commit is contained in:
Karl Nilsson 2021-08-27 19:52:45 -04:00
parent ca9e36a484
commit 3eee515ce1
8 changed files with 22 additions and 22 deletions

View File

@ -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<toml::preserve_comments>`.
If the macro is defined, the alias `toml::value` will be
`toml::basic_value<toml::preserve_comments>`.
@ -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<double>::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<std::string>()` 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)

View File

@ -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

View File

@ -346,7 +346,7 @@ operator+(const empty_iterator<T, C>& lhs, typename empty_iterator<T, C>::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

View File

@ -166,7 +166,7 @@ using lex_basic_string = sequence<lex_quotation_mark,
// | ^- expected newline, but got '"'.
// ```
// As a quick workaround for this problem, `lex_ml_basic_string_delim` was
// splitted into two, `lex_ml_basic_string_open` and `lex_ml_basic_string_close`.
// split into two, `lex_ml_basic_string_open` and `lex_ml_basic_string_close`.
// `lex_ml_basic_string_open` allows only `"""`. `_close` allows 3-5 `"`s.
// In parse_ml_basic_string() function, the trailing `"`s will be attached to
// the string body.

View File

@ -870,7 +870,7 @@ parse_local_datetime(location& loc)
{
throw internal_error(format_underline(
"toml::parse_local_datetime: invalid datetime format",
{{source_location(inner_loc), "invalid time fomrat"}}),
{{source_location(inner_loc), "invalid time format"}}),
source_location(inner_loc));
}
return ok(std::make_pair(
@ -1367,7 +1367,7 @@ insert_nested_key(typename Value::table_type& root, const Value& v,
// b = 54
// ```
// Here, from the type information, these cannot be detected
// bacause inline table is also a table.
// because inline table is also a table.
// But toml v0.5.0 explicitly says it is invalid. The above
// array-of-tables has a static size and appending to the
// array is invalid.
@ -1417,7 +1417,7 @@ insert_nested_key(typename Value::table_type& root, const Value& v,
// ```toml
// # comment 1
// aot = [
// # coment 2
// # comment 2
// {foo = "bar"},
// ]
// ```
@ -1904,7 +1904,7 @@ parse_table_key(location& loc)
source_location(inner_loc));
}
// after [table.key], newline or EOF(empty table) requried.
// after [table.key], newline or EOF(empty table) required.
if(loc.iter() != loc.end())
{
using lex_newline_after_table_key =
@ -1961,7 +1961,7 @@ parse_array_table_key(location& loc)
source_location(inner_loc));
}
// after [[table.key]], newline or EOF(empty table) requried.
// after [[table.key]], newline or EOF(empty table) required.
if(loc.iter() != loc.end())
{
using lex_newline_after_table_key =
@ -2252,7 +2252,7 @@ basic_value<Comment, Table, Array> 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<typename Comment = TOML11_DEFAULT_COMMENT_STRATEGY,
template<typename ...> class Table = std::unordered_map,

View File

@ -854,7 +854,7 @@ template<typename charT, typename traits>
std::basic_ostream<charT, traits>&
nocomment(std::basic_ostream<charT, traits>& 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<typename charT, typename traits>
std::basic_ostream<charT, traits>&
showcomment(std::basic_ostream<charT, traits>& 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<charT, traits>& os, const basic_value<C, M, V>& v)
const int fprec = static_cast<int>(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)));

View File

@ -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

View File

@ -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(