mirror of
https://github.com/nlohmann/json.git
synced 2026-03-17 14:35:58 +00:00
🚸 improve diagnostics
This commit is contained in:
@@ -865,7 +865,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 '*':
|
||||
{
|
||||
@@ -890,7 +893,10 @@ class lexer : public lexer_base<BasicJsonType>
|
||||
|
||||
// unexpected character after reading '/'
|
||||
default:
|
||||
{
|
||||
error_message = "invalid comment; expecting '/' or '*' after '/'";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1504,7 +1510,6 @@ scan_number_done:
|
||||
{
|
||||
if (not scan_comment())
|
||||
{
|
||||
error_message = "invalid comment";
|
||||
return token_type::parse_error;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user