mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-09-17 17:58:09 +08:00
Spelling fixes
This commit is contained in:
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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.
|
||||
|
@@ -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,
|
||||
|
@@ -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)));
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -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(
|
||||
|
Reference in New Issue
Block a user