From a8b5fef827300951fdc1b5720e14d52a60dae24e Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Thu, 6 Jun 2019 22:32:51 +0900 Subject: [PATCH] feat(WIP): add workaround to make literal compiles --- toml/literal.hpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/toml/literal.hpp b/toml/literal.hpp index 0e61cc9..5158495 100644 --- a/toml/literal.hpp +++ b/toml/literal.hpp @@ -53,7 +53,7 @@ inline ::toml::value operator""_toml(const char* str, std::size_t len) // If it is neither a table-key or a array-of-table-key, it may be a value. if(!is_table_key && !is_aots_key) { - if(auto data = ::toml::detail::parse_value(loc)) + if(auto data = ::toml::detail::parse_value<::toml::value>(loc)) { return data.unwrap(); } @@ -70,14 +70,14 @@ inline ::toml::value operator""_toml(const char* str, std::size_t len) // It is a valid toml file. // It should be parsed as if we parse a file with this content. - if(auto data = ::toml::detail::parse_toml_file(loc)) + if(auto data = ::toml::detail::parse_toml_file<::toml::value>(loc)) { - loc.reset(loc.begin()); // rollback to the top of the literal - // skip needless characters for error message - skip_line::invoke(loc); // skip the first several needless lines - skip_ws::invoke(loc); // skip the first several needless whitespaces - return ::toml::value(std::move(data.unwrap()), - ::toml::detail::region>(std::move(loc))); + // TODO later I need to move this logic to parse_toml_file +// loc.reset(loc.begin()); // rollback to the top of the literal +// // skip needless characters for error message +// skip_line::invoke(loc); // skip the first several needless lines +// skip_ws::invoke(loc); // skip the first several needless whitespaces + return data.unwrap(); } else // none of them. {