big parser + utf8 handling refactor

This commit is contained in:
Mark Gillard 2021-11-05 00:43:42 +02:00
parent ff6f184d30
commit 16d7ba8480
50 changed files with 1136 additions and 968 deletions

View File

@ -10,16 +10,9 @@
#define TOML_ENABLE_UNRELEASED_FEATURES 0
#include <toml++/toml.h>
namespace
{
using namespace std::string_view_literals;
using namespace std::chrono_literals;
using clock = std::chrono::steady_clock;
using std::chrono::nanoseconds;
using std::chrono::duration;
using namespace std::string_view_literals;
static constexpr size_t iterations = 10000;
}
static constexpr size_t iterations = 10000;
int main(int argc, char** argv)
{
@ -74,16 +67,14 @@ int main(int argc, char** argv)
// run the benchmark
std::cout << "Parsing '"sv << file_path << "' "sv << iterations << " times...\n"sv;
nanoseconds cumulative;
std::chrono::nanoseconds cumulative;
for (size_t i = 0; i < iterations; i++)
{
{
const auto start = clock::now();
const auto result = toml::parse(file_content);
cumulative += clock::now() - start;
}
const auto start = std::chrono::steady_clock::now();
const auto result = toml::parse(file_content);
cumulative += std::chrono::steady_clock::now() - start;
}
const auto cumulative_sec = std::chrono::duration_cast<duration<double>>(cumulative).count();
const auto cumulative_sec = std::chrono::duration_cast<std::chrono::duration<double>>(cumulative).count();
const auto mean_sec = cumulative_sec / static_cast<double>(iterations);
std::cout << " total: "sv << cumulative_sec << " s\n"sv
<< " mean: "sv << mean_sec << " s\n"sv;

View File

@ -130,7 +130,7 @@ TOML_IMPL_NAMESPACE_START
}
else if (decoder.has_code_point())
{
if (is_line_break(decoder.codepoint))
if (is_vertical_whitespace(decoder.codepoint))
has_line_breaks = true;
else if (is_nontab_control_character(decoder.codepoint)
|| (treat_raw_tab_as_control_char && decoder.codepoint == U'\t'))

View File

@ -942,7 +942,7 @@ TOML_IMPL_NAMESPACE_START
template <typename T>
TOML_PURE_GETTER
inline T& min(T & a, T & b) noexcept //
inline const T& min(const T& a, const T& b) noexcept //
{
return a < b ? a : b;
}

File diff suppressed because it is too large Load Diff

View File

@ -398,6 +398,14 @@
#define TOML_ENABLE_FORMATTERS 1
#endif
// SIMD
#if !defined(TOML_ENABLE_SIMD) \
|| (defined(TOML_ENABLE_SIMD) && TOML_ENABLE_SIMD) \
|| TOML_INTELLISENSE
#undef TOML_ENABLE_SIMD
#define TOML_ENABLE_SIMD 1
#endif
// windows compat
#if !defined(TOML_ENABLE_WINDOWS_COMPAT) && defined(TOML_WINDOWS_COMPAT) // was TOML_WINDOWS_COMPAT pre-3.0
#define TOML_ENABLE_WINDOWS_COMPAT TOML_WINDOWS_COMPAT

View File

@ -0,0 +1,35 @@
//# This file is a part of toml++ and is subject to the the terms of the MIT license.
//# Copyright (c) Mark Gillard <mark.gillard@outlook.com.au>
//# See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
// SPDX-License-Identifier: MIT
#pragma once
#include "preprocessor.h"
#if TOML_ENABLE_SIMD
#if defined(__SSE2__) \
|| (defined(_MSC_VER) && (defined(_M_AMD64) || defined(_M_X64) || (defined(_M_IX86_FP) && _M_IX86_FP >= 2)))
#define TOML_HAS_SSE2 1
#endif
#if defined(__SSE4_1__) || (defined(_MSC_VER) && (defined(__AVX__) || defined(__AVX2__)))
#define TOML_HAS_SSE4_1 1
#endif
#endif // TOML_ENABLE_SIMD
#ifndef TOML_HAS_SSE2
#define TOML_HAS_SSE2 0
#endif
#ifndef TOML_HAS_SSE4_1
#define TOML_HAS_SSE4_1 0
#endif
TOML_DISABLE_WARNINGS;
#if TOML_HAS_SSE4_1
#include <smmintrin.h>
#endif
#if TOML_HAS_SSE2
#include <emmintrin.h>
#endif
TOML_ENABLE_WARNINGS;

View File

@ -8,100 +8,44 @@
#include "header_start.h"
/// \cond
#if TOML_GCC && TOML_GCC < 9
#pragma GCC push_options
#pragma GCC optimize("O1") // codegen bugs
#endif
TOML_IMPL_NAMESPACE_START
{
TOML_PURE_GETTER
TOML_ATTR(nonnull)
constexpr bool is_ascii(const char* str, size_t size) noexcept
// note: a number of these functions were machine-generated. you'll know them when you see them.
// they are tested separately in another project, I promise!
TOML_CONST_GETTER
constexpr bool is_string_delimiter(char32_t c) noexcept
{
for (const char* const e = str + size; str < e; str++)
if (static_cast<unsigned char>(*str) > 127u)
return false;
return true;
return c == U'"' || c == U'\'';
}
TOML_CONST_GETTER
constexpr bool is_ascii_whitespace(char32_t codepoint) noexcept
constexpr bool is_ascii_letter(char32_t c) noexcept
{
return codepoint == U'\t' || codepoint == U' ';
return (c >= U'a' && c <= U'z') || (c >= U'A' && c <= U'Z');
}
TOML_CONST_GETTER
constexpr bool is_non_ascii_whitespace(char32_t codepoint) noexcept
constexpr bool is_binary_digit(char32_t c) noexcept
{
// see: https://en.wikipedia.org/wiki/Whitespace_character#Unicode
// (characters that don't say "is a line-break")
return codepoint == U'\u00A0' // no-break space
|| codepoint == U'\u1680' // ogham space mark
|| (codepoint >= U'\u2000' && codepoint <= U'\u200A') // em quad -> hair space
|| codepoint == U'\u202F' // narrow no-break space
|| codepoint == U'\u205F' // medium mathematical space
|| codepoint == U'\u3000' // ideographic space
;
return c == U'0' || c == U'1';
}
TOML_CONST_GETTER
constexpr bool is_whitespace(char32_t codepoint) noexcept
constexpr bool is_octal_digit(char32_t c) noexcept
{
return is_ascii_whitespace(codepoint) || is_non_ascii_whitespace(codepoint);
}
template <bool IncludeCarriageReturn = true>
TOML_CONST_GETTER
constexpr bool is_ascii_line_break(char32_t codepoint) noexcept
{
constexpr auto low_range_end = IncludeCarriageReturn ? U'\r' : U'\f';
return (codepoint >= U'\n' && codepoint <= low_range_end);
return (c >= U'0' && c <= U'7');
}
TOML_CONST_GETTER
constexpr bool is_non_ascii_line_break(char32_t codepoint) noexcept
constexpr bool is_decimal_digit(char32_t c) noexcept
{
// see https://en.wikipedia.org/wiki/Whitespace_character#Unicode
// (characters that say "is a line-break")
return codepoint == U'\u0085' // next line
|| codepoint == U'\u2028' // line separator
|| codepoint == U'\u2029' // paragraph separator
;
}
template <bool IncludeCarriageReturn = true>
TOML_CONST_GETTER
constexpr bool is_line_break(char32_t codepoint) noexcept
{
return is_ascii_line_break<IncludeCarriageReturn>(codepoint) || is_non_ascii_line_break(codepoint);
}
TOML_CONST_GETTER
constexpr bool is_string_delimiter(char32_t codepoint) noexcept
{
return codepoint == U'"' || codepoint == U'\'';
}
TOML_CONST_GETTER
constexpr bool is_ascii_letter(char32_t codepoint) noexcept
{
return (codepoint >= U'a' && codepoint <= U'z') || (codepoint >= U'A' && codepoint <= U'Z');
}
TOML_CONST_GETTER
constexpr bool is_binary_digit(char32_t codepoint) noexcept
{
return codepoint == U'0' || codepoint == U'1';
}
TOML_CONST_GETTER
constexpr bool is_octal_digit(char32_t codepoint) noexcept
{
return (codepoint >= U'0' && codepoint <= U'7');
}
TOML_CONST_GETTER
constexpr bool is_decimal_digit(char32_t codepoint) noexcept
{
return (codepoint >= U'0' && codepoint <= U'9');
return (c >= U'0' && c <= U'9');
}
TOML_CONST_GETTER
@ -112,15 +56,79 @@ TOML_IMPL_NAMESPACE_START
template <typename T>
TOML_CONST_GETTER
constexpr uint_least32_t hex_to_dec(const T codepoint) noexcept
constexpr uint_least32_t hex_to_dec(const T c) noexcept
{
if constexpr (std::is_same_v<remove_cvref<T>, uint_least32_t>)
return codepoint >= 0x41u // >= 'A'
? 10u + (codepoint | 0x20u) - 0x61u // - 'a'
: codepoint - 0x30u // - '0'
return c >= 0x41u // >= 'A'
? 10u + (c | 0x20u) - 0x61u // - 'a'
: c - 0x30u // - '0'
;
else
return hex_to_dec(static_cast<uint_least32_t>(codepoint));
return hex_to_dec(static_cast<uint_least32_t>(c));
}
TOML_CONST_GETTER
constexpr bool is_ascii_horizontal_whitespace(char32_t c) noexcept
{
return c == U'\t' || c == U' ';
}
TOML_CONST_GETTER
constexpr bool is_non_ascii_horizontal_whitespace(char32_t c) noexcept
{
if (c < U'\xA0' || c > U'\uFEFF')
return false;
const auto child_index_0 = (static_cast<uint_least64_t>(c) - 0xA0ull) / 0x3FAull;
if ((1ull << child_index_0) & 0x7FFFFFFFFFFFF75Eull)
return false;
if (c == U'\xA0' || c == U'\u3000' || c == U'\uFEFF')
return true;
switch (child_index_0)
{
case 0x05: return c == U'\u1680' || c == U'\u180E';
case 0x07:
return (U'\u2000' <= c && c <= U'\u200B') || (U'\u205F' <= c && c <= U'\u2060') || c == U'\u202F';
default: TOML_UNREACHABLE;
}
// 20 code units from 8 ranges (spanning a search area of 65120)
TOML_UNREACHABLE;
}
TOML_CONST_GETTER
constexpr bool is_horizontal_whitespace(char32_t c) noexcept
{
return is_ascii_horizontal_whitespace(c) || is_non_ascii_horizontal_whitespace(c);
}
TOML_CONST_GETTER
constexpr bool is_vertical_whitespace(char32_t c) noexcept
{
return (U'\n' <= c && c <= U'\r') || (U'\u2028' <= c && c <= U'\u2029') || c == U'\x85';
}
TOML_CONST_GETTER
constexpr bool is_vertical_whitespace_excl_cr(char32_t c) noexcept
{
return (U'\n' <= c && c <= U'\f') || (U'\u2028' <= c && c <= U'\u2029') || c == U'\x85';
}
TOML_CONST_GETTER
constexpr bool is_whitespace(char32_t c) noexcept
{
return is_horizontal_whitespace(c) || is_vertical_whitespace(c);
}
TOML_CONST_GETTER
constexpr bool is_ascii_bare_key_character(char32_t c) noexcept
{
if (c < U'-' || c > U'z')
return false;
if ((1ull << (static_cast<uint_least64_t>(c) - 0x2Du)) & 0xFFF43FFFFFF01FF9ull)
return true;
return (((static_cast<uint_least64_t>(c) - 0x2Dull) / 0x40ull) != 0)
|| ((1ull << (static_cast<uint_least64_t>(c) - 0x2Du)) & 0xFFF43FFFFFF01FF9ull);
}
#if TOML_LANG_UNRELEASED // toml/issues/687 (unicode bare keys)
@ -841,43 +849,47 @@ TOML_IMPL_NAMESPACE_START
TOML_UNREACHABLE;
}
TOML_CONST_GETTER
constexpr bool is_non_ascii_bare_key_character(char32_t c) noexcept
{
return is_non_ascii_letter(c) || is_non_ascii_number(c) || is_combining_mark(c);
}
#endif // TOML_LANG_UNRELEASED
TOML_CONST_GETTER
constexpr bool is_bare_key_character(char32_t codepoint) noexcept
constexpr bool is_bare_key_character(char32_t c) noexcept
{
return is_ascii_letter(codepoint) || is_decimal_digit(codepoint) || codepoint == U'-' || codepoint == U'_'
return is_ascii_bare_key_character(c)
#if TOML_LANG_UNRELEASED // toml/issues/644 ('+' in bare keys) & toml/issues/687 (unicode bare keys)
|| codepoint == U'+' || is_non_ascii_letter(codepoint) || is_non_ascii_number(codepoint)
|| is_combining_mark(codepoint)
|| c == U'+' //
|| is_non_ascii_bare_key_character(c)
#endif
;
}
TOML_CONST_GETTER
constexpr bool is_value_terminator(char32_t codepoint) noexcept
constexpr bool is_value_terminator(char32_t c) noexcept
{
return is_ascii_line_break(codepoint) || is_ascii_whitespace(codepoint) || codepoint == U']'
|| codepoint == U'}' || codepoint == U',' || codepoint == U'#' || is_non_ascii_line_break(codepoint)
|| is_non_ascii_whitespace(codepoint);
return is_whitespace(c) || c == U']' || c == U'}' || c == U',' || c == U'#';
}
TOML_CONST_GETTER
constexpr bool is_control_character(char32_t codepoint) noexcept
constexpr bool is_control_character(char32_t c) noexcept
{
return codepoint <= U'\u001F' || codepoint == U'\u007F';
return c <= U'\u001F' || c == U'\u007F';
}
TOML_CONST_GETTER
constexpr bool is_nontab_control_character(char32_t codepoint) noexcept
constexpr bool is_nontab_control_character(char32_t c) noexcept
{
return codepoint <= U'\u0008' || (codepoint >= U'\u000A' && codepoint <= U'\u001F') || codepoint == U'\u007F';
return c <= U'\u0008' || (c >= U'\u000A' && c <= U'\u001F') || c == U'\u007F';
}
TOML_CONST_GETTER
constexpr bool is_unicode_surrogate(char32_t codepoint) noexcept
constexpr bool is_unicode_surrogate(char32_t c) noexcept
{
return codepoint >= 0xD800u && codepoint <= 0xDFFF;
return c >= 0xD800u && c <= 0xDFFF;
}
struct utf8_decoder
@ -921,7 +933,7 @@ TOML_IMPL_NAMESPACE_START
TOML_PURE_INLINE_GETTER
constexpr bool needs_more_input() const noexcept
{
return state > uint_least32_t{} && state != uint_least32_t{ 12u };
return !has_code_point() && !error();
}
constexpr void operator()(uint8_t byte) noexcept
@ -946,5 +958,9 @@ TOML_IMPL_NAMESPACE_START
}
TOML_IMPL_NAMESPACE_END;
#if TOML_GCC && TOML_GCC < 9
#pragma GCC pop_options
#endif
/// \endcond
#include "header_end.h"

