From cb62de1eba07d4c522213bdd8331686684b3468c Mon Sep 17 00:00:00 2001 From: _ov4 Date: Thu, 22 Oct 2026 15:13:18 +0000 Subject: fix(parser): name the unexpected token in expression diagnostics Co-Authored-By: Claude Sonnet 5.5 --- lib/Parser/ParserExpression.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/Parser/ParserExpression.cc') diff --git a/lib/Parser/ParserExpression.cc b/lib/Parser/ParserExpression.cc index b3bb3d9..8c5e8ce 100644 --- a/lib/Parser/ParserExpression.cc +++ b/lib/Parser/ParserExpression.cc @@ -279,8 +279,8 @@ std::unique_ptr Parser::ParsePrimaryImpl() { } case '(': return ParseParenExpr(); default: - cps::sourceError(Lex.getLine(), "unknown token '%c' (%d) when expecting an expression", - (char)CurTok, CurTok); + cps::sourceError(Lex.getLine(), "Expected an expression but found %s", + Lexer::tokenSpelling(CurTok, Lex).c_str()); return nullptr; } } -- cgit v1.3.1-4-g156e