mirror of
https://github.com/nlohmann/json.git
synced 2026-11-03 19:29:22 +00:00
Build the parser's syntax error prefix with one concat() (#6013)
Since #6004 made the "while parsing" part unconditional, the three appends at the start of exception_message() are one fixed string around the context. Review follow-up to #6004. Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
1 parent
6d5581c4e8
commit
b18b6fc7e6
2 files changed
+2
-10
No files matched your search
@@ -573,11 +573,7 @@ class parser
|
||||
|
||||
std::string exception_message(const token_type expected, const std::string& context)
|
||||
{
|
||||
std::string error_msg = "syntax error ";
|
||||
|
||||
error_msg += concat("while parsing ", context, ' ');
|
||||
|
||||
error_msg += "- ";
|
||||
std::string error_msg = concat("syntax error while parsing ", context, " - ");
|
||||
|
||||
if (last_token == token_type::parse_error)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user