From f58bbaa006cb0bb29739a168ed39286f6db0a8b4 Mon Sep 17 00:00:00 2001 From: _ov4 Date: Thu, 22 Oct 2026 03:27:34 +0000 Subject: refactor(lexer): report lexer errors through a single helper Co-Authored-By: Claude Opus 5.5 --- include/cps/Lexer.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/cps/Lexer.h b/include/cps/Lexer.h index 0ac2068..247c8d0 100644 --- a/include/cps/Lexer.h +++ b/include/cps/Lexer.h @@ -132,6 +132,9 @@ class Lexer { char Character; }; std::deque Lookahead; + // Reports a source error at Line (printf-style) and marks the lexer as failed. + __attribute__((format(printf, 3, 4))) + void reportError(int Line, const char *Format, ...); std::string readEscape(bool IsChar); int readToken(); TokenData captureToken(int Kind) const; -- cgit v1.3.1-4-g156e