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:
Niels Lohmann authored and GitHub committed 2026-11-02 18:27:08 +01:00
1 parent 6d5581c4e8
commit b18b6fc7e6
2 files changed
+2 -10

No files matched your search

+1 -5
View File
@@ -23802,11 +23802,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)
{