aboutsummaryrefslogtreecommitdiff
path: root/include/cps/Lexer.h
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-13 03:23:52 +0000
committer_ov4 <ov4@ov4.org>2026-10-13 03:23:52 +0000
commitf9a0c7e9687bc3e113f4c8f44861533c9ca48b3a (patch)
tree5d51c5a403dd096b0c3748118409be20eb3e1900 /include/cps/Lexer.h
parent3818460a473bd3ffcd35f09eb6429e1b0f00bc07 (diff)
feat: compile source files with configurable IR output
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Diffstat (limited to 'include/cps/Lexer.h')
-rw-r--r--include/cps/Lexer.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/cps/Lexer.h b/include/cps/Lexer.h
index 2af0260..d83e808 100644
--- a/include/cps/Lexer.h
+++ b/include/cps/Lexer.h
@@ -1,4 +1,5 @@
#pragma once
+#include <istream>
#include <string>
#include <cstdint>
@@ -87,9 +88,13 @@ enum Token {
};
class Lexer {
+ std::istream &Input;
+ int LastChar = ' ';
int CurrentLine = 1;
bool HadError = false;
public:
+ explicit Lexer(std::istream &Input) : Input(Input) {}
+
std::string IdentifierStr;
std::string StringVal;
int64_t NumVal;