aboutsummaryrefslogtreecommitdiff
path: root/lib/Parser/ParserExpression.cc
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-22 15:13:18 +0000
committer_ov4 <ov4@ov4.org>2026-10-22 15:33:15 +0000
commitcb62de1eba07d4c522213bdd8331686684b3468c (patch)
treee897aebab2105bc709794b7ed64df6193943b0d6 /lib/Parser/ParserExpression.cc
parentee615b2b3b2b7b336fdd4334dba68801681c9c7b (diff)
fix(parser): name the unexpected token in expression diagnostics
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Diffstat (limited to 'lib/Parser/ParserExpression.cc')
-rw-r--r--lib/Parser/ParserExpression.cc4
1 files changed, 2 insertions, 2 deletions
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<ExprAST> 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;
}
}