View File

@ -109,6 +109,8 @@ TOML_POP_WARNINGS;
#undef TOML_HAS_CHAR8
#undef TOML_HAS_CUSTOM_OPTIONAL_TYPE
#undef TOML_HAS_INCLUDE
#undef TOML_HAS_SSE2
#undef TOML_HAS_SSE4_1
#undef TOML_HIDDEN_CONSTRAINT
#undef TOML_ICC
#undef TOML_ICC_CL

View File

@ -76,7 +76,7 @@ namespace
return diff;
}
if (impl::is_line_break(a.codepoint))
if (impl::is_vertical_whitespace_excl_cr(a.codepoint))
{
diff.position.line++;
diff.position.column = 1u;

View File

@ -20,7 +20,6 @@ test_sources = [
'manipulating_arrays.cpp',
'manipulating_tables.cpp',
'manipulating_values.cpp',
'unicode.cpp',
'user_feedback.cpp',
'using_iterators.cpp',
'windows_compat.cpp'

View File

@ -186,7 +186,7 @@ inline bool parse_expected_value(std::string_view test_file,
if (!decoder.has_code_point())
continue;
if (impl::is_line_break(decoder.codepoint))
if (impl::is_vertical_whitespace_excl_cr(decoder.codepoint))
{
if (decoder.codepoint != U'\r')
{

View File

@ -1,207 +0,0 @@
// This file is a part of toml++ and is subject to the the terms of the MIT license.
// Copyright (c) Mark Gillard <mark.gillard@outlook.com.au>
// See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
// SPDX-License-Identifier: MIT
#include "tests.h"
using namespace toml::impl;
using func_type = bool(char32_t) noexcept;
inline constexpr func_type* funcs[] = {
// these must be mutually-exclusive
impl::is_ascii_letter, impl::is_ascii_whitespace, impl::is_ascii_line_break<true>,
impl::is_decimal_digit, impl::is_string_delimiter, impl::is_non_ascii_whitespace,
impl::is_non_ascii_line_break, impl::is_unicode_surrogate,
#if TOML_LANG_UNRELEASED
impl::is_non_ascii_letter, impl::is_non_ascii_number, impl::is_combining_mark,
#endif
};
template <typename T>
inline bool in_only(func_type* fptr, T cp) noexcept
{
if (!fptr(static_cast<char32_t>(cp)))
return false;
for (auto fn : funcs)
{
if (fn == fptr)
continue;
if (fn(static_cast<char32_t>(cp)))
return false;
}
return true;
}
inline constexpr uint32_t unimax = 0x10FFFFu;
struct codepoint_range
{
char32_t first;
char32_t last;
template <typename T, typename U>
TOML_NODISCARD_CTOR
constexpr codepoint_range(T first_, U last_) noexcept
: first{ static_cast<char32_t>(first_) },
last{ static_cast<char32_t>(last_) }
{
if (last < first)
std::swap(first, last);
}
template <typename T>
TOML_NODISCARD_CTOR
constexpr codepoint_range(T first_) noexcept //
: first{ static_cast<char32_t>(first_) },
last{ first }
{}
};
inline bool in(func_type* fptr, codepoint_range range) noexcept
{
for (auto cp = range.first; cp <= range.last; cp++)
if (!fptr(cp))
return false;
return true;
}
inline bool in_only(func_type* fptr, codepoint_range range) noexcept
{
for (auto cp = range.first; cp <= range.last; cp++)
if (!in_only(fptr, cp))
return false;
return true;
}
inline bool not_in(func_type* fptr, codepoint_range range) noexcept
{
for (auto cp = range.first; cp <= range.last; cp++)
if (fptr(cp))
return false;
return true;
}
TEST_CASE("unicode - is_ascii_letter")
{
static constexpr auto fn = is_ascii_letter;
REQUIRE(not_in(fn, { U'\0', U'@' }));
REQUIRE(in_only(fn, { U'A', U'Z' }));
REQUIRE(not_in(fn, { U'[', U'`' }));
REQUIRE(in_only(fn, { U'a', U'z' }));
REQUIRE(not_in(fn, { U'{', unimax }));
}
TEST_CASE("unicode - is_ascii_whitespace")
{
static constexpr auto fn = is_ascii_whitespace;
REQUIRE(not_in(fn, { U'\0', U'\u0008' }));
REQUIRE(in_only(fn, U'\t'));
REQUIRE(not_in(fn, { U'\n', U'\u001F' }));
REQUIRE(in_only(fn, U' '));
REQUIRE(not_in(fn, { U'!', unimax }));
}
TEST_CASE("unicode - is_ascii_line_break")
{
static constexpr auto fn = is_ascii_line_break<true>;
REQUIRE(not_in(fn, { U'\0', U'\t' }));
REQUIRE(in_only(fn, { U'\n', U'\r' }));
REQUIRE(not_in(fn, { U'\u000E', unimax }));
}
TEST_CASE("unicode - is_binary_digit")
{
static constexpr auto fn = is_binary_digit;
REQUIRE(not_in(fn, { U'\0', U'/' }));
REQUIRE(in(fn, { U'0', U'1' }));
REQUIRE(not_in(fn, { U'2', unimax }));
}
TEST_CASE("unicode - is_octal_digit")
{
static constexpr auto fn = is_octal_digit;
REQUIRE(not_in(fn, { U'\0', U'/' }));
REQUIRE(in(fn, { U'0', U'7' }));
REQUIRE(not_in(fn, { U'8', unimax }));
}
TEST_CASE("unicode - is_decimal_digit")
{
static constexpr auto fn = is_decimal_digit;
REQUIRE(not_in(fn, { U'\0', U'/' }));
REQUIRE(in(fn, { U'0', U'9' }));
REQUIRE(not_in(fn, { U':', unimax }));
}
TEST_CASE("unicode - hex_to_dec")
{
REQUIRE(hex_to_dec(U'0') == 0x0u);
REQUIRE(hex_to_dec(U'1') == 0x1u);
REQUIRE(hex_to_dec(U'2') == 0x2u);
REQUIRE(hex_to_dec(U'3') == 0x3u);
REQUIRE(hex_to_dec(U'4') == 0x4u);
REQUIRE(hex_to_dec(U'5') == 0x5u);
REQUIRE(hex_to_dec(U'6') == 0x6u);
REQUIRE(hex_to_dec(U'7') == 0x7u);
REQUIRE(hex_to_dec(U'8') == 0x8u);
REQUIRE(hex_to_dec(U'9') == 0x9u);
REQUIRE(hex_to_dec(U'A') == 0xAu);
REQUIRE(hex_to_dec(U'B') == 0xBu);
REQUIRE(hex_to_dec(U'C') == 0xCu);
REQUIRE(hex_to_dec(U'D') == 0xDu);
REQUIRE(hex_to_dec(U'E') == 0xEu);
REQUIRE(hex_to_dec(U'F') == 0xFu);
REQUIRE(hex_to_dec(U'a') == 0xau);
REQUIRE(hex_to_dec(U'b') == 0xbu);
REQUIRE(hex_to_dec(U'c') == 0xcu);
REQUIRE(hex_to_dec(U'd') == 0xdu);
REQUIRE(hex_to_dec(U'e') == 0xeu);
REQUIRE(hex_to_dec(U'f') == 0xfu);
}
TEST_CASE("unicode - is_string_delimiter")
{
static constexpr auto fn = is_string_delimiter;
REQUIRE(not_in(fn, { U'\0', U'!' }));
REQUIRE(in_only(fn, U'"'));
REQUIRE(not_in(fn, { U'#', U'&' }));
REQUIRE(in_only(fn, U'\''));
REQUIRE(not_in(fn, { U'(', unimax }));
}
TEST_CASE("unicode - is_non_ascii_whitespace")
{
static constexpr auto fn = is_non_ascii_whitespace;
REQUIRE(not_in(fn, { U'\0', U'\u009F' }));
REQUIRE(in_only(fn, U'\u00A0'));
REQUIRE(not_in(fn, { U'\u00A1', U'\u167F' }));
REQUIRE(in_only(fn, U'\u1680'));
REQUIRE(not_in(fn, { U'\u1681', U'\u1FFF' }));
REQUIRE(in_only(fn, { U'\u2000', U'\u200A' }));
REQUIRE(not_in(fn, { U'\u200B', U'\u202E' }));
REQUIRE(in_only(fn, U'\u202F'));
REQUIRE(not_in(fn, { U'\u2030', U'\u205E' }));
REQUIRE(in_only(fn, U'\u205F'));
REQUIRE(not_in(fn, { U'\u2060', U'\u2FFF' }));
REQUIRE(in_only(fn, U'\u3000'));
REQUIRE(not_in(fn, { U'\u3001', unimax }));
}
TEST_CASE("unicode - is_non_ascii_line_break")
{
static constexpr auto fn = is_non_ascii_line_break;
REQUIRE(not_in(fn, { U'\0', U'\u0084' }));
REQUIRE(in_only(fn, U'\u0085'));
REQUIRE(not_in(fn, { U'\u0086', U'\u2027' }));
REQUIRE(in_only(fn, { U'\u2028', U'\u2029' }));
REQUIRE(not_in(fn, { U'\u202A', unimax }));
}
TEST_CASE("unicode - is_unicode_surrogate")
{
static constexpr auto fn = is_unicode_surrogate;
REQUIRE(not_in(fn, { U'\0', 0xD7FFu }));
REQUIRE(in_only(fn, { 0xD800u, 0xDFFF }));
REQUIRE(not_in(fn, { 0xE000, unimax }));
}

View File

View File

@ -101,7 +101,6 @@
<ClCompile Include="..\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\unicode.cpp" />
<ClCompile Include="..\user_feedback.cpp" />
<ClCompile Include="..\using_iterators.cpp" />
<ClCompile Include="..\windows_compat.cpp" />

View File

@ -101,7 +101,6 @@
<ClCompile Include="..\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\unicode.cpp" />
<ClCompile Include="..\user_feedback.cpp" />
<ClCompile Include="..\using_iterators.cpp" />
<ClCompile Include="..\windows_compat.cpp" />

View File

@ -101,7 +101,6 @@
<ClCompile Include="..\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\unicode.cpp" />
<ClCompile Include="..\user_feedback.cpp" />
<ClCompile Include="..\using_iterators.cpp" />
<ClCompile Include="..\windows_compat.cpp" />

View File

@ -101,7 +101,6 @@
<ClCompile Include="..\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\unicode.cpp" />
<ClCompile Include="..\user_feedback.cpp" />
<ClCompile Include="..\using_iterators.cpp" />
<ClCompile Include="..\windows_compat.cpp" />

View File

@ -101,7 +101,6 @@
<ClCompile Include="..\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\unicode.cpp" />
<ClCompile Include="..\user_feedback.cpp" />
<ClCompile Include="..\using_iterators.cpp" />
<ClCompile Include="..\windows_compat.cpp" />

View File

@ -101,7 +101,6 @@
<ClCompile Include="..\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\unicode.cpp" />
<ClCompile Include="..\user_feedback.cpp" />
<ClCompile Include="..\using_iterators.cpp" />
<ClCompile Include="..\windows_compat.cpp" />

View File

@ -101,7 +101,6 @@
<ClCompile Include="..\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\unicode.cpp" />
<ClCompile Include="..\user_feedback.cpp" />
<ClCompile Include="..\using_iterators.cpp" />
<ClCompile Include="..\windows_compat.cpp" />

View File

@ -101,7 +101,6 @@
<ClCompile Include="..\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\unicode.cpp" />
<ClCompile Include="..\user_feedback.cpp" />
<ClCompile Include="..\using_iterators.cpp" />
<ClCompile Include="..\windows_compat.cpp" />

View File

@ -101,7 +101,6 @@
<ClCompile Include="..\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\unicode.cpp" />
<ClCompile Include="..\user_feedback.cpp" />
<ClCompile Include="..\using_iterators.cpp" />
<ClCompile Include="..\windows_compat.cpp" />

View File

@ -101,7 +101,6 @@
<ClCompile Include="..\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\unicode.cpp" />
<ClCompile Include="..\user_feedback.cpp" />
<ClCompile Include="..\using_iterators.cpp" />
<ClCompile Include="..\windows_compat.cpp" />

View File

@ -101,7 +101,6 @@
<ClCompile Include="..\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\unicode.cpp" />
<ClCompile Include="..\user_feedback.cpp" />
<ClCompile Include="..\using_iterators.cpp" />
<ClCompile Include="..\windows_compat.cpp" />

View File

@ -101,7 +101,6 @@
<ClCompile Include="..\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\unicode.cpp" />
<ClCompile Include="..\user_feedback.cpp" />
<ClCompile Include="..\using_iterators.cpp" />
<ClCompile Include="..\windows_compat.cpp" />

View File

@ -101,7 +101,6 @@
<ClCompile Include="..\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\unicode.cpp" />
<ClCompile Include="..\user_feedback.cpp" />
<ClCompile Include="..\using_iterators.cpp" />
<ClCompile Include="..\windows_compat.cpp" />

View File

@ -101,7 +101,6 @@
<ClCompile Include="..\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\unicode.cpp" />
<ClCompile Include="..\user_feedback.cpp" />
<ClCompile Include="..\using_iterators.cpp" />
<ClCompile Include="..\windows_compat.cpp" />

View File

@ -101,7 +101,6 @@
<ClCompile Include="..\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\unicode.cpp" />
<ClCompile Include="..\user_feedback.cpp" />
<ClCompile Include="..\using_iterators.cpp" />
<ClCompile Include="..\windows_compat.cpp" />

View File

@ -101,7 +101,6 @@
<ClCompile Include="..\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\unicode.cpp" />
<ClCompile Include="..\user_feedback.cpp" />
<ClCompile Include="..\using_iterators.cpp" />
<ClCompile Include="..\windows_compat.cpp" />

View File

@ -101,7 +101,6 @@
<ClCompile Include="..\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\unicode.cpp" />
<ClCompile Include="..\user_feedback.cpp" />
<ClCompile Include="..\using_iterators.cpp" />
<ClCompile Include="..\windows_compat.cpp" />

View File

@ -101,7 +101,6 @@
<ClCompile Include="..\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\unicode.cpp" />
<ClCompile Include="..\user_feedback.cpp" />
<ClCompile Include="..\using_iterators.cpp" />
<ClCompile Include="..\windows_compat.cpp" />

View File

@ -101,7 +101,6 @@
<ClCompile Include="..\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\unicode.cpp" />
<ClCompile Include="..\user_feedback.cpp" />
<ClCompile Include="..\using_iterators.cpp" />
<ClCompile Include="..\windows_compat.cpp" />

View File

@ -101,7 +101,6 @@
<ClCompile Include="..\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\unicode.cpp" />
<ClCompile Include="..\user_feedback.cpp" />
<ClCompile Include="..\using_iterators.cpp" />
<ClCompile Include="..\windows_compat.cpp" />

View File

@ -101,7 +101,6 @@
<ClCompile Include="..\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\unicode.cpp" />
<ClCompile Include="..\user_feedback.cpp" />
<ClCompile Include="..\using_iterators.cpp" />
<ClCompile Include="..\windows_compat.cpp" />

View File

@ -101,7 +101,6 @@
<ClCompile Include="..\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\unicode.cpp" />
<ClCompile Include="..\user_feedback.cpp" />
<ClCompile Include="..\using_iterators.cpp" />
<ClCompile Include="..\windows_compat.cpp" />

View File

@ -101,7 +101,6 @@
<ClCompile Include="..\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\unicode.cpp" />
<ClCompile Include="..\user_feedback.cpp" />
<ClCompile Include="..\using_iterators.cpp" />
<ClCompile Include="..\windows_compat.cpp" />

View File

@ -101,7 +101,6 @@
<ClCompile Include="..\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\unicode.cpp" />
<ClCompile Include="..\user_feedback.cpp" />
<ClCompile Include="..\using_iterators.cpp" />
<ClCompile Include="..\windows_compat.cpp" />

View File

@ -101,7 +101,6 @@
<ClCompile Include="..\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\unicode.cpp" />
<ClCompile Include="..\user_feedback.cpp" />
<ClCompile Include="..\using_iterators.cpp" />
<ClCompile Include="..\windows_compat.cpp" />

View File

@ -101,7 +101,6 @@
<ClCompile Include="..\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\unicode.cpp" />
<ClCompile Include="..\user_feedback.cpp" />
<ClCompile Include="..\using_iterators.cpp" />
<ClCompile Include="..\windows_compat.cpp" />

View File

@ -101,7 +101,6 @@
<ClCompile Include="..\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\unicode.cpp" />
<ClCompile Include="..\user_feedback.cpp" />
<ClCompile Include="..\using_iterators.cpp" />
<ClCompile Include="..\windows_compat.cpp" />

View File

@ -101,7 +101,6 @@
<ClCompile Include="..\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\unicode.cpp" />
<ClCompile Include="..\user_feedback.cpp" />
<ClCompile Include="..\using_iterators.cpp" />
<ClCompile Include="..\windows_compat.cpp" />

View File

@ -101,7 +101,6 @@
<ClCompile Include="..\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\unicode.cpp" />
<ClCompile Include="..\user_feedback.cpp" />
<ClCompile Include="..\using_iterators.cpp" />
<ClCompile Include="..\windows_compat.cpp" />

View File

@ -101,7 +101,6 @@
<ClCompile Include="..\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\unicode.cpp" />
<ClCompile Include="..\user_feedback.cpp" />
<ClCompile Include="..\using_iterators.cpp" />
<ClCompile Include="..\windows_compat.cpp" />

View File

@ -101,7 +101,6 @@
<ClCompile Include="..\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\unicode.cpp" />
<ClCompile Include="..\user_feedback.cpp" />
<ClCompile Include="..\using_iterators.cpp" />
<ClCompile Include="..\windows_compat.cpp" />

View File

@ -101,7 +101,6 @@
<ClCompile Include="..\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\unicode.cpp" />
<ClCompile Include="..\user_feedback.cpp" />
<ClCompile Include="..\using_iterators.cpp" />
<ClCompile Include="..\windows_compat.cpp" />

View File

@ -38,6 +38,7 @@
<ClInclude Include="include\toml++\impl\array.h" />
<ClInclude Include="include\toml++\impl\array.inl" />
<ClInclude Include="include\toml++\impl\date_time.h" />
<ClInclude Include="include\toml++\impl\simd.h" />
<ClInclude Include="include\toml++\impl\std_utility.h" />
<ClInclude Include="include\toml++\impl\toml_formatter.h" />
<ClInclude Include="include\toml++\impl\toml_formatter.inl" />

View File

@ -130,6 +130,9 @@
<ClInclude Include="include\toml++\impl\std_utility.h">
<Filter>include\impl</Filter>
</ClInclude>
<ClInclude Include="include\toml++\impl\simd.h">
<Filter>include\impl</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="toml++.props" />

907
toml.hpp

File diff suppressed because it is too large Load Diff

View File

@ -187,9 +187,15 @@ def main():
ignore_list = ( # macros that are meant to stay public (user configs etc)
r'TOMLPLUSPLUS_H',
r'INCLUDE_TOMLPLUSPLUS_H',
r'POXY_IMPLEMENTATION_DETAIL',
r'TOML_ALL_INLINE',
r'TOML_API',
r'TOML_CONFIG_HEADER',
r'TOML_ENABLE_FORMATTERS',
r'TOML_ENABLE_PARSER',
r'TOML_ENABLE_SIMD',
r'TOML_ENABLE_UNRELEASED_FEATURES',
r'TOML_ENABLE_WINDOWS_COMPAT',
r'TOML_EXCEPTIONS',
r'TOML_EXTERN_TEMPLATES',
r'TOML_HEADER_ONLY',
@ -202,14 +208,9 @@ def main():
r'TOML_LIB_SINGLE_HEADER',
r'TOML_MAX_NESTED_VALUES',
r'TOML_OPTIONAL_TYPE',
r'TOML_ENABLE_PARSER',
r'TOML_ENABLE_FORMATTERS',
r'TOML_SMALL_FLOAT_TYPE',
r'TOML_SMALL_INT_TYPE',
r'TOML_UNDEF_MACROS',
r'TOML_ENABLE_UNRELEASED_FEATURES',
r'TOML_ENABLE_WINDOWS_COMPAT',
r'POXY_IMPLEMENTATION_DETAIL',
)
set_defines = []
for define, currently_set in defines.items():

View File

@ -144,7 +144,6 @@ def main():
<ClCompile Include="..\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\unicode.cpp" />
<ClCompile Include="..\user_feedback.cpp" />
<ClCompile Include="..\using_iterators.cpp" />
<ClCompile Include="..\windows_compat.cpp" />