1
0
mirror of https://github.com/nlohmann/json.git synced 2025-07-28 12:02:00 +03:00

🚸 improve diagnostics

This commit is contained in:
Niels Lohmann
2020-06-21 13:28:00 +02:00
parent 139a0258cc
commit e22ce45065
4 changed files with 43 additions and 2 deletions

View File

@ -8932,7 +8932,10 @@ class lexer : public lexer_base<BasicJsonType>
{
case std::char_traits<char_type>::eof():
case '\0':
{
error_message = "invalid comment; missing closing '*/'";
return false;
}
case '*':
{
@ -8957,7 +8960,10 @@ class lexer : public lexer_base<BasicJsonType>
// unexpected character after reading '/'
default:
{
error_message = "invalid comment; expecting '/' or '*' after '/'";
return false;
}
}
}
@ -9571,7 +9577,6 @@ scan_number_done:
{
if (not scan_comment())
{
error_message = "invalid comment";
return token_type::parse_error;
}