mirror of
https://github.com/nlohmann/json.git
synced 2026-11-02 19:05:35 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
07876e2292 |
No files matched your search
@@ -251,8 +251,12 @@ std::string diagnostics(const error_site site)
|
|||||||
std::string context;
|
std::string context;
|
||||||
#if JSON_DIAGNOSTICS
|
#if JSON_DIAGNOSTICS
|
||||||
std::vector<std::string> tokens;
|
std::vector<std::string> tokens;
|
||||||
// a value that is not found leaves no tokens, like the root
|
const bool found = edited ? value_path<true>(d, site.value(), tokens) : value_path<false>(d, site.value(), tokens);
|
||||||
static_cast<void>(edited ? value_path<true>(d, site.value(), tokens) : value_path<false>(d, site.value(), tokens));
|
if (!found)
|
||||||
|
{
|
||||||
|
// a value that is not found has no path, and with it no bytes
|
||||||
|
return context;
|
||||||
|
}
|
||||||
if (!tokens.empty())
|
if (!tokens.empty())
|
||||||
{
|
{
|
||||||
// the root value has no path, but still has a byte range
|
// the root value has no path, but still has a byte range
|
||||||
|
|||||||
Generated
+6
-2
@@ -5080,8 +5080,12 @@ std::string diagnostics(const error_site site)
|
|||||||
std::string context;
|
std::string context;
|
||||||
#if JSON_DIAGNOSTICS
|
#if JSON_DIAGNOSTICS
|
||||||
std::vector<std::string> tokens;
|
std::vector<std::string> tokens;
|
||||||
// a value that is not found leaves no tokens, like the root
|
const bool found = edited ? value_path<true>(d, site.value(), tokens) : value_path<false>(d, site.value(), tokens);
|
||||||
static_cast<void>(edited ? value_path<true>(d, site.value(), tokens) : value_path<false>(d, site.value(), tokens));
|
if (!found)
|
||||||
|
{
|
||||||
|
// a value that is not found has no path, and with it no bytes
|
||||||
|
return context;
|
||||||
|
}
|
||||||
if (!tokens.empty())
|
if (!tokens.empty())
|
||||||
{
|
{
|
||||||
// the root value has no path, but still has a byte range
|
// the root value has no path, but still has a byte range
|
||||||
|
|||||||
Reference in new issue
Block a user