aboutsummaryrefslogtreecommitdiff
path: root/include/cps/Preprocessor.h
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-27 13:55:36 +0000
committer_ov4 <ov4@ov4.org>2026-10-27 13:55:36 +0000
commita91bd145008432fb8c5d91d94ab6f50473a277f5 (patch)
tree87af3ebcd2888e129bad9863574567e1c97bb18b /include/cps/Preprocessor.h
parent24f410430b33aaf1f288b83ea37e18fa959e9d3e (diff)
feat(preprocessor): add file-local conditional switches
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'include/cps/Preprocessor.h')
-rw-r--r--include/cps/Preprocessor.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/cps/Preprocessor.h b/include/cps/Preprocessor.h
new file mode 100644
index 0000000..ebc2806
--- /dev/null
+++ b/include/cps/Preprocessor.h
@@ -0,0 +1,19 @@
+#pragma once
+#include <istream>
+#include <string>
+#include <vector>
+
+namespace cps {
+
+struct PreprocessedSource {
+ std::string Text;
+ // One entry per original source line, before processing that line's directive.
+ std::vector<bool> LibraryLines;
+ bool HadError = false;
+};
+
+// Switches and conditional nesting belong to this input only. Masked lines retain
+// their byte lengths and line endings so the lexer sees original source locations.
+PreprocessedSource preprocess(std::istream &Input);
+
+}