aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-22 03:27:34 +0000
committer_ov4 <ov4@ov4.org>2026-10-22 03:58:26 +0000
commitf58bbaa006cb0bb29739a168ed39286f6db0a8b4 (patch)
treef680f08937d9845f31f9615cc548688d1928a2bb /include
parenta7b63b8f909f0c17894a9da25c6b274f46dcd0c7 (diff)
refactor(lexer): report lexer errors through a single helper
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'include')
-rw-r--r--include/cps/Lexer.h3
1 files changed, 3 insertions, 0 deletions
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<TokenData> 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;